Skip to main content

Fast and simple ASGI-framework for small web-applications.

Project description

logo logo text

Lines of code GitHub issues GitHub top language GitHub Workflow Status GitHub GitHub issues GitHub forks GitHub stars GitHub license Twitter PyPI - Implementation PyPI - Python Version PyPI - Wheel PyPI PyPI - License PyPI - Downloads PyPI - Format PyPI - Status Downloads

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.

Buy Me A Coffee

LOGO - Perditax, CC0, via Wikimedia Commons

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NanoASGI-0.0.5.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

NanoASGI-0.0.5-py2.py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page