Skip to main content

PostgreSQL driver and tools library.

Project description

py-postgresql is a set of Python modules providing interfaces to various parts of PostgreSQL. Notably, it provides a pure-Python driver + C optimizations for querying a PostgreSQL database.

http://python.projects.postgresql.org

Features:

  • Prepared Statement driven interfaces.

  • Cluster tools for creating and controlling a cluster.

  • Support for most PostgreSQL types: composites, arrays, numeric, lots more.

  • COPY support.

Sample PG-API Code:

>>> import postgresql
>>> db = postgresql.open('pq://user:password@host:port/database')
>>> db.execute("CREATE TABLE emp (emp_first_name text, emp_last_name text, emp_salary numeric)")
>>> make_emp = db.prepare("INSERT INTO emp VALUES ($1, $2, $3)")
>>> make_emp("John", "Doe", "75,322")
>>> with db.xact():
...  make_emp("Jane", "Doe", "75,322")
...  make_emp("Edward", "Johnson", "82,744")
...

There is a DB-API 2.0 module as well:

postgresql.driver.dbapi20

However, PG-API is recommended as it provides greater utility.

Once installed, try out the pg_python console script:

$ pg_python -h localhost -p port -U theuser -d database_name

If a successful connection is made to the remote host, it will provide a Python console with the database connection bound to the db name.

History

py-postgresql is not yet another PostgreSQL driver, it’s been in development for years. py-postgresql is the Python 3 port of the pg_proboscis driver and integration of the other pg/python projects.

Project details


Download files

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

Source Distribution

py-postgresql-0.9.0.tar.gz (206.7 kB view details)

Uploaded Source

Built Distributions

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

py-postgresql-0.9.0.win32-py3.1.exe (435.8 kB view details)

Uploaded Source

py-postgresql-0.9.0.win32-py3.0.exe (433.6 kB view details)

Uploaded Source

File details

Details for the file py-postgresql-0.9.0.tar.gz.

File metadata

  • Download URL: py-postgresql-0.9.0.tar.gz
  • Upload date:
  • Size: 206.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for py-postgresql-0.9.0.tar.gz
Algorithm Hash digest
SHA256 bb4f0733f78ed84b08e2966a306867201c6e8becfc33c9eb2d75d8e81344abd2
MD5 1b35f18d29c65751d65b8e52ab8a73cd
BLAKE2b-256 a968ef2067e6fbd59caefbf9d322fd2ff36c8e6a36358ee20eb149e544721838

See more details on using hashes here.

File details

Details for the file py-postgresql-0.9.0.win32-py3.1.exe.

File metadata

File hashes

Hashes for py-postgresql-0.9.0.win32-py3.1.exe
Algorithm Hash digest
SHA256 90521466fabccc56f19777816b58eb8f8d48b911264241d38c81e06aa904d76a
MD5 a8232714609607cc9854101eb0098d29
BLAKE2b-256 5b9145790161428218671c3b5e5135f683e9fe51f3e67b025bbef4284c163399

See more details on using hashes here.

File details

Details for the file py-postgresql-0.9.0.win32-py3.0.exe.

File metadata

File hashes

Hashes for py-postgresql-0.9.0.win32-py3.0.exe
Algorithm Hash digest
SHA256 fca311b27016da91ddef49e54458ef9beac07c7da4dbf8d964cc4c6946ce5b24
MD5 8400520a6db7149ab070b6c962f0338e
BLAKE2b-256 a6aff20bfbb3bb702e92d2c6d8ebe270c21fe2b0a08020446788ab32621d4e3d

See more details on using hashes here.

Supported by

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