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>
Metadata
Release files for pgserviceparser 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 | |
|---|---|---|---|
| pgserviceparser-1.1.0.tar.gz | 14.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pgserviceparser-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.3 kB
Release files / pgserviceparser-1.1.0.tar.gz
| Download URL | pgserviceparser-1.1.0.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bbdf2f884763bb4e07e611051aafe43189e37952e9201b6baff53832534679b
|
|
BLAKE2b-256 checksum How to use checksums |
125350ac8ca2630355cbdc78579563cfdd21a3dcd41207924ca491cae63db91a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pgserviceparser-1.1.0-py3-none-any.whl
| Download URL | pgserviceparser-1.1.0-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a8c551772b38f46a435c023e3a27c0a955e8a5c5aeadfc0bf354530685761bf6
|
|
BLAKE2b-256 checksum How to use checksums |
8ef8e0251c5cc98d929531a5e18392878a824e3688bb2658be927b4c43437a97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|