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.62.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26fe658c115b99043c0055dda076ca12b4596e57c59389927dc06fa5ebe8715a |
|
MD5 | 98328a355381c8eae0cdd0928c09b952 |
|
BLAKE2b-256 | e2c9cb50899509fdf3eb7f863323687aa079a20e3f6d8121f20371f5111315f4 |
Hashes for asgi_tools-0.62.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfa3bf7ba808cb9b02801f6290ef156d43558f9407f1ba546cfcacde431a67dc |
|
MD5 | 637acbd910a8d8c7ec35a0c11e5b9656 |
|
BLAKE2b-256 | 2c7f930a47ca70df68fe7560c6eae13a5117db231e2905015295faba55c1578b |
Hashes for asgi_tools-0.62.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06d9098b39d4108731292f78236c8f7385117d4850f225ca1e1d084340a6ed3f |
|
MD5 | 640b24e7f5303cfe3d470309ba318d39 |
|
BLAKE2b-256 | b585d619c378d3b74b21718660ba51664dc36cb46d97de89c41c53b97dab30aa |
Hashes for asgi_tools-0.62.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 440652eafd23f046524cacdb35bf7d852520b2cfaa7d4144a1249e97e74a853e |
|
MD5 | f6fb9d15740549ced60df0da07acb0d2 |
|
BLAKE2b-256 | fef8dd6640f2c61a38ce513d41f71241a9f55dc4bec7d0c4a285b571236fc1b9 |
Hashes for asgi_tools-0.62.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f14dc175086b69bceaeca029ce66dbc3c09bf0b33666d92f4669eb26ea1f6d99 |
|
MD5 | 6bd94100133ab3b277808bcc59fd0e33 |
|
BLAKE2b-256 | f941bc9d7f0bad0be769c127a24b9bb84210572b9d8211ce5ad3db61f708ef7c |
Hashes for asgi_tools-0.62.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ef12ff773e9bb67fd8838b8d50044b777fc00e443f531425d488856b14bf0b4 |
|
MD5 | 7be20f9b4737282530cede99a01b81ab |
|
BLAKE2b-256 | 6cc40fcb634b45c5b7dbaaf66af9b277412f4b5bad2521030ee8addf1beeddca |
Hashes for asgi_tools-0.62.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 776c1201713d4e69d2378ac130e87bb0e0d2b35568669209252488a0e2d20221 |
|
MD5 | 567b20671db71ec4c5d6b94c01911fa2 |
|
BLAKE2b-256 | 46da37d0eff3009ee1399215f655e964aaf0ba14c56618bdc3eb5c79525a93f7 |
Hashes for asgi_tools-0.62.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15b128c465557e1bb3c10220ccbf39764c9698b36bad95ffc12b903815c93747 |
|
MD5 | 7ebff971dc5a94939d71d567bde9d1d8 |
|
BLAKE2b-256 | 3bec2f62d39c72092a3e50f5e7d04876089ae57045b2005f6db555a509e1ea07 |
Hashes for asgi_tools-0.62.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43b28c5603c1221b64b1f25172649518fdb1203abe3a9370a092e1bdca8cce33 |
|
MD5 | a238d63a7ab5b980505a295ddb9e0288 |
|
BLAKE2b-256 | 850e82e65966d8317be175159d7404bae19cb36a9ca87d882db56b51e5af85a5 |
Hashes for asgi_tools-0.62.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 474a85933dd9e34a1a4ed65e589e50fcf38327d2e743ffa0a8625c9718ffc6bf |
|
MD5 | b299afef491623caf2500e41f87388ea |
|
BLAKE2b-256 | e41133dcb7f4f4db24e8a06bcdf285578085f95dad4374a2166444099e780495 |
Hashes for asgi_tools-0.62.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 224aaedf53e81e7f86b20e273c069fe10f3e9f35129cb38da490e260e4ccf64c |
|
MD5 | 13735f81e646d81e50a42e4d6290e587 |
|
BLAKE2b-256 | 27e68ae4e9a17147b884e939346e7aed89a90b369cda6f9fe6708ddbadeb2b52 |
Hashes for asgi_tools-0.62.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8ccdae39ed106657cb1877432b8e799ef25dbb81c5315b42185f4152021235a |
|
MD5 | 3d684555144af01f6bbba001e271b01c |
|
BLAKE2b-256 | 370652b2ca63ecf086a29b4319100c2ff9cc698e23776ed4e91107adf82971ad |
Hashes for asgi_tools-0.62.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2562b08f3674d490ce5371744d26766620771032216927e5a824c35ba719de9d |
|
MD5 | 013efb264af5cb64436de38c04589e78 |
|
BLAKE2b-256 | 34461c75232437c6fc2991ee969c8c500c31dd92f2252f3472e17413ec3ede47 |
Hashes for asgi_tools-0.62.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a81daa25787653de24290d85e453395954ebdae733cda443fda00c7e04efd1e |
|
MD5 | f8d12f4db1f96c775a55f24f46c888a6 |
|
BLAKE2b-256 | 83e700833f61b7a7c22eec5255dc0b93c84eab542fdd8e50818547c562096001 |
Hashes for asgi_tools-0.62.1-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2218eed41328fcf38acb88a196254e9ff5718489c873fb9c525f87e6b0e1564c |
|
MD5 | ced6134478bc6c0a553827f09bf5fe68 |
|
BLAKE2b-256 | b8e65ec59e583913b76bb83290baa90befb427356d45602c98d25464eb67876c |
Hashes for asgi_tools-0.62.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05cb50cc83c75bb90b91670c552fd07438c246efae95e36ab4bfc7de07f167ed |
|
MD5 | 0eff1489f8353d9df6713be4327cfa72 |
|
BLAKE2b-256 | e9ac717102d89ae17b1e8e611f12adf109781626641d88ad33a8d58155fda27b |
Hashes for asgi_tools-0.62.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e056f6f4c2b8ea968f40c113f8a59e83600b7ae7d5038f83032535c8db3fef5 |
|
MD5 | ffa5002ec2ac7ef9a289ee906f91b1d1 |
|
BLAKE2b-256 | 00b52490f89cdea4be53ae6b3b241d9b7a589aec402c2793ec8e1c8bafb60900 |
Hashes for asgi_tools-0.62.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d59f972bd29fff65cb2ac6f59b834387c4b5c90bd1659f8d73cc21982573f979 |
|
MD5 | 9b829b0362acbdcb7c06482e1ac11a2b |
|
BLAKE2b-256 | 681503fa422f0a9c52918799f15f5c8d46e92fe5c36bca4e6a7625f97925c388 |
Hashes for asgi_tools-0.62.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0097a3e4a177f4e6c38cc08950744a092dd71a329246771f85a2b2aa733ac880 |
|
MD5 | 27cdda4a007878b1e162d797c42d5f59 |
|
BLAKE2b-256 | 61329c3c8dd9f1535ecab5a3521681a8cf22e3a1b2bb5b85c7d1ef298e777a1a |