Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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

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 History

Release History

This version
History Node

1.1.0

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pgpasslib-1.1.0-py2.py3-none-any.whl (7.8 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel May 6, 2016
pgpasslib-1.1.0.tar.gz (5.2 kB) Copy SHA256 Checksum SHA256 Source May 6, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting