psycopg

New generation PostgreSQL database adapter for the Python programming language

https://github.com/psycopg/psycopg

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.6%) to scientific vocabulary

Keywords

database development driver postgresql python

Keywords from Contributors

templates apps distribution views pallets werkzeug wsgi packaging closember alignment
Last synced: 6 months ago · JSON representation

Repository

New generation PostgreSQL database adapter for the Python programming language

Basic Info
Statistics
  • Stars: 2,082
  • Watchers: 26
  • Forks: 196
  • Open Issues: 57
  • Releases: 0
Topics
database development driver postgresql python
Created almost 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Funding License

README.rst

Psycopg 3 -- PostgreSQL database adapter for Python
===================================================

Psycopg 3 is a modern implementation of a PostgreSQL adapter for Python.


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

Quick version::

    pip install "psycopg[binary,pool]"

For further information about installation please check `the documentation`__.

.. __: https://www.psycopg.org/psycopg3/docs/basic/install.html


.. _Hacking:

Hacking
-------

In order to work on the Psycopg source code, you must have the
``libpq`` PostgreSQL client library installed on the system. For instance, on
Debian systems, you can obtain it by running::

    sudo apt install libpq5

On macOS, run::

    brew install libpq

On Windows you can use EnterpriseDB's `installers`__ to obtain ``libpq``
which is included in the Command Line Tools.

.. __: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

You can then clone this repository to develop Psycopg::

    git clone https://github.com/psycopg/psycopg.git
    cd psycopg

Please note that the repository contains the source code of several Python
packages, which may have different requirements:

- The ``psycopg`` directory contains the pure python implementation of
  ``psycopg``. The package has only a runtime dependency on the ``libpq``, the
  PostgreSQL client library, which should be installed in your system.

- The ``psycopg_c`` directory contains an optimization module written in
  C/Cython. In order to build it you will need a few development tools: please
  look at `Local installation`__ in the docs for the details.

- The ``psycopg_pool`` directory contains the `connection pools`__
  implementations. This is kept as a separate package to allow a different
  release cycle.

.. __: https://www.psycopg.org/psycopg3/docs/basic/install.html#local-installation
.. __: https://www.psycopg.org/psycopg3/docs/advanced/pool.html

You can create a local virtualenv and install the packages `in
development mode`__, together with their development and testing
requirements::

    python -m venv .venv
    source .venv/bin/activate
    pip install -e "./psycopg[dev,test]"    # for the base Python package
    pip install -e ./psycopg_pool           # for the connection pool
    pip install ./psycopg_c                 # for the C speedup module

.. __: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs

Please add ``--config-settings editable_mode=strict`` to the ``pip install -e``
above if you experience `editable mode broken`__.

.. __: https://github.com/pypa/setuptools/issues/3557

Now hack away! You can run the tests using::

    psql -c 'create database psycopg_test'
    export PSYCOPG_TEST_DSN="dbname=psycopg_test"
    pytest

The project includes some `pre-commit`__ hooks to check that the code is valid
according to the project coding convention. Please make sure to install them
by running::

    pre-commit install

This will allow to check lint errors before submitting merge requests, which
will save you time and frustrations.

.. __: https://pre-commit.com/


Cross-compiling
---------------

To use cross-platform zipapps created with `shiv`__ that include Psycopg
as a dependency you must also have ``libpq`` installed. See
`the section above `_ for install instructions.

.. __: https://github.com/linkedin/shiv

Owner

  • Name: The Psycopg Team
  • Login: psycopg
  • Kind: organization

We make reptiles and pachiderms talk to each other.

GitHub Events

Total
  • Issues event: 185
  • Watch event: 319
  • Delete event: 86
  • Issue comment event: 643
  • Push event: 370
  • Pull request review event: 240
  • Pull request review comment event: 246
  • Pull request event: 126
  • Fork event: 39
  • Create event: 100
Last Year
  • Issues event: 185
  • Watch event: 319
  • Delete event: 86
  • Issue comment event: 643
  • Push event: 370
  • Pull request review event: 240
  • Pull request review comment event: 246
  • Pull request event: 126
  • Fork event: 39
  • Create event: 100

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 3,211
  • Total Committers: 74
  • Avg Commits per committer: 43.392
  • Development Distribution Score (DDS): 0.132
