PostgreSQL database adapter for the Python programming language
Go to file
2019-01-22 11:32:11 +00:00
doc Declare Python 3.7 supported 2018-11-08 17:37:47 +00:00
examples cleanup remaining GPL license text 2014-05-20 09:50:53 -07:00
lib Fixed catching too broad exceptions 2018-11-08 12:34:18 +00:00
psycopg Assign the PGresult to the cursor in the execute critical section 2019-01-22 11:12:50 +00:00
sandbox cleanup remaining GPL license text 2014-05-20 09:42:41 -07:00
scripts errorcodes map update to PostgreSQL 11 2018-10-14 22:57:01 +01:00
tests Fixed adaptation of lists of empty lists 2018-10-30 00:29:18 +00:00
.appveyor.yml Build using OpenSSL 1.0.2n 2018-01-29 01:58:37 +00:00
.gitignore Added script to create manylinux1 wheels 2017-01-04 04:43:54 +01:00
.travis.yml Consider Python 3.6 and Postgres 9.6 supported 2017-01-03 19:12:44 +01:00
AUTHORS Preparing release 2.3.0-beta1 2010-11-06 15:50:39 +01:00
INSTALL Dropped content from the INSTALL file 2014-08-24 02:06:09 +01:00
LICENSE Dropped license paragraph applying to removed files 2018-05-23 21:19:06 +01:00
Makefile Fixed 'make sdist' to work with setuptools 2016-03-10 12:10:51 +00:00
MANIFEST.in Fixed 'make sdist' to work with setuptools 2016-03-10 12:10:51 +00:00
NEWS Mention new OpenSSL version in wheel package 2019-01-22 11:31:11 +00:00
psycopg2.cproj Move replication connection to C level. 2015-10-27 18:21:24 +01:00
psycopg2.sln New 'withhold' parameter for connection.cursor() 2011-08-10 18:25:46 +02:00
README.rst Update all pypi.python.org URLs to pypi.org 2018-05-20 17:25:28 +01:00
setup.cfg Include license file in the generated wheel package 2017-11-26 10:42:30 -08:00
setup.py Version number bumped to 2.7.7 2019-01-22 11:32:11 +00:00
tox.ini Python source cleanup using flake8 2016-10-11 00:11:55 +01:00

psycopg2 - Python-PostgreSQL Database Adapter
=============================================

Psycopg is the most popular PostgreSQL database adapter for the Python
programming language.  Its main features are the complete implementation of
the Python DB API 2.0 specification and the thread safety (several threads can
share the same connection).  It was designed for heavily multi-threaded
applications that create and destroy lots of cursors and make a large number
of concurrent "INSERT"s or "UPDATE"s.

Psycopg 2 is mostly implemented in C as a libpq wrapper, resulting in being
both efficient and secure.  It features client-side and server-side cursors,
asynchronous communication and notifications, "COPY TO/COPY FROM" support.
Many Python types are supported out-of-the-box and adapted to matching
PostgreSQL data types; adaptation can be extended and customized thanks to a
flexible objects adaptation system.

Psycopg 2 is both Unicode and Python 3 friendly.


Documentation
-------------

Documentation is included in the ``doc`` directory and is `available online`__.

.. __: http://initd.org/psycopg/docs/

For any other resource (source code repository, bug tracker, mailing list)
please check the `project homepage`__.


Installation
------------

Building Psycopg requires a few prerequisites (a C compiler, some development
packages): please check the install_ and the faq_ documents in the ``doc`` dir
or online for the details.

If prerequisites are met, you can install psycopg like any other Python
package, using ``pip`` to download it from PyPI_::

    $ pip install psycopg2

or using ``setup.py`` if you have downloaded the source package locally::

    $ python setup.py build
    $ sudo python setup.py install

You can also obtain a stand-alone package, not requiring a compiler or
external libraries, by installing the `psycopg2-binary`_ package from PyPI::

    $ pip install psycopg2-binary

The binary package is a practical choice for development and testing but in
production it is advised to use the package built from sources.

.. _PyPI: https://pypi.org/project/psycopg2/
.. _psycopg2-binary: https://pypi.org/project/psycopg2-binary/
.. _install: http://initd.org/psycopg/docs/install.html#install-from-source
.. _faq: http://initd.org/psycopg/docs/faq.html#faq-compile

.. __: http://initd.org/psycopg/


:Linux/OSX: |travis|
:Windows: |appveyor|

.. |travis| image:: https://travis-ci.org/psycopg/psycopg2.svg?branch=master
    :target: https://travis-ci.org/psycopg/psycopg2
    :alt: Linux and OSX build status

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/psycopg/psycopg2?branch=master&svg=true
    :target: https://ci.appveyor.com/project/psycopg/psycopg2/branch/master
    :alt: Windows build status