Fast and simple ASGI-framework for small web-applications.
Project description
NanoASGI: Asynchronous Python Web Framework
NanoASGI is a fast:zap:, simple and light:bulb:weight ASGI micro:microscope: web:earth_asia:-framework for Python:snake:. It is distributed as a single file module and has no dependencies other than the Python Standard Library.
Download and Install
Download :arrow_down: nanoasgi.py into your project directory. There are no hard dependencies other than the Python standard library. NanoASGI runs with Python versions above 3.7.
Example
# example.py
from nanoasgi import App, Response
app = App()
@app.on('startup')
async def on_startup():
print('Ready to serve requests')
@app.on('shutdown')
async def on_shutdown():
print('Shutting down')
@app.route('GET', '/api/hello/{name}/')
async def hello_handler(request, name):
return Response(
{'result': f'Hello {name}!'},
status=200,
headers=[('Content-Type', 'application/json')],
)
uvicorn example:app
visit docs for more infomation.
License
Code and documentation are available according to the MIT License:page_with_curl: (see LICENSE).
The NanoASGI logo however is NOT covered by that license. It is allowed to use the logo as a link to the repo or in direct context with the unmodified library. In all other cases, please ask first.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file NanoASGI-0.0.5.tar.gz
.
File metadata
- Download URL: NanoASGI-0.0.5.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83572d32a0de71fa4392b5fea3ad22011250525df1ccd2c44996fd4977495ecf |
|
MD5 | 17bc7ff65150bb6d9950ee1cea4cddd5 |
|
BLAKE2b-256 | 0a8b2f5a611a38257b5cd8e707b8d3a35347e84443586655e8cf95c74e5f0792 |
File details
Details for the file NanoASGI-0.0.5-py2.py3-none-any.whl
.
File metadata
- Download URL: NanoASGI-0.0.5-py2.py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709c3df8b215f0a528a6169905252e2ca4463791b10df82b6b01d6b1c3a8c69c |
|
MD5 | aa6f533e5f00dd88cff806ee6691fea7 |
|
BLAKE2b-256 | d807ee512a15f5d43517998e5a08f737cd1fc7c4130e364e8113b76ff5b267df |