This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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:

$ python3 -m postgresql.bin.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.

Release History

Release History

This version
History Node

1.2.1

History Node

1.1.0

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.9.3

History Node

0.9.2

History Node

0.9.1

History Node

0.9.0

History Node

0.8.2

History Node

0.8.1

History Node

0.8.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
py-postgresql-1.2.1.tar.gz (1.1 MB) Copy SHA256 Checksum SHA256 Source Dec 29, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting