This release is a pre-release and may not be stable for production use.
aioapi
Yet another way to build APIs using AIOHTTP framework.
Follow documentation to know what you can do with AIOAPI.
Installation
$ pip install aioapi
Usage & Examples
Below you can find a simple, but powerful example of AIOAPI library usage:
import aioapi as api
from aioapi import Body, PathParam
from aioapi.middlewares import validation_error_middleware
from aiohttp import web
from pydantic import BaseModel
class User(BaseModel):
name: str
age: int = 42
async def hello_body(user_id: PathParam[int], body: Body[User]):
user = body.cleaned
return web.json_response(
{"id": user_id.cleaned, "name": user.name, "age": user.age}
)
def main():
app = web.Application()
app.add_routes([api.post("/hello/{user_id}", hello_body)])
app.middlewares.append(validation_error_middleware)
web.run_app(app)
if __name__ == "__main__":
main()
And there are also more examples of usage at examples/ directory.
To run them use command below:
$ make example
Contributing
To work on the AIOAPI codebase, you'll want to clone the project locally and install the required dependencies via poetry:
$ git clone git@github.com:Gr1N/aioapi.git
$ make install
To run tests and linters use command below:
$ make lint && make test
If you want to run only tests or linters you can explicitly specify what you want to run, e.g.:
$ make lint-black
Milestones
If you're interesting in project's future you can find milestones and plans at projects page.
License
AIOAPI is licensed under the MIT license. See the license file for details.
Metadata
Release files for aioapi 0.3.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aioapi-0.3.0a2.tar.gz | 8.5 kB | Without provenance | Details for aioapi-0.3.0a2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aioapi-0.3.0a2-py3-none-any.whl | Python 3 | none | any | Details for aioapi-0.3.0a2-py3-none-any.whl |
Total release size: 17.9 kB
Release files / aioapi-0.3.0a2.tar.gz
| Download URL | aioapi-0.3.0a2.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9585fe82b0db5124546d5f0d0ecb532339852703e18d4013c08a3d9a51faaab
|
|
BLAKE2b-256 checksum How to use checksums |
844d6583e941a30791aa09d15a3c33a551c6f355f40eb4d4ab39251a946814ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.8.0 Linux/5.0.0-1027-azure
|
Release files / aioapi-0.3.0a2-py3-none-any.whl
| Download URL | aioapi-0.3.0a2-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5912dcc83c160ab5eb6acb43e4ddcc9dd501d935e5309e782cd7cb044f99a68d
|
|
BLAKE2b-256 checksum How to use checksums |
e03e96a843d49a2663f5a017a74fbf0ef8b7637c7c738ae8cca4fcab987fcd68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.8.0 Linux/5.0.0-1027-azure
|
Security for aioapi 0.3.0a2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.