Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/almarklein/asgineer
A really thin ASGI web framework
https://github.com/almarklein/asgineer
asgi framework python web
Last synced: about 1 month ago
JSON representation
A really thin ASGI web framework
- Host: GitHub
- URL: https://github.com/almarklein/asgineer
- Owner: almarklein
- License: bsd-2-clause
- Created: 2018-09-18T20:10:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T08:07:10.000Z (8 months ago)
- Last Synced: 2024-09-20T03:19:11.778Z (3 months ago)
- Topics: asgi, framework, python, web
- Language: Python
- Homepage: https://asgineer.readthedocs.io
- Size: 207 KB
- Stars: 55
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-asgi - Asgineer - A really thin ASGI web framework, which includes support for long polling, SSE and websockets. (Application frameworks)
README
# Asgineer
A really thin ASGI web framework 🐍🤘[![Build Status](https://github.com/almarklein/asgineer/workflows/CI/badge.svg)](https://github.com/almarklein/asgineer/actions)
[![Documentation Status](https://readthedocs.org/projects/asgineer/badge/?version=latest)](https://asgineer.readthedocs.io/?badge=latest)
[![Package Version](https://badge.fury.io/py/asgineer.svg)](https://pypi.org/project/asgineer)## Introduction
[Asgineer](https://asgineer.readthedocs.io) is a tool to write asynchronous
web applications, using as few abstractions as possible, while still
offering a friendly API. The
[guide](https://asgineer.readthedocs.io/guide.html) and
[reference](https://asgineer.readthedocs.io/reference.html) take just a few
minutes to read!When running Asgineer on [Uvicorn](https://github.com/encode/uvicorn),
it is one of the fastest web frameworks available. It supports http
long polling, server side events (SSE), and websockets. And has utilities
to serve assets the right (and fast) way.Asgineer is proudly used to serve e.g. https://pyzo.org and https://timetagger.app.
## Example
```py
# example.pyimport asgineer
@asgineer.to_asgi
async def main(request):
return f"You requested {request.path}"if __name__ == '__main__':
asgineer.run(main, 'uvicorn', 'localhost:8080')
```You can start the server by running this script, or start it the *ASGI way*, e.g.
with Uvicorn:
```
$ uvicorn example:main --host=localhost --port=8080
```## Installation and dependencies
Asgineer needs Python 3.6 or higher. To install or upgrade, run:
```
$ pip install -U asgineer
```Asgineer has zero hard dependencies, but it
needs an ASGI server to run on, like
[Uvicorn](https://github.com/encode/uvicorn),
[Hypercorn](https://gitlab.com/pgjones/hypercorn), or
[Daphne](https://github.com/django/daphne).## Development
Extra dev dependencies: `pip install invoke pytest pytest-cov black flake8 requests websockets`
Run `invoke -l` to get a list of dev commands, e.g.:
* `invoke autoformat` to apply Black code formatting.
* `invoke lint` to test for unused imports and more.
* `invoke tests` to run the tests, optionally set the `ASGI_SERVER` environment variable.## License
BSD 2-clause.