https://github.com/davidbrochart/anycorn
A fork of Hypercorn that uses AnyIO.
https://github.com/davidbrochart/anycorn
Last synced: 11 months ago
JSON representation
A fork of Hypercorn that uses AnyIO.
- Host: GitHub
- URL: https://github.com/davidbrochart/anycorn
- Owner: davidbrochart
- License: mit
- Created: 2024-04-03T15:37:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-06T10:44:33.000Z (11 months ago)
- Last Synced: 2025-03-17T22:54:50.474Z (11 months ago)
- Language: Python
- Homepage:
- Size: 1.12 MB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
# Anycorn
Anycorn is a fork of [Hypercorn](https://github.com/pgjones/hypercorn) where `asyncio` and
[Trio](https://trio.readthedocs.io) compatibility is delegated to AnyIO, instead of having a
separate code base for each. Anycorn forked from version 0.16.0 of Hypercorn.
## Quickstart
Anycorn can be installed via [pip](https://docs.python.org/3/installing/index.html):
```bash
pip install anycorn
```
and requires Python 3.8 or higher.
With Anycorn, installed ASGI frameworks (or apps) can be served via the command line:
```bash
anycorn module:app
```
Alternatively, Anycorn can be used programatically:
```py
import anyio
from anycorn.config import Config
from anycorn import serve
from module import app
anyio.run(serve, app, Config())
```
See Hypercorn's
[documentation](https://hypercorn.readthedocs.io/en/latest/how_to_guides/api_usage.html) for more
details.