Past Year
  • Commits: 309
  • Committers: 25
  • Avg Commits per committer: 12.36
  • Development Distribution Score (DDS): 0.194
Top Committers
Name Email Commits
Daniele Varrazzo d****o@g****m 2,788
Denis Laxalde d****e@d****m 258
Jacopo Farina j****a@f****m 10
Daniel Fortunov g****b@d****m 10
henadzit h****k@g****m 8
dependabot[bot] 4****] 7
Suresh Kumar s****1@g****m 6
Jelte Fennema g****h@j****l 6
H j****n@o****m 6
Federico Caselli c****7@g****m 6
Riccardo Magliocchetti r****i@g****m 5
Edgar Ramírez-Mondragón e****8@g****m 5
Christian Clauss c****s@m****m 4
Kamil Monicz k****l@m****v 4
Martin Weinelt h****a@d****e 4
Vladimir Osokin e****o@g****m 4
Trim21 t****e@g****m 4
Martin Baláž b****z@b****i 4
stankudrow s****w@r****o 4
Florian Apolloner f****n@a****u 3
stengah d****1@g****m 3
Trenton Holmes 7****g 2
Sergey Fedoseev f****y@g****m 2
Peter Lithammer p****r@g****m 2
Nikita Sobolev m****l@s****e 2
Dan Shick d****k@n****m 2
Eyal Halpern Shalev e****h@g****m 2
Jolbas 3****s 2
Nick Pope n****e@i****o 2
Paolo Melchiorre p****o@m****g 2
and 44 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 382
  • Total pull requests: 356
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 30 days
  • Total issue authors: 296
  • Total pull request authors: 71
  • Average comments per issue: 3.45
  • Average comments per pull request: 2.83
  • Merged pull requests: 242
  • Bot issues: 0
  • Bot pull requests: 15
Past Year
  • Issues: 131
  • Pull requests: 149
  • Average time to close issues: 7 days
  • Average time to close pull requests: 9 days
  • Issue authors: 105
  • Pull request authors: 31
  • Average comments per issue: 1.98
  • Average comments per pull request: 2.54
  • Merged pull requests: 93
  • Bot issues: 0
  • Bot pull requests: 9
Top Authors
Issue Authors
  • dvarrazzo (47)
  • bluetech (5)
  • Zaczero (4)
  • EdmundsEcho (3)
  • embecka (3)
  • zogzog (3)
  • CaselIT (3)
  • reuvenstr (2)
  • mkanoor (2)
  • akrherz (2)
  • khteh (2)
  • dss010101 (2)
  • danielkauffman (2)
  • adamsol (2)
  • james-johnston-thumbtack (2)
Pull Request Authors
  • dvarrazzo (150)
  • dlax (55)
  • dependabot[bot] (15)
  • trim21 (8)
  • stankudrow (8)
  • embecka (6)
  • jerch (4)
  • mweinelt (4)
  • edgarrmondragon (3)
  • apollo13 (3)
  • thierryba (3)
  • Zaczero (3)
  • mattip (2)
  • danielfrankcom (2)
  • max-muoto (2)
Top Labels
Issue Labels
enhancement (17) good first issue (5) pool (4) performance (4) help wanted (4) funding requested (3) binary (3) macOS (2) Windows (2) pypy (1) invalid (1)
Pull Request Labels
dependencies (15) github_actions (6) pool (2)

Packages

  • Total packages: 7
  • Total downloads:
    • pypi 41,336,853 last-month
  • Total docker downloads: 700,219,920
  • Total dependent packages: 293
    (may contain duplicates)
  • Total dependent repositories: 2,317
    (may contain duplicates)
  • Total versions: 208
  • Total maintainers: 1
pypi.org: psycopg

PostgreSQL database adapter for Python

  • Versions: 52
  • Dependent Packages: 196
  • Dependent Repositories: 1,688
  • Downloads: 20,035,738 Last month
  • Docker Downloads: 352,390,768
