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.
.. Note::
The psycopg2 package is still widely used and actively maintained, but it
is not expected to receive new features.
`Psycopg 3`__ is the evolution of psycopg2 and is where `new features are
being developed`__: if you are starting a new project you should probably
start from 3!
.. __: https://pypi.org/project/psycopg/
.. __: https://www.psycopg.org/psycopg3/docs/index.html
Documentation
-------------
Documentation is included in the ``doc`` directory and is `available online`__.
.. __: https://www.psycopg.org/docs/
For any other resource (source code repository, bug tracker, mailing list)
please check the `project homepage`__.
.. __: https://psycopg.org/
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: https://www.psycopg.org/docs/install.html#install-from-source
.. _faq: https://www.psycopg.org/docs/faq.html#faq-compile
:Linux/OSX: |gh-actions|
:Windows: |appveyor|
.. |gh-actions| image:: https://github.com/psycopg/psycopg2/actions/workflows/tests.yml/badge.svg
:target: https://github.com/psycopg/psycopg2/actions/workflows/tests.yml
: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
Raw data
{
"_id": null,
"home_page": "https://psycopg.org/",
"name": "psycopg2",
"maintainer": "Daniele Varrazzo",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "daniele.varrazzo@gmail.com",
"keywords": null,
"author": "Federico Di Gregorio",
"author_email": "fog@initd.org",
"download_url": "https://files.pythonhosted.org/packages/62/51/2007ea29e605957a17ac6357115d0c1a1b60c8c984951c19419b3474cdfd/psycopg2-2.9.10.tar.gz",
"platform": "any",
"description": "Psycopg is the most popular PostgreSQL database adapter for the Python\r\nprogramming language. Its main features are the complete implementation of\r\nthe Python DB API 2.0 specification and the thread safety (several threads can\r\nshare the same connection). It was designed for heavily multi-threaded\r\napplications that create and destroy lots of cursors and make a large number\r\nof concurrent \"INSERT\"s or \"UPDATE\"s.\r\n\r\nPsycopg 2 is mostly implemented in C as a libpq wrapper, resulting in being\r\nboth efficient and secure. It features client-side and server-side cursors,\r\nasynchronous communication and notifications, \"COPY TO/COPY FROM\" support.\r\nMany Python types are supported out-of-the-box and adapted to matching\r\nPostgreSQL data types; adaptation can be extended and customized thanks to a\r\nflexible objects adaptation system.\r\n\r\nPsycopg 2 is both Unicode and Python 3 friendly.\r\n\r\n.. Note::\r\n\r\n The psycopg2 package is still widely used and actively maintained, but it\r\n is not expected to receive new features.\r\n\r\n `Psycopg 3`__ is the evolution of psycopg2 and is where `new features are\r\n being developed`__: if you are starting a new project you should probably\r\n start from 3!\r\n\r\n .. __: https://pypi.org/project/psycopg/\r\n .. __: https://www.psycopg.org/psycopg3/docs/index.html\r\n\r\n\r\nDocumentation\r\n-------------\r\n\r\nDocumentation is included in the ``doc`` directory and is `available online`__.\r\n\r\n.. __: https://www.psycopg.org/docs/\r\n\r\nFor any other resource (source code repository, bug tracker, mailing list)\r\nplease check the `project homepage`__.\r\n\r\n.. __: https://psycopg.org/\r\n\r\n\r\nInstallation\r\n------------\r\n\r\nBuilding Psycopg requires a few prerequisites (a C compiler, some development\r\npackages): please check the install_ and the faq_ documents in the ``doc`` dir\r\nor online for the details.\r\n\r\nIf prerequisites are met, you can install psycopg like any other Python\r\npackage, using ``pip`` to download it from PyPI_::\r\n\r\n $ pip install psycopg2\r\n\r\nor using ``setup.py`` if you have downloaded the source package locally::\r\n\r\n $ python setup.py build\r\n $ sudo python setup.py install\r\n\r\nYou can also obtain a stand-alone package, not requiring a compiler or\r\nexternal libraries, by installing the `psycopg2-binary`_ package from PyPI::\r\n\r\n $ pip install psycopg2-binary\r\n\r\nThe binary package is a practical choice for development and testing but in\r\nproduction it is advised to use the package built from sources.\r\n\r\n.. _PyPI: https://pypi.org/project/psycopg2/\r\n.. _psycopg2-binary: https://pypi.org/project/psycopg2-binary/\r\n.. _install: https://www.psycopg.org/docs/install.html#install-from-source\r\n.. _faq: https://www.psycopg.org/docs/faq.html#faq-compile\r\n\r\n:Linux/OSX: |gh-actions|\r\n:Windows: |appveyor|\r\n\r\n.. |gh-actions| image:: https://github.com/psycopg/psycopg2/actions/workflows/tests.yml/badge.svg\r\n :target: https://github.com/psycopg/psycopg2/actions/workflows/tests.yml\r\n :alt: Linux and OSX build status\r\n\r\n.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/psycopg/psycopg2?branch=master&svg=true\r\n :target: https://ci.appveyor.com/project/psycopg/psycopg2/branch/master\r\n :alt: Windows build status\r\n",
"bugtrack_url": null,
"license": "LGPL with exceptions",
"summary": "psycopg2 - Python-PostgreSQL Database Adapter",
"version": "2.9.10",
"project_urls": {
"Changes": "https://www.psycopg.org/docs/news.html",
"Code": "https://github.com/psycopg/psycopg2",
"Documentation": "https://www.psycopg.org/docs/",
"Download": "https://pypi.org/project/psycopg2/",
"Homepage": "https://psycopg.org/",
"Issue Tracker": "https://github.com/psycopg/psycopg2/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0aa9146b6bdc0d33539a359f5e134ee6dda9173fb8121c5b96af33fa299e50c4",
"md5": "8ffdc19f603ff4e6f61f44a74b2dc254",
"sha256": "5df2b672140f95adb453af93a7d669d7a7bf0a56bcd26f1502329166f4a61716"
},
"downloads": -1,
"filename": "psycopg2-2.9.10-cp310-cp310-win32.whl",
"has_sig": false,
"md5_digest": "8ffdc19f603ff4e6f61f44a74b2dc254",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 1024527,
"upload_time": "2024-10-16T11:18:24",
"upload_time_iso_8601": "2024-10-16T11:18:24.430276Z",
"url": "https://files.pythonhosted.org/packages/0a/a9/146b6bdc0d33539a359f5e134ee6dda9173fb8121c5b96af33fa299e50c4/psycopg2-2.9.10-cp310-cp310-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4750c509e56f725fd2572b59b69bd964edaf064deebf1c896b2452f6b46fdfb3",
"md5": "da4c234875748a29afaa22a129151980",
"sha256": "c6f7b8561225f9e711a9c47087388a97fdc948211c10a4bccbf0ba68ab7b3b5a"
},
"downloads": -1,
"filename": "psycopg2-2.9.10-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "da4c234875748a29afaa22a129151980",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 1163735,
"upload_time": "2024-10-16T11:18:29",
"upload_time_iso_8601": "2024-10-16T11:18:29.586922Z",
"url": "https://files.pythonhosted.org/packages/47/50/c509e56f725fd2572b59b69bd964edaf064deebf1c896b2452f6b46fdfb3/psycopg2-2.9.10-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "20a2c51ca3e667c34e7852157b665e3d49418e68182081060231d514dd823225",
"md5": "854e94968a556501434af5f9031fd5a6",
"sha256": "47c4f9875125344f4c2b870e41b6aad585901318068acd01de93f3677a6522c2"
},
"downloads": -1,
"filename": "psycopg2-2.9.10-cp311-cp311-win32.whl",
"has_sig": false,
"md5_digest": "854e94968a556501434af5f9031fd5a6",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 1024538,
"upload_time": "2024-10-16T11:18:33",
"upload_time_iso_8601": "2024-10-16T11:18:33.480538Z",
"url": "https://files.pythonhosted.org/packages/20/a2/c51ca3e667c34e7852157b665e3d49418e68182081060231d514dd823225/psycopg2-2.9.10-cp311-cp311-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "33395a9a229bb5414abeb86e33b8fc8143ab0aecce5a7f698a53e31367d30caa",
"md5": "691a7f5976fb71f1100812cc6d5dce3b",
"sha256": "0435034157049f6846e95103bd8f5a668788dd913a7c30162ca9503fdf542cb4"
},
"downloads": -1,
"filename": "psycopg2-2.9.10-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "691a7f5976fb71f1100812cc6d5dce3b",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 1163736,
"upload_time": "2024-10-16T11:18:36",
"upload_time_iso_8601": "2024-10-16T11:18:36.616573Z",
"url": "https://files.pythonhosted.org/packages/33/39/5a9a229bb5414abeb86e33b8fc8143ab0aecce5a7f698a53e31367d30caa/psycopg2-2.9.10-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3d164623fad6076448df21c1a870c93a9774ad8a7b4dd1660223b59082dd8fec",
"md5": "28aa9ea28558c63b15e965df2b8051ea",
"sha256": "65a63d7ab0e067e2cdb3cf266de39663203d38d6a8ed97f5ca0cb315c73fe067"
},
"downloads": -1,
"filename": "psycopg2-2.9.10-cp312-cp312-win32.whl",
"has_sig": false,
"md5_digest": "28aa9ea28558c63b15e965df2b8051ea",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 1025113,
"upload_time": "2024-10-16T11:18:40",
"upload_time_iso_8601": "2024-10-16T11:18:40.148299Z",
"url": "https://files.pythonhosted.org/packages/3d/16/4623fad6076448df21c1a870c93a9774ad8a7b4dd1660223b59082dd8fec/psycopg2-2.9.10-cp312-cp312-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "66debaed128ae0fc07460d9399d82e631ea31a1f171c0c4ae18f9808ac6759e3",
"md5": "536de27cf5037935ce182a51185d8df4",
"sha256": "4a579d6243da40a7b3182e0430493dbd55950c493d8c68f4eec0b302f6bbf20e"
},
"downloads": -1,
"filename": "psycopg2-2.9.10-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "536de27cf5037935ce182a51185d8df4",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 1163951,
"upload_time": "2024-10-16T11:18:44",
"upload_time_iso_8601": "2024-10-16T11:18:44.377888Z",
"url": "https://files.pythonhosted.org/packages/66/de/baed128ae0fc07460d9399d82e631ea31a1f171c0c4ae18f9808ac6759e3/psycopg2-2.9.10-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5f29bc9639b9c50abd93a8274fd2deffbf70b2a65aa9e7881e63ea6bc4319e84",
"md5": "d3206e7bddf068411c28b4c8cff5a2c0",
"sha256": "9d5b3b94b79a844a986d029eee38998232451119ad653aea42bb9220a8c5066b"
},
"downloads": -1,
"filename": "psycopg2-2.9.10-cp39-cp39-win32.whl",
"has_sig": false,
"md5_digest": "d3206e7bddf068411c28b4c8cff5a2c0",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 1025259,
"upload_time": "2024-10-16T11:18:48",
"upload_time_iso_8601": "2024-10-16T11:18:48.181730Z",
"url": "https://files.pythonhosted.org/packages/5f/29/bc9639b9c50abd93a8274fd2deffbf70b2a65aa9e7881e63ea6bc4319e84/psycopg2-2.9.10-cp39-cp39-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2cf80be7d99d24656b689d83ac167240c3527efb0b161d814fb1dd58329ddf75",
"md5": "350af411feefa1e65c9e5c395537905f",
"sha256": "88138c8dedcbfa96408023ea2b0c369eda40fe5d75002c0964c78f46f11fa442"
},
"downloads": -1,
"filename": "psycopg2-2.9.10-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "350af411feefa1e65c9e5c395537905f",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 1163878,
"upload_time": "2024-10-16T11:18:52",
"upload_time_iso_8601": "2024-10-16T11:18:52.549395Z",
"url": "https://files.pythonhosted.org/packages/2c/f8/0be7d99d24656b689d83ac167240c3527efb0b161d814fb1dd58329ddf75/psycopg2-2.9.10-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "62512007ea29e605957a17ac6357115d0c1a1b60c8c984951c19419b3474cdfd",
"md5": "3a1ed36b492a74789563577edc0b0689",
"sha256": "12ec0b40b0273f95296233e8750441339298e6a572f7039da5b260e3c8b60e11"
},
"downloads": -1,
"filename": "psycopg2-2.9.10.tar.gz",
"has_sig": false,
"md5_digest": "3a1ed36b492a74789563577edc0b0689",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 385672,
"upload_time": "2024-10-16T11:24:54",
"upload_time_iso_8601": "2024-10-16T11:24:54.832688Z",
"url": "https://files.pythonhosted.org/packages/62/51/2007ea29e605957a17ac6357115d0c1a1b60c8c984951c19419b3474cdfd/psycopg2-2.9.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-16 11:24:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "psycopg",
"github_project": "psycopg2",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "psycopg2"
}