django-dataexporter¶
django-dataexporter is a extensible helper to export Django QuerySets and other data to CSV and Excel.
Features¶
Exporter class to generate CSV and Excel files out of QuerySets and other iterables.
Factory to generate Django ModelAdmin actions to trigger an export out of Django’s famous admin interface.
Requirements¶
django-dataexporter supports Python 3.10+ and Django 3.2+.
In addition, the Python package openpyxl needs to be installed.
Prepare for development¶
A Python 3.10+ interpreter is required in addition to uv.
Install uv:
$ curl -LsSf https://astral.sh/uv/install.sh | sh
# or
$ pip install uv
Install dependencies:
$ uv sync --extra dev
Set up pre-commit hooks (optional but recommended):
$ uv run pre-commit install
Now you’re ready to run the tests:
$ uv run pytest
Run linting and formatting checks:
$ uv run ruff check .
$ uv run ruff format --check .
Run tests with coverage:
$ uv run pytest --cov
Run tests across multiple Python and Django versions (includes linting):
$ uv run tox
Format code with ruff:
$ uv run ruff format .
Run pre-commit on all files:
$ uv run pre-commit run --all-files
Resources¶
Contents:
Api documentation: