pynidus
A handful of utilities predominantly made to develop basic Cloud Run services that connect to the same databases. Any configuration variable should be passed as an environment variable from Cloud Run.
Usage
Training a ML model usually require multiple databases access. Although it is doable to instantiate a connection to Postgresql or Elasticsearch everytime one needs to, it can actually become quickly cumbersome to do it for a certain number or models. To make everything a tiny bit more DRY, pynidus wraps very small chunks of code to deal with config files and clients instantiation.
from pynidus.base import MultiClient
config = {
"pg_dev": {
"host": "host",
"user": "user",
"password": "password",
"database": "database",
"port": 5432
},
"pg_logs": {
"host": "host",
"user": "user",
"password": "password"
"database": "database"
},
"es_dev": {
"host": "host",
"user": "user",
"password": "password"
}
}
mc = MultiClient(config)
mc.pg_client["logs"].query("SELECT * FROM some_table")
mc.pg_client["dev"].query("SELECT * FROM another_table")
Or if you want to use it inside a custom Class:
class CustomClass(MultiClient):
def __init__(self, **kwargs):
super().__init__(**kwargs)
cc.pg_client["logs"].query("SELECT * FROM some_table")
cc.pg_client["dev"].query("SELECT * FROM another_table")
TODO
- Add a dev branch
Release files for pynidus 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pynidus-0.1.3.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pynidus-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / pynidus-0.1.3.tar.gz
| Download URL | pynidus-0.1.3.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ffeb3016294682a9364a30004f896ee20cfec03361c4c95b1cdd31527353636
|
|
BLAKE2b-256 checksum How to use checksums |
f6e55738ed01f515ba4278a9abf66f229efda97ed5f44c2d2f44c7e9f254f20d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
|
Release files / pynidus-0.1.3-py3-none-any.whl
| Download URL | pynidus-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d0fa349f21d480457e0424180926da4971785d0b9d524b2baa0c1cdd92e4b42
|
|
BLAKE2b-256 checksum How to use checksums |
373ae8c8584f083209efdeb21bdd2358ffc5c1fb75c0509f3a935e4b973cc76d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
|