Skip to main content

pgcopy

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 Provenance Actions
pgcopy-1.6.2.tar.gz 19.0 kB Without provenance Details for pgcopy-1.6.2.tar.gz

Built distribution (wheel)

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

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

Security for pgcopy 1.6.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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