# py2http

This module provides functionality to easily create HTTP services from Python
functions and class methods. It includes features such as method transformation,
input mapping, output mapping, error handling, and client generation.
The module also allows for customization through various configuration options
and provides the ability to generate OpenAPI specifications for the created HTTP
services. Additionally, it includes middleware, plugins, and decorators to enhance
the functionality of the HTTP services.

### Modules

| [`auth`](py2http.auth.html.md#module-py2http.auth)                       | Framework-independent credential checks, shared by the aiohttp middleware (`py2http.middleware`) and the Bottle plugins (`py2http.bottle_plugins`), so that both refuse the same tokens and keys for the same reasons.                                                    |
|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`bottle_plugins`](py2http.bottle_plugins.html.md#module-py2http.bottle_plugins)   | Plugins for adding middleware functionality to Bottle apps.                                                                                                                                                                                                               |
| [`config`](py2http.config.html.md#module-py2http.config)                   | The code module provides functions for retrieving configuration values for a function based on a hierarchy of sources, including function properties, configuration dictionaries, and default values.                                                                     |
| [`constants`](py2http.constants.html.md#module-py2http.constants)             | This module provides functionality for dispatching Python functions as HTTP services.                                                                                                                                                                                     |
| [`decorators`](py2http.decorators.html.md#module-py2http.decorators)           | Decorator tools for py2http.                                                                                                                                                                                                                                              |
| [`default_configs`](py2http.default_configs.html.md#module-py2http.default_configs) | This module provides default configurations, input mappers, output mappers, and error handlers for an HTTP service implemented in Python using the py2http library.                                                                                                       |
| [`diagnosis`](py2http.diagnosis.html.md#module-py2http.diagnosis)             | This module is meant to contain diagnosis and validation tools.                                                                                                                                                                                                           |
| [`flask_plugins`](py2http.flask_plugins.html.md#module-py2http.flask_plugins)     | Flask counterparts of the Bottle plugins: auth as a `before_request` hook, CORS as an `after_request` hook.                                                                                                                                                               |
| [`middleware`](py2http.middleware.html.md#module-py2http.middleware)           | aiohttp middleware that guards every route of an app: `mk_jwt_middleware` (a verified `Authorization: Bearer` JWT) and `mk_superadmin_middleware` (one shared key).                                                                                                       |
| [`obj_dispatch`](py2http.obj_dispatch.html.md#module-py2http.obj_dispatch)       | Dispatching HTTP requests to the attributes of objects, classes and modules.                                                                                                                                                                                              |
| [`openapi_utils`](py2http.openapi_utils.html.md#module-py2http.openapi_utils)     | This module is designed to generate OpenAPI specifications based on Python functions.                                                                                                                                                                                     |
| [`route_utils`](py2http.route_utils.html.md#module-py2http.route_utils)         | This module provides functionality to create handlers for class methods, based on input classes and method names.                                                                                                                                                         |
| [`schema_tools`](py2http.schema_tools.html.md#module-py2http.schema_tools)       | This module provides functions for generating OpenAPI input and output schemas from Python functions, as well as validating input against a schema.                                                                                                                       |
| [`service`](py2http.service.html.md#module-py2http.service)                 | This Python module provides a framework for dispatching Python functions as HTTP services and generating OpenAPI specifications for these services.                                                                                                                       |
| [`sizeof`](py2http.sizeof.html.md#module-py2http.sizeof)                   | Approximate the memory an object holds, without walking more of it than a budget.                                                                                                                                                                                         |
| [`types`](py2http.types.html.md#module-py2http.types)                     | This module defines several type aliases and constants related to function parameters and signatures.                                                                                                                                                                     |
| [`util`](py2http.util.html.md#module-py2http.util)                       | This module contains various utilities including a `lazyprop` descriptor for lazy loading properties, a `CreateProcess` context manager for running functions in parallel processes, a `ModuleFoundIgnore` context manager for ignoring `ModuleNotFoundErrors`, and more. |
