datasette-gzip by simonw

78 downloads this week        Star

Screenshot of simonw/datasette-gzip

README source code


PyPI Changelog Tests License

Add gzip compression to Datasette


Install this plugin in the same environment as Datasette.

datasette install datasette-gzip


Once installed, Datasette will obey the Accept-Encoding: header sent by browsers or other user agents and return content compressed in the most appropriate way.

This plugin is a thin wrapper for the asgi-gzip library, which extracts the GzipMiddleware from Starlette.


To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-gzip
python3 -mvenv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests: