Skip to main content
https://github.com/altaurog/pgcopy/actions/workflows/test.yaml/badge.svg?branch=master https://coveralls.io/repos/github/altaurog/pgcopy/badge.svg?branch=master https://img.shields.io/pypi/l/pgcopy.svg https://img.shields.io/pypi/wheel/pgcopy.svg https://img.shields.io/pypi/pyversions/pgcopy.svg

Use pgcopy for fast data loading into PostgreSQL with binary copy.

Features

  • Support for many data types

  • Support for multi-dimensional array types

  • Support for schema and schema search path

  • Support for mixed-case table and column names

  • Transparent string encoding

  • Utility for replacing entire table

Quickstart

from datetime import datetime
from pgcopy import CopyManager
import psycopg2
cols = ('id', 'timestamp', 'location', 'temperature')
now = datetime.now()
records = [
        (0, now, 'Jerusalem', 72.2),
        (1, now, 'New York', 75.6),
        (2, now, 'Moscow', 54.3),
    ]
conn = psycopg2.connect(database='weather_db')
mgr = CopyManager(conn, 'measurements_table', cols)
mgr.copy(records)

# don't forget to commit!
conn.commit()

Supported datatypes

pgcopy supports the following PostgreSQL scalar types:

  • bool

  • smallint

  • integer

  • bigint

  • real

  • double precision

  • char

  • varchar

  • text

  • bytea

  • enum types

  • date

  • time

  • timestamp

  • timestamp with time zone

  • numeric

  • json

  • jsonb

  • uuid

  • arrays

  • vector

Documentation

Read the docs.

Metadata

Release files for pgcopy 1.6.2

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

Source distribution (sdist)

Source distribution for pgcopy 1.6.2
File Size Uploaded
pgcopy-1.6.2.tar.gz 19.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pgcopy 1.6.2
File Interpreter ABI Platform
pgcopy-1.6.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 32.9 kB

Release files / pgcopy-1.6.2.tar.gz

Download URL pgcopy-1.6.2.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
07192bcbfb8655c516cbd070e849c4888b981343de6b385b477ff79d5b8ec914
BLAKE2b-256 checksum
How to use checksums
2ed6e88e317a58a981c5f3a06c5d440eb1ae1c20ddbdf1076963ce8221801661
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / pgcopy-1.6.2-py2.py3-none-any.whl

Download URL pgcopy-1.6.2-py2.py3-none-any.whl
Size 13.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8ed6dbb54d0e0daa7edd5a0646ec4460191a8c41b434b49c377ff32031e259de
BLAKE2b-256 checksum
How to use checksums
a750af19f2e187c612a7a9db9ffba080d1337d3f260d7c783766214cc9349990
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

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