django-postgres-copy
Quickly import and export delimited data with Django support for PostgreSQL's COPY command
What it is and what it does
django-postgres-copy wraps PostgreSQL's native COPY command in a Django-friendly interface, letting you move delimited data directly from files without materializing rows in Python. It's designed for scenarios where you need to transfer large amounts of data into or out of a PostgreSQL table quickly—the COPY command bypasses Django's object instantiation and validation overhead.
The package provides a CopyMapping class that maps CSV columns to Django model fields and handles the mechanics of preparing data and executing the COPY operation. It's a thin, focused tool: no runtime dependencies, straightforward API, and production-stable across recent Django and Python versions. The aging maintenance status (last release 418 days ago) is offset by recent repository activity and broad version support, suggesting the package is stable rather than abandoned.
Use it for:
- Move large delimited files into PostgreSQL tables as part of a data pipeline.
- Export Django model querysets to delimited files for reporting.
- Migrate data between PostgreSQL tables using COPY for speed.
- Load seed data during deployment when performance matters.
- Integrate with external data sources that provide delimited formats.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Django ORM integration for PostgreSQL's COPY command to rapidly import and export delimited data without loading everything into memory.
Yes, if you use Django with PostgreSQL and need to move large volumes of delimited data. The package is production-stable, has no dependencies, and low install friction. The aging maintenance timeline is not a blocker—the code is stable and the repository shows recent activity. Install it if bulk operations speed is a requirement; skip it if you only work with small datasets or non-PostgreSQL databases.
Install
django-postgres-copy on PyPI
pip
pip install django-postgres-copyuv
uv add django-postgres-copypoetry
poetry add django-postgres-copyInstalling django-postgres-copy
Before you install
Low friction installation with no runtime dependencies. Maintenance status is aging—last release was 418 days ago—but the repository remains active with recent commits and the package is marked production-stable across Django 4.2 through 5.2 and Python 3.9–3.13.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.
Quickstart
pip install django-postgres-copy
from django_postgres_copy import CopyMapping
CopyMapping(
MyModel,
csv_file,
dict_template={"field_name": "csv_column"}
).save()
Requires a Django project with a PostgreSQL database configured; the COPY command is PostgreSQL-specific and will not work with other database backends.
Verify before relying
- Whether the package works with Django 6.0+ or if support is limited to the versions listed in classifiers.
- Performance characteristics and memory efficiency gains compared to standard Django bulk operations.
- Whether custom field types and model inheritance patterns are fully supported by the COPY mapping.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 418 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,121,028/month — #4,336 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_postgres_copy-2.8.0-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
django-import-exportHandles import and export of data to and from…
permissive · top 5,000 on PyPI
pgcopypgcopy wraps PostgreSQL's binary COPY protocol…
permissive · top 15,000 on PyPI
django-postgres-extraExtends Django's ORM to expose…
permissive · top 15,000 on PyPI
django-pg-bulk-updateExecutes bulk update and bulk create operations…
permissive · top 15,000 on PyPI
django-citextProvides PostgreSQL CIText field types for…
permissive · top 15,000 on PyPI
django-cities-lightProvides Django models and management commands…
permissive · top 15,000 on PyPI
recordsRecords provides a lightweight SQL query…
permissive · top 15,000 on PyPI
django-bulk-updatePerforms bulk updates of Django ORM objects in…
permissive · top 15,000 on PyPI
pgpqEncodes PyArrow RecordBatches into PostgreSQL's…
permissive · top 15,000 on PyPI
django-pglocksProvides PostgreSQL advisory locks for Django…
permissive · top 15,000 on PyPI