skillfed

PyGreSQL

Python PostgreSQL interfaces

pygresql v6.2.3 363.4K downloads/30d#7,221 on PyPI48
License unclear PostgreSQL AGING released

What it is and what it does

PyGreSQL is a mature Python module that provides direct access to PostgreSQL databases by wrapping the lower-level libpq C library. It has been in active development since 2006 and supports Python 3.8 through 3.14 on the server side with PostgreSQL versions 12 to 18. The package offers a straightforward way to connect to a database, execute queries, and retrieve results without requiring an ORM or higher-level abstraction layer.

The package is classified as mature but shows aging maintenance signals—the last release was 201 days ago, though the repository remains active. Installation requires both the PyGreSQL package itself and the libpq system library to be present on your client machine, which adds some setup friction compared to pure-Python database drivers. It has no runtime Python dependencies, making it lightweight once installed.

Use it for:

  • Direct PostgreSQL queries in scripts or applications where a lightweight, low-level interface is preferred over an ORM.
  • Legacy Python codebases that already use PyGreSQL and need to remain on a maintained version.
  • Systems where libpq is already available and you want to avoid additional abstraction layers.
  • Database administration or reporting tools that need efficient, direct SQL execution.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyGreSQL is a Python interface to PostgreSQL databases that wraps the libpq C API, allowing direct database connections and queries from Python code.

Yes, if you need a lightweight, direct PostgreSQL interface and can manage the libpq system dependency. The package is mature and stable with no known vulnerabilities, but maintenance is aging—releases come infrequently. Suitable for established projects or where libpq is already present; consider a more actively maintained driver like psycopg if you are starting a new project or need frequent updates.

Install

pygresql on PyPI

pip

pip install pygresql

uv

uv add pygresql

poetry

poetry add pygresql

Installing PyGreSQL

Before you install

Medium install friction due to compiled C extension and requirement for libpq system library on the client machine. Package is mature (since 2006) with aging maintenance status—last release 201 days ago, but repository remains active with recent commits.

License in practice

License treatment is marked unclear; the SPDX identifier is PostgreSQL, which is permissive, but raw license metadata is absent from the package metadata. Verify the actual license terms before adopting in proprietary or restricted contexts.

Quickstart

pip install PyGreSQL

import pygresql.pg as pg
conn = pg.connect('localhost', 'mydb', user='postgres')
result = conn.query('SELECT * FROM mytable')
conn.close()

libpq shared library must be installed and accessible on the client machine; PostgreSQL server versions 12 to 18 are supported.

Verify before relying

  • Specific performance characteristics or throughput compared to other PostgreSQL adapters.
  • Whether the PostgreSQL license treatment applies uniformly across all distributions or platforms.
  • Current adoption rate and community activity beyond the core maintainers.

Package facts

License PostgreSQL (unclear)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 201 days since the last release
Last repo commit
First released
Downloads 363,428/month — #7,221 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pygresql-6.2.3-cp310-cp310-win_amd64.whl; pygresql-6.2.3-cp311-cp311-win_amd64.whl; pygresql-6.2.3-cp312-cp312-win_amd64.whl; pygresql-6.2.3-cp313-cp313-win_amd64.whl; pygresql-6.2.3-cp314-cp314-win_amd64.whl; pygresql-6.2.3-cp39-cp39-win_amd64.whl

Keywords: pygresql, postgresql, database, api, dbapi

Development Status :: 6 - MatureIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: SQLTopic :: DatabaseTopic :: Database :: Front-EndsTopic :: Software Development :: Libraries :: Python Modules

Tags

postgresql python driverpostgres database connectionlibpq python wrapperpostgresql client librarypython database adapter
postgresqldatabase-driverc-extension

More Python Modules packages