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

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

Plugins for adding middleware functionality to Bottle apps.

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

This module provides functionality for dispatching Python functions as HTTP services.

decorators

Decorator tools for 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

This module is meant to contain diagnosis and validation tools.

flask_plugins

Flask counterparts of the Bottle plugins: auth as a before_request hook, CORS as an after_request hook.

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

Dispatching HTTP requests to the attributes of objects, classes and modules.

openapi_utils

This module is designed to generate OpenAPI specifications based on Python functions.

route_utils

This module provides functionality to create handlers for class methods, based on input classes and method names.

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

This Python module provides a framework for dispatching Python functions as HTTP services and generating OpenAPI specifications for these services.

sizeof

Approximate the memory an object holds, without walking more of it than a budget.

types

This module defines several type aliases and constants related to function parameters and signatures.

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.