Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

pgpasslib is a library for retrieving passwords from a PostgreSQL password file, either from a location specified in the PGPASSFILE environment variable or in the .pgpass file in the current user’s home directory.

Version Downloads Status Coverage Code Climate

Installation

pgpasslib may be installed via the Python package index with the tool of your choice. I prefer pip:

pip install pgpasslib

Documentation

https://pgpasslib.readthedocs.org

Requirements

There are no requirements outside of the Python standard library.

Example

The following example will attempt to get the password for PostgreSQL running on localhost:5432 to the postgres database as the postgres user.

import pgpasslib

password = pgpasslib.getpass('localhost', 5432, 'postgres', 'postgres')
if not password:
    raise ValueError('Did not find a password in the .pgpass file')

Version History

Available at https://pgpasslib.readthedocs.org

Release files for pgpasslib 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pgpasslib 1.1.0
File Size Uploaded
pgpasslib-1.1.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pgpasslib 1.1.0
File Interpreter ABI Platform
pgpasslib-1.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.0 kB

Release files / pgpasslib-1.1.0.tar.gz

Download URL pgpasslib-1.1.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f523050cb466f43526b2f4877bf2b1a1f09dfd7c7310e1e836c773f48bc10d27
BLAKE2b-256 checksum
How to use checksums
25f4dadd63a080573bca4cc5b53882997207604810ebe12373d04d5a0c687237
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pgpasslib-1.1.0-py2.py3-none-any.whl

Download URL pgpasslib-1.1.0-py2.py3-none-any.whl
Size 7.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
290084d524d07b8414d3457545c14ba7761cdcdc86350e9c9efbcb58210b77fc
BLAKE2b-256 checksum
How to use checksums
ef7ed93aaeac229141956853c282e94da3c3db3d592224344501e962b9485f4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page