Skip to main content

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.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pgserviceparser 1.0.1
File Size Uploaded
pgserviceparser-1.0.1.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pgserviceparser 1.0.1
File Interpreter ABI Platform
pgserviceparser-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.1 kB

Release files / pgserviceparser-1.0.1.tar.gz

Download URL pgserviceparser-1.0.1.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4647ad693ccbbb2c8e3e419e12b3daabb8d339ffe87ed6e958369335e2d453af
BLAKE2b-256 checksum
How to use checksums
7d00b32b55b1a144ee23a0d16419cdd8f0da04377ef22492400df897a4699b85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release files / pgserviceparser-1.0.1-py3-none-any.whl

Download URL pgserviceparser-1.0.1-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76cdd3f546ff9c1f6d659be47c25b13053af19d33b842efa905007059d97f305
BLAKE2b-256 checksum
How to use checksums
9fd2ac2e7357674e3819ded17c8a6c3e50f3f3c5b922a30596643cda73a31a9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release history Release notifications | RSS feed

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page