Vanillacorn
Nothing but a vanilla ASGI server.
A simple implementation of the ASGI specification 2.5 (2024-06-05) using pure Python and asyncio (Py3.9 or above). The system is meant to use zero external libraries and contained in a single file, because why not...?
Installation
- Install using pip (pypi.org)
pip install vanillacorn
- Single file server
# 1. Download `vanillacorn.py`
wget https://raw.githubusercontent.com/bRuttaZz/vanillacorn/refs/heads/main/vanillacorn.py
# 2. Make it executable
chmod +x vanillacorn.py
# 3. Run the server
./vanillacorn.py --help
# [or] run it with python interpreter
python3 vanillacorn.py --help
Usage
usage: vanillacorn [-h] [-v] [-p PORT] [-b HOST] [-w WORKERS] [-s] [--verbose] [-l FILE] [--ssl-keyfile FILE] [--ssl-certfile FILE] [asgi_app]
A simple ASGI server: a basic implementation of the ASGI specification using pure Python and asyncio.
positional arguments:
asgi_app ASGI app module
options:
-h, --help show this help message and exit
-v, --version App version
-p, --port PORT Bind socket to this port (default: 8075)
-b, --host HOST Bind socket to this host. (default: localhost)
-w, --workers WORKERS
Number of worker processes
-s, --silent Suppress console logging
--verbose Show detailed logging
-l, --log-file FILE Write server logs into log file
--ssl-keyfile FILE SSL key file for TLS
--ssl-certfile FILE SSL certfile for TLS
Sample Use case
To start a simple asgi application say main:app
vanillacorn -p 8000 main:app
# to run in https mode
vanillacorn -p 8000 --ssl-key key.pem --ssl-cert cert.pem main:app
Caveats
- Currently ignoring ws subprotocols and ws extensions
TODO:
- implement http/ws read and buffering limits
- test cases
Metadata
Release files for vanillacorn 0.1.2
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 |
|---|---|---|---|---|
| vanillacorn-0.1.2.tar.gz | 1.3 MB | Without provenance | Details for vanillacorn-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vanillacorn-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for vanillacorn-0.1.2-py3-none-any.whl |
Total release size: 1.3 MB
Release files / vanillacorn-0.1.2.tar.gz
| Download URL | vanillacorn-0.1.2.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd8dcfff6781d193913b56d166817d0d38dd263d9ab0e75eb66a2bc62688b5ce
|
|
BLAKE2b-256 checksum How to use checksums |
d7b4b72122795a45ec2adc9815dc1ec75cfaff24d308fa5a7e7524543a885d0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Release files / vanillacorn-0.1.2-py3-none-any.whl
| Download URL | vanillacorn-0.1.2-py3-none-any.whl |
|---|---|
| Size | 25.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e788496e375e35cb9f39c310dc08863079e0af4ff7b618d847cc6b3211c32ab2
|
|
BLAKE2b-256 checksum How to use checksums |
b575f9ce9fc010fd359dcc3dea00a083a06f6f66cb7946bde82c738bca330314
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Security for vanillacorn 0.1.2
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.