A handful of utilities.
Project description
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 MLTBase
config = {
"postgresql": {
"host": "host",
"user": "user",
"password": "password",
"database": "database"
},
"elasticsearch": {
"host": "host",
"user": "user",
"password": "password"
}
}
class TestClassifier(MLTBase):
def __init__(self, **kwargs):
super().__init__(**kwargs)
def some_method_fetching_data_from_db(self):
return self.pg_client.query("SELECT * FROM table LIMIT 1")
def some_other_method_fetching_data_from_es(self):
return self.es_client.query("...")
testclassifier = TestClassifier(
pg_config = config.get("postgresql"),
es_config = config.get("elasticsearch")
)
TODO
- Add a dev branch
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pynidus-0.0.131.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for pynidus-0.0.131-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 567f7184fc3e234b3a5a2c2c296c0251bfdcb7b844b0ec06026e2099c2f2600e |
|
MD5 | d318f4f97e7a2288f9c19d4ab75134f3 |
|
BLAKE2b-256 | 3004055e67307c63bc081f00db7a0437d848fe4d9aff808d1c4324c7789e9769 |