Skip to main content

gzip middleware for ASGI applications, extracted from Starlette

Project description

asgi-gzip

PyPI Changelog License

gzip middleware for ASGI applications, extracted from Starlette

Installation

Install this library using pip:

pip install asgi-gzip

Usage

from asgi_gzip import GZipMiddleware
from my_asgi_app import app

gzip_app = GZipMiddleware(app)

Consult the Starlette GZipMiddleware documentation for full details.

Should you use this package?

This package exists purely for use by ASGI applications that want to add gzip support without adding the whole of Starlette as a dependency.

But... Starlette is actually a very light dependency! It's a small codebase and it only depends on two other small libraries - check its install_requires in the Starlette setup.py module.

So if you don't mind adding Starlette as a dependency, you should consider using that directly instead.

Tracking Starlette

Since this code is extracted from Starlette, it's important to keep watch for changes and bug fixes to the Starlette implementation that should be replicated here.

The GitHub repository for this library uses Git scraping to track changes to a copy of the Starlette gzip.py module, which is kept in the tracking/ folder.

Any time a change to that file is detected, an issue will be automatically created in the repository. This issue should be closed once the change to Starlette has been applied here, if necessary.

For more details on how this works, see Automatically opening issues when tracked file content changes.

Development

To contribute to this library, first checkout the code. Then run the tests with uv:

cd asgi-gzip
uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asgi_gzip-0.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asgi_gzip-0.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file asgi_gzip-0.3.tar.gz.

File metadata

  • Download URL: asgi_gzip-0.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for asgi_gzip-0.3.tar.gz
Algorithm Hash digest
SHA256 e388bb804e430dd2ebd15fec72692d9d88ec1828d319a91e77f521982670b3f2
MD5 bdd818dc60a38475cf4aa6d39e95a2e5
BLAKE2b-256 811c253414da2384f2afe93370e1ac8117e167780fc4a0c6bd6f3c4011e69a91

See more details on using hashes here.

Provenance

The following attestation bundles were made for asgi_gzip-0.3.tar.gz:

Publisher: publish.yml on simonw/asgi-gzip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file asgi_gzip-0.3-py3-none-any.whl.

File metadata

  • Download URL: asgi_gzip-0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for asgi_gzip-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fcde1776c5217dbe4f486e5d53d5f56dd287a92432c2c262be00aad63116b5f4
MD5 2761e7e962bf3a131578ca0bd6989003
BLAKE2b-256 9b21b1d7a38aba8e71a7d2a595ae9aa77cf7c0e565f37dbe44739acb1baadd2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for asgi_gzip-0.3-py3-none-any.whl:

Publisher: publish.yml on simonw/asgi-gzip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page