Skip to main content

etchblok-test-api Documentation

A modern, high-performance Python framework for building robust and well-documented APIs with ease.

Overview

Welcome to etchblok-test-api! This framework is designed from the ground up to help you build fast, reliable, and scalable APIs with minimal effort. By leveraging standard Python type hints, it provides an incredible developer experience with powerful editor support, autocompletion, and less debugging.

At its core, etchblok-test-api is built on two key principles: speed and simplicity. It stands on the shoulders of giants, using Starlette for its high-performance asynchronous capabilities and Pydantic for robust data validation and serialization. This combination allows you to write clean, modern Python code that automatically gets validated, serialized, and documented into an interactive OpenAPI schema. Forget about manually writing documentation or wrestling with data validation—focus on your application's logic, and let the framework handle the rest.

Key Concepts

  • Path Operations Defining Path Operations: The heart of your API. Path operations are regular Python functions decorated to handle incoming requests. You can define endpoints for different HTTP methods (GET, POST, etc.) and URL paths, with full support for path parameters, query parameters, and more.

  • Data Validation with Pydantic Request Body and JSON: Define the shape of your data using standard Python types. The framework automatically validates incoming request data and serializes outgoing responses, catching errors early and ensuring your API is reliable. This also powers the automatic documentation.

  • Dependency Injection Dependency Injection System: A powerful and simple way to manage dependencies. Declare reusable components, like database connections or authentication logic, and have them automatically injected into your path operations. This helps you write modular, testable, and maintainable code.

  • Automatic API Documentation OpenAPI Schema Generation and Customization: Get interactive API documentation (powered by Swagger UI and ReDoc) for free, with zero extra effort. The framework generates an OpenAPI schema from your type hints and path operations, allowing you and your users to explore and test the API directly in the browser.

  • Security & Authentication Security and Authentication: A collection of tools and utilities to help you secure your API. It includes support for common schemes like OAuth2, API Keys, and HTTP Basic/Bearer authentication, all integrated with the automatic documentation.

  • Asynchronous Support Handling Async and Generator Callables: Write high-performance, non-blocking code using Python's native async/await syntax. The framework is built on an ASGI foundation, making it perfect for I/O-bound tasks and handling a high number of concurrent connections.

Common Use Cases

  • Building robust, production-ready RESTful APIs.
  • Creating high-performance microservices with complex data validation.
  • Developing backend services for web and mobile applications.
  • Serving machine learning models with real-time inference endpoints.
  • Building real-time applications using WebSockets or Server-Sent Events (SSE).

Getting Started

Ready to build your first API? We recommend starting with the Getting Started guide, which will walk you through the installation and a simple "Hello World" example.

From there, dive into the Getting Started with the FastAPI Class tutorial to understand the core application object. To learn how to build your first endpoints and handle data, check out the sections on Defining Path Operations and Request Body and JSON.