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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
py-postgresql-0.8.0.zip
(212.5 kB
view hashes)
py-postgresql-0.8.0.tar.gz
(181.3 kB
view hashes)
py-postgresql-0.8.0.tar.bz2
(152.8 kB
view hashes)
Built Distribution
py-postgresql-0.8.0.win32-py3.0.exe
(409.8 kB
view hashes)
Close
Hashes for py-postgresql-0.8.0.win32-py3.0.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f5b143461be5e90860211232e762906080065e6c4405711e9d76fd480783e5b |
|
MD5 | e46b129e41065f51a058a09189e1bdf2 |
|
BLAKE2b-256 | 9304aa281eaed5a0a0355a071724929781079faca2900cfd24544985eeecbb5e |