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.9
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-1.0.10-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e733a5fe8e4df1bb81614f11a97c41f0dd87f272292d038ccf63614e7a623044 |
|
MD5 | a444a2ddd4839833b840b5b1f90895f8 |
|
BLAKE2b-256 | b2062bf6c8e2696c80272cc1ad21b98b0b62dabc10a184351f6b74b2bca9e7ef |
Hashes for asgi_tools-1.0.10-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 174ed76b04147d23edee73eb786a92b2cf4b6f89981093989a100fa8fe87d983 |
|
MD5 | a582d67901cf134e12104c80007a0beb |
|
BLAKE2b-256 | 6886f602f5aef820b479ca4773bb85a5588f7fb8168b91d0456490f8df37705e |
Hashes for asgi_tools-1.0.10-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e265459dab2df0ff688eefed39207fdf0d1a2598fc14f4cd9f1d2955026f18cb |
|
MD5 | d74883228d64ed2934e893df62a4a7e0 |
|
BLAKE2b-256 | be0400410675ac7c574fcb87c3f44d1ea5480b6f626dcb69201bb95c9a373467 |
Hashes for asgi_tools-1.0.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fff3ec4f0f37a317d3f2d30070efda74151147a36b1aa6ed271bd571893ff6b5 |
|
MD5 | da98c46406ba0cca1580d6fd7503dfea |
|
BLAKE2b-256 | 85f4c0224f915345b6de19d559f64037516a0ba271e17fe88c1474cfbedcc75c |
Hashes for asgi_tools-1.0.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15822d3834be0ec9eb40d26f5b25a13600abf4e462b4e5e11bbe73f6c6a3734c |
|
MD5 | 920f24c10cd13e17310611e258d62ed3 |
|
BLAKE2b-256 | 28b27f289f0c70b9232f07ba60fa16213be653f2dc867fa8d49b4acbfb922f03 |
Hashes for asgi_tools-1.0.10-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 107819fc540013fa85b7084339b73e7236caa0a4cdf5b8ebb89185e733e22b90 |
|
MD5 | 5aedf04d235e60eddb887835d74a96d0 |
|
BLAKE2b-256 | 07305be301a9cc66277b2d4b4c371fcceda8e7d219cd216b567917c8f4efc9ef |
Hashes for asgi_tools-1.0.10-cp312-cp312-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74c5b650e4df446044606696c4789afda6d8f533dce4065d7766b7723cf04d5a |
|
MD5 | 780f8c1639d8b3fd3a1f510382840610 |
|
BLAKE2b-256 | 6719906e291e05d03368d44474c86210ab1a322d6422778841dfeda40df29ecd |
Hashes for asgi_tools-1.0.10-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8cc0b80451776d419ec337aaf8fc88107006f673b146bdf769c3ae2f37a2555 |
|
MD5 | 67673e9155f0b53b0d00fbf437bf6d12 |
|
BLAKE2b-256 | 728ff4055380565cf574e5f6041945151eae749594f7d8c0e93f6c502986279d |
Hashes for asgi_tools-1.0.10-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70b03ec78c9bf1047c3880a911d0ce6ea3c5de713c3fd155ff8111087edca0f2 |
|
MD5 | 323ebf4ee709bd75ce421cf3db0711ba |
|
BLAKE2b-256 | d1c9d8af8a16e171b9aa2b4090993d5cea0aad89ec4b4c1b244aea7ba4dccadc |
Hashes for asgi_tools-1.0.10-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1193d17486efcd1bc3cd4149bf000000518043b7e2762f66675744cc1f1ba602 |
|
MD5 | 855afa026e35679687f25d750d4d45c2 |
|
BLAKE2b-256 | 48db462a16fe3d216f0fb302b796a0058bfb43b43334979f39e3512638f61063 |
Hashes for asgi_tools-1.0.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e11c0224f86a842489614a5be9f67aa05c027e34da25009156a5e5ce80c24da |
|
MD5 | f4f76a4b55742710ae31dd92ecc24cb7 |
|
BLAKE2b-256 | b790aec4109626d6cc96977008e0536dc1b5ac5f38930353106bd477d1c61a3b |
Hashes for asgi_tools-1.0.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3f81e3b73f4f28c900ad8db9ed3ddf56c9f9c456d4ac2b95b9eb6d837fa21da |
|
MD5 | 4913bcbd5a1b15ff25098ae73aa1a204 |
|
BLAKE2b-256 | 5e0c17a01e6fe214e199aa9bddb1af3054e59919c1341301ebebe3dcffa164dc |
Hashes for asgi_tools-1.0.10-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cf1197fe0d179074c9156e50b5b7ceada5974d96d4fd46641711b7c8d1aac4d |
|
MD5 | 624b2c27b5ae56e5713d847bd4f7f791 |
|
BLAKE2b-256 | 59d0cb0470cc47ed81b2da52e6b7a75cf55758fde3cc7d5bbc6f53380cf88d60 |
Hashes for asgi_tools-1.0.10-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e9d4e15ff3358d0704f3329265c372f5aecf10b1ecd75ced78acb7b69e68673 |
|
MD5 | a65c88242a934b8880cee977e04001db |
|
BLAKE2b-256 | 9eefd99b9313104de756158967d11f9926c6f30b58785a58291a279c3dadbfdf |
Hashes for asgi_tools-1.0.10-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8fac92f8efd606afb295ced2687ab3d3cb1d6bf727a6c0b5813df8975adc676 |
|
MD5 | a3d868e697127d6b9b5cceaa0ca7f38f |
|
BLAKE2b-256 | 5617447fb2139b5688882a81e77eb995b17f70687539a4ec69830ea73d7557d0 |
Hashes for asgi_tools-1.0.10-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74d6a393b3e39a782c587f5aadf0afdb976c015fcef4414915315677f0cb400e |
|
MD5 | 3427223135594285338cabde79fbcc8f |
|
BLAKE2b-256 | 0a2639315e23684f45a02a56c14d4ee98c16382ce2e6f317b91739783e1a89d4 |
Hashes for asgi_tools-1.0.10-cp310-cp310-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9e05077dc6c630c0a6c9553d075836a7489d70c2b758ab4879d873d6a4d0cd3 |
|
MD5 | 8f9a2b47a58fd00f12bb7d8541275aac |
|
BLAKE2b-256 | de9eec4e81d612edc206f435fabd659bf8fa8ce269e9d11b50b6a86c794d27a6 |
Hashes for asgi_tools-1.0.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e49925fd2e11266cb1410bc0b480b0647f4dbfb5b581ba2f88bb43200f10a968 |
|
MD5 | c75b41c0a27f4d5a803c473593d30342 |
|
BLAKE2b-256 | 5edc35708c8c5c2dbfdf2421a2b06d78cdfa50ff96c1f56c10f517c0396a257c |
Hashes for asgi_tools-1.0.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 108f22232275d70353adf590b4aab2cc2407f7684bc1fb9e54ba952a24cd6d18 |
|
MD5 | 9e049427b9a45570310ab7eac4e00856 |
|
BLAKE2b-256 | e80c96b63f79f7ac9e0f3b727ec669481fca547e0cb002adc24fc3b14b3ff9eb |
Hashes for asgi_tools-1.0.10-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d275bedfbb7e91d0e8e86c5d54fae84ac83d69eb3f5ea615ebb710e70cb5079 |
|
MD5 | 7eb128c0d4a935d6e478f53c7faaac93 |
|
BLAKE2b-256 | 9f5ffa569e4dd51cfd9deb792bf86ec6ebec86cc3c3e4d526ce16ab8b1029bbd |
Hashes for asgi_tools-1.0.10-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a64314a530081ba5b0072a880ce381366dc526a4049f41127eb99ff286dffdea |
|
MD5 | 548c725cdbb89e881c69649ed84d9a46 |
|
BLAKE2b-256 | 78d1e9a256cd96d76dab35fdce9bae87d2b50e5146b118bbced5aefc47f6d2f4 |
Hashes for asgi_tools-1.0.10-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cb9a206cc67ac9d82a8a8b41bfa0dda2b19438d195d1594288d00115573f9ac |
|
MD5 | ad24d54866dabdf1219d4f1d7fd56c39 |
|
BLAKE2b-256 | 346a9a08966300dd81801f781922aa37a4467177f5a678b8443e474c0642d931 |
Hashes for asgi_tools-1.0.10-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94f9c290758606750099a95dd198208696b5776e91b3c611f30be4a03039784d |
|
MD5 | f58055b0866d561bacf46fa535c69f91 |
|
BLAKE2b-256 | 6514755e2378d42e63a4e6783af5b2b638dd777f413c424ed3a65b72c58a4b5d |
Hashes for asgi_tools-1.0.10-cp39-cp39-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3e7190485632e85aa2c27b2b4e59e176901bbfcd77f2b5ef7e02c77f26b776b |
|
MD5 | 4505d8f0d453ecbb47a16933481f4f9f |
|
BLAKE2b-256 | 1929bb1aa5b3a421c8bffedd7bf07778d9df0f9033984b06786dce274f10fb48 |
Hashes for asgi_tools-1.0.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 441c4fe37d22d6481382f8974037effec795410e6d975b1a4685b2a0b4728e5a |
|
MD5 | 3eef53424801b05ac953cc05ffd604be |
|
BLAKE2b-256 | 8901b067f29b0e49f1dd8d3001f14b023141d51a4a18ac9ff35d71be6613817e |
Hashes for asgi_tools-1.0.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77eedd7ef5f33332534dd94c3738d48a745543f726922043b86336555659233d |
|
MD5 | fb57f4a0bbd4258ed4d7cc4dcb68b5ad |
|
BLAKE2b-256 | ff4777238ec1cd0620b064d56a79141977b7fc9285e7fb4acf14319c90165fe8 |
Hashes for asgi_tools-1.0.10-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c17f334de55f9fc1e426505e90903b31c820381a38df383b0af9358f141bdd3 |
|
MD5 | 6b85d9cae3c80b0711a828088f1c7b11 |
|
BLAKE2b-256 | 690fa91f5a1068d0f30599a048d526fbfb35ccf67814ab5aeb28f7160c798625 |
Hashes for asgi_tools-1.0.10-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 820c9a78550872b62909b07cdb98eec5672a1401f298d5023902e24a095bd604 |
|
MD5 | 23926806a252fb8a6d88e0444ebe5213 |
|
BLAKE2b-256 | 3d51df55926e5a49fead7854fe5930bb64eaf6e849ae1463688b311827d22edb |