ASGI Toolkit to build web applications
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.8
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.73.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e17aa0b669328f39e2751933f97f7e619111d2b68519b2aebe31ba53185b89be |
|
MD5 | 2eb842964f51d3501875cad4fd538fd0 |
|
BLAKE2b-256 | e02f6a643a5b6b5367d7695e6fda89d3b983d5ea4ef1bb1485d0625a10b47da6 |
Hashes for asgi_tools-0.73.1-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a8024e6cb181172e34903b4d41f06e4fb23409ea4c0df6869f32f24cfa7903a |
|
MD5 | 7ec600fa52afe50831e3743e600e21df |
|
BLAKE2b-256 | 43b9988ab4cb3c8881920699ca106f7374f15f85953ab1546849de74484ae4b3 |
Hashes for asgi_tools-0.73.1-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 886247cb9121c991cdea59055a2a46f3e003e1c4c312892fcd47d8779542ff12 |
|
MD5 | 4a8e056d64bb7a1a2638126ba2a7c9b3 |
|
BLAKE2b-256 | 4203aec7096960cdced4a930a15bef2c14a996374eeef28809a2de02e3f75907 |
Hashes for asgi_tools-0.73.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdc3b5dc8b5e9eeb22c7348c1b358a9949b3be56c87be0d27caee966b8cf8efa |
|
MD5 | 4d6aabf6ee0b33ef8f471da1979a093d |
|
BLAKE2b-256 | ba106746c07b6c0f54d314e1855016eaf98b8c32f283f6e34afd23944c9d6db6 |
Hashes for asgi_tools-0.73.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09e124d5c7f4cb278482b4ff2ec0d0eb4fe3e7348837b677320d3003cf44f915 |
|
MD5 | 1db077bb022f1e57b34546f70a259a1c |
|
BLAKE2b-256 | 8a390b3338f309a6d6927e0ddcd336b57e3783a17d5910eb59ed0279fe57a0a5 |
Hashes for asgi_tools-0.73.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80a1b16ac1da436f0b4189b081e067e5f2f5cccd3661a83c9a65a9ff860ea2f8 |
|
MD5 | d084f6090f8f4891b86876d7f0faff85 |
|
BLAKE2b-256 | f2734e7fd66c408ba5fe15a8bf938188fdc61c3cdc9d70e972148d0a8a8dc134 |
Hashes for asgi_tools-0.73.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2994984cf21d958e34ce0278139480bdda76b2a9197be1447b64412dcf7a0084 |
|
MD5 | 983628a66c48a4b6787c97ef80ed601f |
|
BLAKE2b-256 | be7e510f16aa1834ce8a740c266716282bb9b513f3db96ce815d5e630bccc5d9 |
Hashes for asgi_tools-0.73.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4318292d5ac4b32133986c7ab1cdef0823d04c528324bc8b848b5e77c294494d |
|
MD5 | 71a2c71f97f55a1854d180a1645598c7 |
|
BLAKE2b-256 | ac9fd84cae01eb5466298350860db3f8ac99b33ff6bc7c6ed407d7ff9cd04907 |
Hashes for asgi_tools-0.73.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e27bd2eed0fde6da62222615e1f0c14c26795bba35329430d03573696630605 |
|
MD5 | 13d5e1fc077d542acba0b9947b93ece5 |
|
BLAKE2b-256 | 9743f3d43a470742b7cce87c99075908480e99d86336e7cf841cbc5f9022c9fb |
Hashes for asgi_tools-0.73.1-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c53b6b562586463f79ef71c2b6aa17c21778170283b5358a658f2da0d0e9cf4 |
|
MD5 | 0429afeb50890d9cb163b88cb63ba8ef |
|
BLAKE2b-256 | a68a3659e0bc66bbe7439a1bdf760db6fcf3602ff1eec7cb169c3aa72a33435a |
Hashes for asgi_tools-0.73.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75f05f73f94095651a25b9c257f7b552fe84003497f5207aa9a0c7996f647b8c |
|
MD5 | dd7608459e065f4371995dcb1d767987 |
|
BLAKE2b-256 | 17af452b74551fe7f89631008a5793896231b0ef28912496c314c08710507994 |
Hashes for asgi_tools-0.73.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e055e1ab4d661740d23f8c8cc9e416eadf0f6646f4f96879c6b3c1e8f461beef |
|
MD5 | fe7cc2547fd2e2a8aed854e61e2242d6 |
|
BLAKE2b-256 | 7c70ca723e42d58b9c5d32c3a50ecd5c386c3e372c44fa2d7cb04dd435d20e32 |
Hashes for asgi_tools-0.73.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8b09b03f6f77f49e0b9514c24e6ea5552bc5a776ad89b82866eb12a47c6b868 |
|
MD5 | 29002704109b8300730ad239f71e718a |
|
BLAKE2b-256 | 0e14dca1b90205579451815e700e45cd0ffcefb8808902524f847d823054b868 |
Hashes for asgi_tools-0.73.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdfc06a25fc9d28367e6498567ac977275144e0e2ba5fbb337a476eca9d283b7 |
|
MD5 | 2e7d5786f51339cc5b68888ea24baa53 |
|
BLAKE2b-256 | 8cab3e1eee24fa4a8fa5ab23d5605db40c473931bc937b271157b17a1a820dc3 |
Hashes for asgi_tools-0.73.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 374c4e03c9dc0ab817b016a0f14a01388e35a20625ae829b93f68256a2a3abe0 |
|
MD5 | b0541e12f1ca11d6f992e3ed0f2338e1 |
|
BLAKE2b-256 | 3f6d2851868f122e959e192398a68382146f9c1ddf53cb5cccc6927019dcf519 |
Hashes for asgi_tools-0.73.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a259754aa93eaf6712030680d122b0dcc8101bd9f51510fdd1db26fdcbc59579 |
|
MD5 | 43a9ff6c7b0fda11c998c5a4c837eb04 |
|
BLAKE2b-256 | 3ee565cb3c29306315560e9e4205d4159dfdf2dc5597a61f3c623613b36d179b |
Hashes for asgi_tools-0.73.1-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 683de07038e685b491ea08ea7ddbce612f2cc6b83427b7e99ab351225dc9930e |
|
MD5 | 341d28447f7bdf146560478dbc89fdb4 |
|
BLAKE2b-256 | 67a87a56cd1f178f04d2b8360aae9fa9c4c31ed1ebe69e0437d541c04f328eef |
Hashes for asgi_tools-0.73.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 648c18eec4ae7fc47e56597bbfd4cc2fda25eb5fb479fc618f80294ead9a2c38 |
|
MD5 | b3ef585d0a21c3b503b84936dd9d2e9a |
|
BLAKE2b-256 | 60f04617446a9813e1c275022de4b3207c3e1775279321b2c186620419ffa39a |
Hashes for asgi_tools-0.73.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1da329aad21375fa53d54ef52a17e2452637c649839828d441fb5ba44a4a92f |
|
MD5 | 317eb5dd58c94d229e72b8ff2a465bd0 |
|
BLAKE2b-256 | fe73209cbbe37042d552902cda0c567c107440244cbd14d12bdf1461e9af2519 |
Hashes for asgi_tools-0.73.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4025b1f7de5382785e129c46e5dd56bb36caf4910819222f6cef0d685e30ca37 |
|
MD5 | e843912f220b40fb60912a2ae7ccda0d |
|
BLAKE2b-256 | 681c7dd43ff5b31244080661611c4c4469b29223f208326e56258e72ea1418d3 |
Hashes for asgi_tools-0.73.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9d227f1ecec204ceac562bd0176dc7dec0e93666390bbd42c98c626d5caae3d |
|
MD5 | 6b7759469e4e4c7a9ad23a479215f50a |
|
BLAKE2b-256 | 1826097b28d4a164a4fa238de3902bb0cd873a79ca2f6b718c25c0eefaca0217 |
Hashes for asgi_tools-0.73.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bce311c63af7f1f348770f0929c26381b09d9b542b7312b8fe60e6c2a448e80 |
|
MD5 | 4c6dc79f3499525d78a064da3d191556 |
|
BLAKE2b-256 | 738591330ca80a2f832b43ed22d92f5563e1b43d15b03d87691e834273bacbdd |
Hashes for asgi_tools-0.73.1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57ac754526bd58f4d3a958bb0a64a7df7a286aedf5c0ba615b423a348d5ff324 |
|
MD5 | 1848231d91a4c18a44f52d493229708b |
|
BLAKE2b-256 | 068659026521e94c30603e12d927685ab800512d0080086686ed57cbe59bd6d3 |
Hashes for asgi_tools-0.73.1-cp38-cp38-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad39beea8e5cd8157511fc81f267214cd3b29087e6c83560d200adef3cbd4736 |
|
MD5 | b27ad2d8480db8cb33a7f8264dcf409a |
|
BLAKE2b-256 | d0bdae050e400fd7adbec5fe6b2078158a2d9b48a18043f0173409b524004018 |
Hashes for asgi_tools-0.73.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b9ebbe27f771c8c5bb9c2cdf8c250c36666282d64a53c6c1115b50e28a06dc6 |
|
MD5 | 445a70f51ef0b03f7792924b14490a26 |
|
BLAKE2b-256 | 40b13c8b0963d935421f5be2728c7682484e1076f49570e181ad8ba345139de9 |
Hashes for asgi_tools-0.73.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 501df4d6c04b907d73855b5a10323ef4b8b47ca0548620079f1e90c08fc4eafb |
|
MD5 | 15c23976298c8b2b2d877451845804cf |
|
BLAKE2b-256 | 5c6d674aea49392683c185211182c803ce5f132e528f6928f0638599a2745ecc |
Hashes for asgi_tools-0.73.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7e6340493ff7691799230a4a5f78e6c6c5fd42c129f3eb528991d45865a1b8f |
|
MD5 | d98983378862136560f9920537eabb10 |
|
BLAKE2b-256 | 9f881e165c362bc956fb9150d0fafbbae171c41df8544e0efaa25a4f6d7ab057 |
Hashes for asgi_tools-0.73.1-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ead04f70f0b8c9c938d8645eb3f6a9048850609518fbf35c60eb2c06a98fc0b |
|
MD5 | aa26fb8fae98e2ca485d6df70972f60a |
|
BLAKE2b-256 | 651ce1f07c0484dd58f098aace9fece56083507c96952bdd6c627af5cb96e9a5 |