Is a toolkit to build ASGI applications faster
Project description
asgi-tools – Is a really lightweight ASGI Toolkit to build ASGI applications faster.
Documentation is here: https://klen.github.io/asgi-tools
ASGI-Tools is designed to be used as an ASGI Toolkit to quickly build really lightweight ASGI applications/middlewares/tools.
For instance these middlewares were built with the library:
Features:
Supports all most popular async python libraries: Asyncio, Trio and Curio
Request – Parse ASGI scope, get url, headers, cookies, read a request’s data/json/form-data
Response – Send HTTP (text, html, json, stream, sse, file, http errors) responses
ResponseWebsocket – Work with websockets
RequestMiddleware – Parse a scope and insert the parsed request into the scope
ResponseMiddleware – Parse responses and convert them into ASGI messages
RouterMiddleware – Route HTTP requests
LifespanMiddleware – Process a lifespan cycle
StaticFilesMiddleware – Serve static files from URL prefixes
asgi_tools.tests.TestClient – A test client with websockets support to test asgi applications
App – A simple foundation for ASGI apps
Requirements
python >= 3.7
ASGI-Tools belongs to the category of ASGI web frameworks, so it requires an ASGI HTTP server to run, such as uvicorn, daphne, or hypercorn.
Installation
asgi-tools should be installed using pip:
pip install asgi-tools
A Quick Example
You can use any of ASGI-Tools components independently.
Dispite this ASGI-Tools contains App helper to quickly build ASGI applications. For instance:
Save this to app.py.
from asgi_tools import App
app = App()
@app.route('/')
async def hello(request):
return "Hello World!"
Run it with uvicorn
$ uvicorn app:app
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/asgi-tools/issues
Contributing
Development of the project happens at: https://github.com/klen/asgi-tools
License
Licensed under a MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for asgi_tools-0.64.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21673cbf6f3e4c30027a591af819eaf218de1f6c2a55a55d015efe622c1863ca |
|
MD5 | 944bdbf24e0e249531c1a03062c660be |
|
BLAKE2b-256 | c937ddfd90ffbefb10aa6234df229e5aa44b5ba96d96ac4f525e3e4d06861470 |
Hashes for asgi_tools-0.64.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd45fc73c4fdc391a456235fd812f51939c4f3d99efe909d131eeb3840931746 |
|
MD5 | 103c6a05b1c142492083058f1da4169f |
|
BLAKE2b-256 | 2fdf10a5f35092947a5a280c43ddb5283a8c8ed85c34c658bce6c184c073a957 |
Hashes for asgi_tools-0.64.1-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6eeb823d93ad3433b9cb51655143a6fc0331283988871a1c42e84c2f60f0ba2 |
|
MD5 | c3affec3807c0c3710c74a7cc63aad70 |
|
BLAKE2b-256 | 1903d13df538c80a738e08f45e7097637f1015b1023a47dc014f23e604ca175b |
Hashes for asgi_tools-0.64.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd695ec5a54ed0ecd0594f9fcb76ccefa133b67f8e15ed3da852846fb28eb92e |
|
MD5 | 9ed962e7be2f8afbec8918c9e32e4e9e |
|
BLAKE2b-256 | 8aec63a3c4abb9e5aa19059781aff12e134f45a89d10bd3294814ea0d752b57c |
Hashes for asgi_tools-0.64.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f0517b710a71618bece91d2b5abc6e6985e4d15b50e6edbeeaa73fad15add8 |
|
MD5 | 9c5c5b72fe33d8310fa12149e60894c0 |
|
BLAKE2b-256 | ef8b3a0307c29d2324a93e4b910d2c9e11d250d97272a41e44307ab72450d9ca |
Hashes for asgi_tools-0.64.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75c342a560b7738c8cb6228479e44a1b9b7fe53da37386518cf3208e35a70bef |
|
MD5 | 00567ec02c4081c46381cf39832bd356 |
|
BLAKE2b-256 | e3ce42a622ab05961804cc1af9070b52acb55a6960a0bee9aac2e44bccd06da3 |
Hashes for asgi_tools-0.64.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 681a75ba43dceea42a5e3321e95cdb444c2945bbe3fb489ef81868c67fa36b02 |
|
MD5 | 1198000c9be6c47c050754cf2f343f9a |
|
BLAKE2b-256 | 5d1ad52c8788e04d17b540345bf05f2dba7247011962e4b1b952f8f6327ded57 |
Hashes for asgi_tools-0.64.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d07c65448d0ecf729481c60c2c8571b5e7d54b8c4ad378c06b7c5f57fadb90bc |
|
MD5 | 2b8d6b9772cbf5b636908062aa5471c5 |
|
BLAKE2b-256 | b9f08c2366dbddee07242ed8d9b2ba79960cbadc8137045f5c0eebcd7e90318b |
Hashes for asgi_tools-0.64.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10c1c3a7ff5f66e09c8d9e2bf383c306d8f0c380710fc234e4b74e8cc6f952b6 |
|
MD5 | a3ce735cefca32319d73f5c317bd7e9d |
|
BLAKE2b-256 | 2cabe8acbe08d826cd345e2dc1cdd07645f1939d65211feb8096a2671a495d7e |
Hashes for asgi_tools-0.64.1-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01515e243161b8bfdd47e9bc254672f6a915a4e1484695c61ea4c23d5aa61604 |
|
MD5 | 88935782a329696a5adb63740cc0da8e |
|
BLAKE2b-256 | 69e516fa12b525fc743d5eb12eea009e1af6732328123a0d1250f4f358767fad |
Hashes for asgi_tools-0.64.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1adb15dcf79927f0d746bd2980ab66b00c4344407cb90ee7edaef6869d6c07c |
|
MD5 | 3fe4c1e7af10192484e6e789ed9db1e1 |
|
BLAKE2b-256 | 77d860bc88ac886e1e902b33516db4a97de8cd8d7c87794cdafd0d0aafef4001 |
Hashes for asgi_tools-0.64.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46b85092357d81e5588db28f893f173c0667a268d1b1a5676262491f3fe97723 |
|
MD5 | dd2738ffc8da211c2cd49742eda578c8 |
|
BLAKE2b-256 | 44d7ed5539328eda905808025cb801a740ba0608de91927010ab3ecc9e22b23b |
Hashes for asgi_tools-0.64.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a2628ff985e5f67065205061eb429a182c5433327a12b19758cf09c6a538cb2 |
|
MD5 | f94412709de6dba66675d148bd6ab694 |
|
BLAKE2b-256 | ae0e18735e65f0b1dcbd61460f04e9d2fc922925d720a43b185c81aaa66ebaa1 |
Hashes for asgi_tools-0.64.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c7db643be9fa79cdf984f035f1b4985c3125df39269a7c4e3668635446b470b |
|
MD5 | a6d48b610920f0c7cf32c1fcc5dea321 |
|
BLAKE2b-256 | 682cb709234f7cda33a7680cbde71b7a7136f5e1c30498f603b853576d6694e4 |
Hashes for asgi_tools-0.64.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b58325a9e7ce755e0ff8a06e38742a2de0b4a9ee071925a966ae4fcd2ec25178 |
|
MD5 | 2b555cd3f2d214157ba4f583013562b8 |
|
BLAKE2b-256 | 10592d2b575185934f8a15e85776f2b4d7882c87f5aa7a769d4f6630fa01ec7d |
Hashes for asgi_tools-0.64.1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d00a2e4203ac7a38277bb03336ff17e9188560dadcd2a76fb01566e000023c53 |
|
MD5 | c2018a4c89de3e3a4ff81399180e2745 |
|
BLAKE2b-256 | 3aced6519d34377ac1733a4a0aca03bc22cc763b95e49de3abdbce310bfeeb94 |
Hashes for asgi_tools-0.64.1-cp38-cp38-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 090df7d328c117dcaa3668fe855b0d0a615e4e9424d195723f868655ca0ab1c6 |
|
MD5 | 6f9be9ce68f2767b670c6595bcfd2829 |
|
BLAKE2b-256 | 303b98505b9cf5face04ca1617cceeea4f2494925ecadeabe5c9f049d5b2e141 |
Hashes for asgi_tools-0.64.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 241ee75fae9478c26fd6501f58a760412cd3abe933a7414b2a8444b895ca34fa |
|
MD5 | 5ede189b41bc0455ee60a583ee644f9b |
|
BLAKE2b-256 | 405c760e6c687c285994b81f3cd257056fde51c7092ae2bbe5e7e6c4cfa7da7f |
Hashes for asgi_tools-0.64.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 302a68d0a79ba16f45d0316ed73b80495e62e0a9cc70cb97d7e6dfb36217ad95 |
|
MD5 | 296b897298287cd902a67ba5b0b2a98a |
|
BLAKE2b-256 | 87f7d16f4de4728e69d771b2258cc2698416d4ac2c5188d850c600febc20fd66 |
Hashes for asgi_tools-0.64.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ceda26e34f0e53bcb73545283c2f5d2f030065915a70a85677dd02f4fccc047 |
|
MD5 | 66093458f0d2451be69a6ed6bce2369c |
|
BLAKE2b-256 | 1b06b2577030dc68b3a081e1559efbc7f54cfcad8db1d35178d8d95e1a90e0f2 |
Hashes for asgi_tools-0.64.1-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afee9f4e9fc1221d3e380bce73f09c7989a246a22e8e99c944ebf2e7c7681e19 |
|
MD5 | e37b199caefcc94b45190ec48f33274e |
|
BLAKE2b-256 | aaaa17675338d3a48a4526c42741ca6bcbf538c28937a630579afb6743e2b234 |
Hashes for asgi_tools-0.64.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69c999c813424017bb8777babb5af07e2060bc6470cc0dd863898785af838547 |
|
MD5 | 0ee6140db8115e60104e4e8cb213079d |
|
BLAKE2b-256 | f94161d9ba9407fcda23e751052c95d9bde2f4b9d20ed7d01ecd4d054d82e3d9 |
Hashes for asgi_tools-0.64.1-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c811badd726939cf7a378f4a67dd4d62cfa4256bed9ad9daf4c9364052f2d9 |
|
MD5 | d517bb9915ae730fc59b92d6258a37fa |
|
BLAKE2b-256 | 3a57a00472df52a94cf8a453163e42c4143291d0a65ac69579f0fb3d34c1ea8f |
Hashes for asgi_tools-0.64.1-cp37-cp37m-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7926eb9cc9f62e3050e36d0c8a059df72f5c1ccad6c435f2c5d26f2214f707b2 |
|
MD5 | 37a670dac788c649e88dd600108fdc4a |
|
BLAKE2b-256 | b6bce6feb2221157a3b4e2913315a4c44fff98fefcdbab133f6e2552b7463ee0 |
Hashes for asgi_tools-0.64.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88426a2f40052cd3ceb015b01272d7b7d9b1a872435ee457eaf1e5f9df804726 |
|
MD5 | 06573a9486bb40493083df2ce73a1874 |
|
BLAKE2b-256 | 35d820f0605f56a0986f3db2d1915f1c71b8730833ee7dae2be982c817d78f2c |
Hashes for asgi_tools-0.64.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0a55e6d7f72191100fc02d18816293b05561be581e77c17712c491174f31702 |
|
MD5 | 48df12d86e2289316cb3bbc51b876337 |
|
BLAKE2b-256 | a9460c0c01c7b4f6b29814d93e28883d799a769e64ea08d623e3302c622801ba |
Hashes for asgi_tools-0.64.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2645ae96a038b488bae363da2b4ffd6699bd17606cb3b8bd1bbddfcf27a2f4bb |
|
MD5 | c1aca40a98b60fb37c1940b7e49743a4 |
|
BLAKE2b-256 | c5203e7866e41169b7adfd80fe94786053a26e9a2a979bff8dc231f33c903a49 |