Library for getting passwords from PostgreSQL password files
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pgpasslib-1.1.0.tar.gz.
File metadata
- Download URL: pgpasslib-1.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f523050cb466f43526b2f4877bf2b1a1f09dfd7c7310e1e836c773f48bc10d27
|
|
| MD5 |
7ac6913e43548acadd3444ef7cac7cb1
|
|
| BLAKE2b-256 |
25f4dadd63a080573bca4cc5b53882997207604810ebe12373d04d5a0c687237
|
File details
Details for the file pgpasslib-1.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: pgpasslib-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
290084d524d07b8414d3457545c14ba7761cdcdc86350e9c9efbcb58210b77fc
|
|
| MD5 |
b41dd22e30b60c91e2be6c52798c49c4
|
|
| BLAKE2b-256 |
ef7ed93aaeac229141956853c282e94da3c3db3d592224344501e962b9485f4b
|