• Home
  • Popular Downloads
  • Contact Us
  • Submit

Softpile

Free Downloads

Main Navigation
  • Home
  • Windows
  • Mac OS X
  • Business
  • Desktop
  • Development
  • Education
  • Games
  • Internet
  • Multimedia
  • Utilities
Home » Linux » py-postgresql

py-postgresql

June 16, 2009
PostgreSQL driver and tools library
Version: 0.9.0
License: BSD License
Operating System: Linux
Homepage: python.projects.postgresql.org
Developed by: James William Pye
py-postgresql is a set of Python library 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

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.
driver postgresql postgresql driver postgresql library python python library
Free Download 202K
0
  • Share on:

py-postgresql User Reviews

Sponsored

Categories

  • Linux

Related Downloads

PDFLib Lite
PDFlib is a widely used programming library which allows the programmer to ...
RDFParser
A PHP class that loads and parses RDF/RSS files.
execnet
Elastic Python deployment
pycopia-net
General purpose network related modules
pycopia-aid
General purpose objects that enhance Python's core modules
Copyright © 1999-2017 Softpile Free Downloads
  • Contact Us
  • Submit
  • Privacy Policy
  • Disclaimer
  • Terms of Use