Skip to main content
Help us improve Python packaging – donate today!

Simple PostgreSQL database wrapper - provides wrapper over psycopg2 supporting a Python API for common sql functions

Project Description

pgwrap - simple PostgreSQL database wrapper
-------------------------------------------

The 'pgwrap' module provides a simple wrapper over psycopg2 supporting a
Python API for common sql functions.

This is not intended to provide an ORM-like functionality, just some basic
functionality to make it easier to interact with PostgreSQL from python
code for simple use-cases. For more complex operations direct SQL
access is available.

These 'module' include:

* Simplified handling of connections/cursor
* Background connection pool (provided by psycopg2.pool)
* Cursor context handler
* Python API to wrap basic SQL functionality
* select,update,delete,join)
* These methods are implemented as extensions to the cursor
context handler (allowing then to be used transactionally
where needed), however are also available as stand-alone
methods which create an implicit cursor for simple queries
* Query results as dict (using psycopg2.extras.RealDictCursor)

Basic usage:

>>> from pgwrap import connect,query
>>> connect(url="postgres://localhost")
>>> query_one("select version()")
{'version': 'PostgreSQL...'}

The module wraps the excellent 'psycopg2' library and most of the
functionality is provided by this behind the scenes.

Changelog:

0.1 19-10-2012 Initial import
0.2 10-10-2012 Remove psycopg2 dep in setup.py
0.3 10-10-2012 Remove hstore default for cursor

Release history Release notifications

History Node

0.7

History Node

0.6

History Node

0.4

This version
History Node

0.3

History Node

0.2

History Node

0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pgwrap-0.3.tar.gz (5.3 kB) Copy SHA256 hash SHA256 Source None Oct 20, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page