py-postgresql 0.9.1
PostgreSQL driver and tools library.
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.
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| py-postgresql-0.9.1.win32-py3.1.exe (md5) | MS Windows installer | 3.1 | 2009-08-12 17:46:32.759300 | 425KB | 72 |
| py-postgresql-0.9.1.tar.gz (md5) | Source | 2009-08-12 17:45:51.101234 | 202KB | 78 | |
- Author: James William Pye <python-general at pgfoundry org>
- Home Page: http://python.projects.postgresql.org
-
Categories
- Development Status :: 5 - Production/Stable
- Intended Audience :: Developers
- License :: OSI Approved :: Attribution Assurance License
- License :: OSI Approved :: BSD License
- License :: OSI Approved :: MIT License
- License :: OSI Approved :: Python Software Foundation License
- Natural Language :: English
- Operating System :: OS Independent
- Programming Language :: Python
- Programming Language :: Python :: 3
- Topic :: Database
- Package Index Owner: jwp
- DOAP record: py-postgresql-0.9.1.xml
Log in to rate this package.
