--- id: pypgconfig version: "0.1.0a2" license: Apache License, Version 2.0 license_treatment: permissive maintenance: dormant --- # PyPgConfig — Access pg_config from Python License: permissive · Maintenance: dormant · Downloads: 99.0K/mo ## What it is and what it does PyPgConfig is a thin Python wrapper around the PostgreSQL pg_config utility. It runs pg_config on the system and parses its output to expose PostgreSQL metadata—version number (with major/minor breakdown), linked libraries, and build-time options like Python support—as Python objects and attributes. The package is useful when you need to programmatically discover PostgreSQL installation details at runtime, such as which libraries PostgreSQL was compiled with or whether Python support is enabled. It requires that PostgreSQL and pg_config be installed on the system where the code runs. Use it for: - Detect PostgreSQL version at runtime to conditionally enable or disable features in a Python application. - Query which libraries PostgreSQL was compiled with to verify compatibility before attempting a connection. - Locate the Python installation path that PostgreSQL was built with to ensure consistent Python environments. - Automate build or deployment scripts that need to confirm PostgreSQL is installed and inspect its configuration. - Validate PostgreSQL build options (e.g., Python support) before initializing a database client. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyPgConfig detects and exposes PostgreSQL configuration details from the system's pg_config tool, allowing Python code to query PostgreSQL version, library dependencies, and build settings. Yes, if you need to programmatically query PostgreSQL configuration at runtime and can accept an alpha-stage, dormant package. The low install friction and permissive license are in its favor, and there are no known vulnerabilities. However, the lack of updates since 2023-11-28 and alpha status mean you should verify it works with your PostgreSQL version and be prepared to maintain a fork if needed. ## Install pip install pypgconfig uv add pypgconfig poetry add pypgconfig ## Installing PyPgConfig Before you install: Installation is straightforward with low friction—the package is a pure Python wheel with only setuptools and pip as runtime dependencies. However, the project is dormant; the last commit was 2023-11-28 and no updates have been released since the initial 0.1.0a2 alpha version. License in practice: Licensed under Apache License, Version 2.0 (permissive), so you may use, modify, and distribute the package freely in commercial and private projects, provided you include a copy of the license. Quickstart: pip install PyPgConfig from pypgconfig import detect pgconf = detect() pgconf.version # "15.4" pgconf.libs # ["pgcommon", "pgport", "lz4", "xml2"] PostgreSQL and pg_config must be installed on the system where this code runs. Verify before relying: - Whether detect() raises an exception or returns a specific value if pg_config is not found. - Whether the package works with PostgreSQL versions other than the 15.4 example shown. - Stability guarantees for the 0.1.0a2 alpha release and whether a stable 1.0 is planned. ## Package facts - License: Apache License, Version 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 99.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags postgres configuration detection, pg_config python wrapper, postgresql version detection, query postgres build info, postgresql library discovery, postgres installation details, pg_config from python, postgres-integration, system-discovery [View on SkillFed](https://skillfed.io/packages/pypgconfig) · [View on PyPI](https://pypi.org/project/pypgconfig/)