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

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.2
File Size Uploaded
pgserviceparser-1.0.2.tar.gz 14.4 kB Details

Built distribution (wheel)

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

Total release size: 29.1 kB

Release files / pgserviceparser-1.0.2.tar.gz

Download URL pgserviceparser-1.0.2.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3f263216dc7611a5ddc038aa7281d0c938722bc2a8ad3790b3a0a91f9670d589
BLAKE2b-256 checksum
How to use checksums
89f1dab5291347d14e7cee62121301ef50881776a2302676d73ed087f3db3432
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.0.2-py3-none-any.whl

Download URL pgserviceparser-1.0.2-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83f694b4559ec9d178456a151102cdbeeb76b8ef7fea1cc898c8eeb39b026840
BLAKE2b-256 checksum
How to use checksums
294744c45d191009dbf2a2818911822b9121dd23265d210d6eb96b608cb6d9ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

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

This release

1.0.2 This release

2 release files

1.0.1

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