Skip to main content

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 invoke a compatability hook (for example, from settings.py in case of django, or from a psycopg2.py file in site-packages of your virtual env):

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.

The main motivation for a port was speed - the writeup with benchmarks is here: http://chtd.ru/blog/bystraya-rabota-s-postgres-pod-pypy/?lang=en

Release files for psycopg2cffi 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psycopg2cffi 0.1.5
File Size Uploaded
psycopg2cffi-0.1.5.tar.gz 51.2 kB Details

Release files / psycopg2cffi-0.1.5.tar.gz

Download URL psycopg2cffi-0.1.5.tar.gz
Size 51.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f6d61b215219fb6620bbf5e4049b3de63384798d320650a6ab146740e6c33e91
BLAKE2b-256 checksum
How to use checksums
d583cd64a928fa8dbd81d4dd4a86400acd6fedc8f8da31428f6ac5d8e43d5942
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

2.9.0

1 release file

2.8.1

1 release file

2.8.0

1 release file

2.7.7

1 release file

2.7.6

1 release file

2.7.5

1 release file

2.7.4

1 release file

2.7.3

1 release file

2.7.2

1 release file

2.7.1

1 release file

2.7.0

1 release file

2.6.1

1 release file

2.6.0

1 release file

2.5.2

1 release file

2.5.1

1 release file

2.5

1 release file

0.1.6

1 release file

This release

0.1.5 This release

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page