Skip to main content
https://travis-ci.org/altaurog/pgcopy.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

  • 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

Documentation

Read the docs.

See Also

cpgcopy, a Cython implementation, about twice as fast.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pgcopy_standalone-1.6.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pgcopy_standalone-1.6.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file pgcopy_standalone-1.6.0.tar.gz.

File metadata

  • Download URL: pgcopy_standalone-1.6.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.1 Linux/5.15.133.1-microsoft-standard-WSL2

File hashes

Hashes for pgcopy_standalone-1.6.0.tar.gz
Algorithm Hash digest
SHA256 924c93dbf1c90790990c57edc3bd05774c7ca1af27c72b64c50645de5f13cca1
MD5 acc4cb2dcac19219498ff4418b05795e
BLAKE2b-256 f9357b77e1e332d2b052eb96d75f845354213c61dad3adf437f9ac9b1a0f7e4b

See more details on using hashes here.

File details

Details for the file pgcopy_standalone-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: pgcopy_standalone-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.1 Linux/5.15.133.1-microsoft-standard-WSL2

File hashes

Hashes for pgcopy_standalone-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3ad719c902de9bf36839af17b58e5d5c5ccc961ea3e056fdb4dac92cc4354cf
MD5 5b5ac98a606164d14ab4fd9a11dc1220
BLAKE2b-256 bcd9b88c54b9c2045a3a7be3d6c8124f9c03e9cdcafe915c76644cc7a364d9b1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.6.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page