pgserviceparser
A python package parsing the PostgreSQL connection service file.
>>> import pgserviceparser
Finding the PostgreSQL connection service file with conf_path
Returns the path found for the pg_service.conf on the system as string.
>>> pgserviceparser.conf_path()
'/home/dave/.pg_service.conf'
Listing all the services with service_names
Returns all service names in a list.
Optionally you can pass a config file path. Otherwise it gets it by conf_path.
>>> pgserviceparser.service_names()
['srvce_wandplaene', 'ktn_solothurn', 'daves_bakery']
Receiving the configuration for a service with service_config
Returns the config from the given service name as a dict.
Optionally you can pass a config file path. Otherwise it gets it by conf_path.
>>> pgserviceparser.service_config('daves_bakery')
{'host': 'localhost', 'port': '5432', 'dbname': 'bakery', 'user': 'dave', 'password': 'fischersfritz'}
Getting the full configuration with full_config
Returns full pgservice config as configparser.ConfigParser().
Optionally you can pass a config file path. Otherwise it gets it by conf_path.
>>> pgserviceparser.full_config()
<configparser.ConfigParser object at 0x7f4c6d66b580>
Contribute
Git hooks
pip install pre-commit
pre-commit install
Metadata
Release files for pgserviceparser 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pgserviceparser-2.0.1.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pgserviceparser-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / pgserviceparser-2.0.1.tar.gz
| Download URL | pgserviceparser-2.0.1.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
916cda21673f75b66f85eb3d382361c596bb5938cc01e85bce68c328ba3b7ae4
|
|
BLAKE2b-256 checksum How to use checksums |
9a47fc349a4c900d5cd73dc49c71f50bb8dca336666d1d3dc25e950676fc41ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pgserviceparser-2.0.1-py3-none-any.whl
| Download URL | pgserviceparser-2.0.1-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c0e1512640ff0f89e21adfab49bb93b22e8ee6806c3f4b27289ff1e6e57472d4
|
|
BLAKE2b-256 checksum How to use checksums |
fc3e31194b4702e6d51ea3c098177ff0d52349415df6aed275f37d14b968352c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|