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.
Installation
pgpasslib may be installed via the Python package index with the tool of your choice. I prefer pip:
pip install pgpasslib
Documentation
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)
| File | Size | Uploaded | |
|---|---|---|---|
| pgpasslib-1.1.0.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 |