Skip to main content

An implementation of the psycopg2 module using cffi.

Project description

An implementation of the psycopg2 module using cffi. The module is currently compatible with Psycopg 2.4.4.

You can install psycopg2cffi from pypi:

pip install psycopg2cffi

Or from source:

python setup.py develop

Installation requirements are the same as for psycopg2 - you must have libpq headers, pg_config somewhere on your $PATH. Installation was tested on Ubuntu 12.04 and CentOS (RHEL 5.0). It should be possible to make it work on Windows, but I did not even test it.

This module is only tested with python 2.6+ and PyPy 2.0 (and will definityly not work on PyPy 1.9).

To use this package with Django or SQLAlchemy create somewhere in your python path (e.g. the site-packages of your virtual env) a psycopg2.py file with the following:

from psycopg2cffi import compat
compat.register()

This will map psycopg2cffi to psycopg2.

To run tests, install pytest and run them with:

py.test psycopg2cffi

Submit issues to https://github.com/chtd/psycopg2cffi/issues

If you notice that psycopg2cffi under PyPy is noticably slower than psycopg2 under CPython, submit this to the issues too - it should not be the case.

This is a port of (Michael van Tellingen port https://github.com/mvantellingen/psycopg2-ctypes of Alex Gaynor’s rpython port (https://bitbucket.org/alex_gaynor/pypy-postgresql/overview) of psycopg2 to python + ctypes) to cffi.

Project details


Download files

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

Source Distribution

psycopg2cffi-0.1.3.tar.gz (50.3 kB view details)

Uploaded Source

File details

Details for the file psycopg2cffi-0.1.3.tar.gz.

File metadata

  • Download URL: psycopg2cffi-0.1.3.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for psycopg2cffi-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b66245a69f76043d3efad2a29355c792ce72afbf009cb002522791ad403eebf3
MD5 e399b85a6fd245eaec48aac8c8a491ff
BLAKE2b-256 a78f79b1dcc3a6041a4eb0b188bd29491785d7b8815a85a7b0714c1ca0c93586

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page