Skip to main content

asgi_etags

Simple etags middleware for asgi apps.

Installation

The library is available on PyPI:

pip install asgi_etags

Or in the Releases tab, both in sdist format as well as wheels.

Supported Python versions

Currently the library supports Python 3.11 only.

Example usage:

With FastAPI

from fastapi import FastAPI
from hashlib import md5
from asgi_etags import ETagMiddleware

app = FastAPI()
app.add_middleware(ETagMiddleware, etag_generator=lambda body: md5(body).hexdigest())

@app.get("/")
def hello_world():
    return {"hello": "world"}

With Litestar

from litestar import Litestar
from hashlib import md5
from asgi_etags import ETagMiddlewareFactory

@get(path="/", media_type="application/json", sync_to_thread=False)
def hello_world() -> dict[str, str]:
    return {"hello": "world"}


app = Litestar(
    route_handlers=[hello_world],
    middleware=[ETagMiddlewareFactory(lambda body: md5(body).hexdigest())],
)

Metadata

Release files for asgi_etags 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asgi_etags 0.2.1
File Size Uploaded Provenance Actions
asgi_etags-0.2.1.tar.gz 4.4 kB Without provenance Details for asgi_etags-0.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for asgi_etags 0.2.1
File Actions
asgi_etags-0.2.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for asgi_etags-0.2.1-cp312-cp312-win_amd64.whl
asgi_etags-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for asgi_etags-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
asgi_etags-0.2.1-cp312-cp312-macosx_10_9_universal2.whl CPython 3.12 CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64) Details for asgi_etags-0.2.1-cp312-cp312-macosx_10_9_universal2.whl
asgi_etags-0.2.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for asgi_etags-0.2.1-cp311-cp311-win_amd64.whl
asgi_etags-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for asgi_etags-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
asgi_etags-0.2.1-cp311-cp311-macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) Details for asgi_etags-0.2.1-cp311-cp311-macosx_10_9_universal2.whl

Total release size: 731.8 kB

Release files / asgi_etags-0.2.1.tar.gz

Download URL asgi_etags-0.2.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
492b75c65e983e623a4c57f7daa5513c1ef9e6ca8d6946d4144aa61c27011305
BLAKE2b-256 checksum
How to use checksums
1ae72e84f84926bef9c49df7a98abb8b1c24c504cb41afe2615e5b6b671e6cbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.10.0 CPython/3.10.12

Release files / asgi_etags-0.2.1-cp312-cp312-win_amd64.whl

Download URL asgi_etags-0.2.1-cp312-cp312-win_amd64.whl
Size 58.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
e111015ce2b0ad122f9765bf7490de58ee46f6a0311ff3f2beef30df8167873f
BLAKE2b-256 checksum
How to use checksums
4d9d96788e677e69ed006c2bd3d1f2df94ca89be60b51dfc507d1d5229aa95c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.10.0 CPython/3.10.12

Release files / asgi_etags-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL asgi_etags-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 155.6 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ebb23ed231fd02ee7143d502204d8350e1b3d71abbab1ae7010f2c10a177c4ec
BLAKE2b-256 checksum
How to use checksums
da1c59d909b98d2021e6ff64b8cf871f65e28203e447b77185a27776857d1339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.10.0 CPython/3.10.12

Release files / asgi_etags-0.2.1-cp312-cp312-macosx_10_9_universal2.whl

Download URL asgi_etags-0.2.1-cp312-cp312-macosx_10_9_universal2.whl
Size 154.8 kB
Tags CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
31905b1c62c9bcabffe4a6b776a3988a7c11b9eb45f8a963974b949481a3f76d
BLAKE2b-256 checksum
How to use checksums
c2576447e2e38849ad0a3e3ea1b3d06a55d2dfe32cc26762a93494bfefeb3413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.10.0 CPython/3.10.12

Release files / asgi_etags-0.2.1-cp311-cp311-win_amd64.whl

Download URL asgi_etags-0.2.1-cp311-cp311-win_amd64.whl
Size 58.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
e5c84f13462f87cb381de75ec402d821f6732e6fd4cca3acd6d3ddcac8b2b57b
BLAKE2b-256 checksum
How to use checksums
2f6656fa9982522ef8d00c3771b547a382751ec46c8648a9f8ce11efd4abb6f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.10.0 CPython/3.10.12

Release files / asgi_etags-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL asgi_etags-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 149.3 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
30fee7ca44087ce0d05b00271c97d7c2818cd43295ace0101bae1e0ee1c0dc27
BLAKE2b-256 checksum
How to use checksums
9883f53a220d99384193d5f89e2d258860dc3639d2ba3b898dd16aedb878fb53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.10.0 CPython/3.10.12

Release files / asgi_etags-0.2.1-cp311-cp311-macosx_10_9_universal2.whl

Download URL asgi_etags-0.2.1-cp311-cp311-macosx_10_9_universal2.whl
Size 150.2 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
55a4cbfccd05c304bbc006ff476514a65250654e6be2fdd5b03c746f57b11f47
BLAKE2b-256 checksum
How to use checksums
c2b5e9434b0ce501eb378151bdf7eb8b9fd139e16316aff569ce7857a1f51c0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.10.0 CPython/3.10.12

Security for asgi_etags 0.2.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page