Skip to main content

A handful of utilities.

Project description

pynidus

Build Status Coverage status PyPI PyPI

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

Project details


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.1.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

pynidus-0.1.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file pynidus-0.1.3.tar.gz.

File metadata

  • Download URL: pynidus-0.1.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pynidus-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1ffeb3016294682a9364a30004f896ee20cfec03361c4c95b1cdd31527353636
MD5 6c0aec6026afac0c4d52fac79680a6f7
BLAKE2b-256 f6e55738ed01f515ba4278a9abf66f229efda97ed5f44c2d2f44c7e9f254f20d

See more details on using hashes here.

File details

Details for the file pynidus-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pynidus-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pynidus-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2d0fa349f21d480457e0424180926da4971785d0b9d524b2baa0c1cdd92e4b42
MD5 51dcec23b0fe4c30a7c7456f8df2e212
BLAKE2b-256 373ae8c8584f083209efdeb21bdd2358ffc5c1fb75c0509f3a935e4b973cc76d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page