Rankings
Dependent packages count: 0.2%
Downloads: 0.2%
Dependent repos count: 0.3%
Docker downloads count: 0.7%
Average: 1.2%
Stargazers count: 1.9%
Forks count: 4.2%
Maintainers (1)
Funding
  • https://github.com/sponsors/dvarrazzo
Last synced: 6 months ago
pypi.org: psycopg-binary

PostgreSQL database adapter for Python -- C optimisation distribution

  • Versions: 50
  • Dependent Packages: 62
  • Dependent Repositories: 556
  • Downloads: 14,797,675 Last month
  • Docker Downloads: 394,046
Rankings
Downloads: 0.3%
Dependent repos count: 0.6%
Dependent packages count: 0.6%
Docker downloads count: 1.0%
Average: 1.4%
Stargazers count: 1.9%
Forks count: 4.2%
Maintainers (1)
Funding
  • https://github.com/sponsors/dvarrazzo
Last synced: 6 months ago
pypi.org: psycopg-pool

Connection Pool for Psycopg

  • Versions: 22
  • Dependent Packages: 28
  • Dependent Repositories: 60
  • Downloads: 6,114,208 Last month
  • Docker Downloads: 1,383
Rankings
Downloads: 0.4%
Dependent packages count: 0.9%
Stargazers count: 1.9%
Dependent repos count: 1.9%
Average: 2.0%
Docker downloads count: 2.7%
Forks count: 4.2%
Maintainers (1)
Last synced: 6 months ago
pypi.org: psycopg-c

PostgreSQL database adapter for Python -- C optimisation distribution

  • Versions: 52
  • Dependent Packages: 4
  • Dependent Repositories: 12
  • Downloads: 388,605 Last month
  • Docker Downloads: 347,433,723
Rankings
Downloads: 0.9%
Docker downloads count: 1.5%
Dependent packages count: 1.6%
Stargazers count: 1.9%
Average: 2.4%
Forks count: 4.2%
Dependent repos count: 4.3%
Maintainers (1)
Funding
  • https://github.com/sponsors/dvarrazzo
Last synced: 6 months ago
conda-forge.org: psycopg

Psycopg 3 is a newly designed PostgreSQL database adapter for the Python programming language. Psycopg 3 presents a familiar interface for everyone who has used Psycopg 2 or any other DB-API 2.0 database adapter, but allows to use more modern PostgreSQL and Python features.

  • Versions: 15
  • Dependent Packages: 2
  • Dependent Repositories: 1
Rankings
Stargazers count: 13.0%
Forks count: 18.2%
Average: 18.7%
Dependent packages count: 19.6%
Dependent repos count: 24.1%
Last synced: 6 months ago
conda-forge.org: psycopg-c

Psycopg 3 is a newly designed PostgreSQL database adapter for the Python programming language. Psycopg 3 presents a familiar interface for everyone who has used Psycopg 2 or any other DB-API 2.0 database adapter, but allows to use more modern PostgreSQL and Python features.

  • Versions: 15
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Stargazers count: 12.8%
Forks count: 19.6%
Average: 23.8%
Dependent packages count: 28.8%
Dependent repos count: 34.0%
Last synced: 6 months ago
pypi.org: isort-psycopg

isort plug-in to sort imports by module length first

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 627 Last month
Rankings
Dependent packages count: 9.6%
Average: 31.9%
Dependent repos count: 54.2%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/3rd-party-tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • postgres 15 docker
.github/workflows/docs.yml actions
  • peter-evans/repository-dispatch v1 composite
.github/workflows/lint.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/packages-bin.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • docker/setup-qemu-action v2 composite
  • pypa/cibuildwheel v2.12.0 composite
  • postgres 14 docker
.github/workflows/packages-pool.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • postgres 14 docker
.github/workflows/packages-src.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • postgres 14 docker
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
psycopg/pyproject.toml pypi
psycopg/setup.py pypi
psycopg_c/pyproject.toml pypi
psycopg_c/setup.py pypi
psycopg_pool/pyproject.toml pypi
psycopg_pool/setup.py pypi
pyproject.toml pypi