Name | pgserviceparser JSON |
Version |
2.0.1
JSON |
| download |
home_page | None |
Summary | A package parsing the PostgreSQL connection service file |
upload_time | 2024-04-30 13:42:55 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License |
keywords |
postgres
service
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pgserviceparser
A python package parsing the PostgreSQL connection service file.
```python
>>> 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.
```python
>>> 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`.
```python
>>> 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`.
```python
>>> 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()](https://docs.python.org/3/library/configparser.html).
Optionally you can pass a config file path. Otherwise it gets it by `conf_path`.
```python
>>> pgserviceparser.full_config()
<configparser.ConfigParser object at 0x7f4c6d66b580>
```
----
## Contribute
### Git hooks
```sh
pip install pre-commit
pre-commit install
```
Raw data
{
"_id": null,
"home_page": null,
"name": "pgserviceparser",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "postgres, service",
"author": null,
"author_email": "David Signer <info@opengis.ch>, Julien Moura <julien.moura@oslandia.com>, Germ\u00e1n Carrillo <info@opengis.ch>, Denis Rouzaud <info@opengis.ch>",
"download_url": "https://files.pythonhosted.org/packages/9a/47/fc349a4c900d5cd73dc49c71f50bb8dca336666d1d3dc25e950676fc41ab/pgserviceparser-2.0.1.tar.gz",
"platform": null,
"description": "# pgserviceparser\n\nA python package parsing the PostgreSQL connection service file.\n\n```python\n>>> import pgserviceparser\n```\n\n## Finding the PostgreSQL connection service file with `conf_path`\n\nReturns the path found for the pg_service.conf on the system as string.\n\n```python\n>>> pgserviceparser.conf_path()\n'/home/dave/.pg_service.conf'\n```\n\n## Listing all the services with `service_names`\n\nReturns all service names in a list.\nOptionally you can pass a config file path. Otherwise it gets it by `conf_path`.\n\n```python\n>>> pgserviceparser.service_names()\n['srvce_wandplaene', 'ktn_solothurn', 'daves_bakery']\n\n```\n\n## Receiving the configuration for a service with `service_config`\n\nReturns the config from the given service name as a dict.\nOptionally you can pass a config file path. Otherwise it gets it by `conf_path`.\n\n```python\n>>> pgserviceparser.service_config('daves_bakery')\n{'host': 'localhost', 'port': '5432', 'dbname': 'bakery', 'user': 'dave', 'password': 'fischersfritz'}\n```\n\n## Getting the full configuration with `full_config`\n\nReturns full pgservice config as [configparser.ConfigParser()](https://docs.python.org/3/library/configparser.html).\nOptionally you can pass a config file path. Otherwise it gets it by `conf_path`.\n\n```python\n>>> pgserviceparser.full_config()\n<configparser.ConfigParser object at 0x7f4c6d66b580>\n```\n\n----\n\n## Contribute\n\n### Git hooks\n\n```sh\npip install pre-commit\npre-commit install\n```\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A package parsing the PostgreSQL connection service file",
"version": "2.0.1",
"project_urls": {
"homepage": "https://opengisch.github.io/pgserviceparser/",
"repository": "https://github.com/opengisch/pgserviceparser",
"tracker": "https://github.com/opengisch/pgserviceparser/issues"
},
"split_keywords": [
"postgres",
" service"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fc3e31194b4702e6d51ea3c098177ff0d52349415df6aed275f37d14b968352c",
"md5": "a9712d1222e5f58ec5a49fc57b680bac",
"sha256": "c0e1512640ff0f89e21adfab49bb93b22e8ee6806c3f4b27289ff1e6e57472d4"
},
"downloads": -1,
"filename": "pgserviceparser-2.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a9712d1222e5f58ec5a49fc57b680bac",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 3818,
"upload_time": "2024-04-30T13:42:53",
"upload_time_iso_8601": "2024-04-30T13:42:53.967618Z",
"url": "https://files.pythonhosted.org/packages/fc/3e/31194b4702e6d51ea3c098177ff0d52349415df6aed275f37d14b968352c/pgserviceparser-2.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9a47fc349a4c900d5cd73dc49c71f50bb8dca336666d1d3dc25e950676fc41ab",
"md5": "fa4002c254b45d6968521271c66ebc23",
"sha256": "916cda21673f75b66f85eb3d382361c596bb5938cc01e85bce68c328ba3b7ae4"
},
"downloads": -1,
"filename": "pgserviceparser-2.0.1.tar.gz",
"has_sig": false,
"md5_digest": "fa4002c254b45d6968521271c66ebc23",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 7065,
"upload_time": "2024-04-30T13:42:55",
"upload_time_iso_8601": "2024-04-30T13:42:55.593203Z",
"url": "https://files.pythonhosted.org/packages/9a/47/fc349a4c900d5cd73dc49c71f50bb8dca336666d1d3dc25e950676fc41ab/pgserviceparser-2.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-30 13:42:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "opengisch",
"github_project": "pgserviceparser",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pgserviceparser"
}