Skip to main content

A collection of useful utilities

Project description

utilki

codecov

utils that are frequently used by me and might be useful for others

installation

pip install utilki

TaskMixin

Mixin class that adds create() classmethod to dataclass you define as your task params. Useful when you have a lot of container based tasks executed on remote clusters (e.g. Kubernetes, Hashicorp Nomad, etc.). It reads task params from environment variables, parses, and validates them.

from utilki import TaskMixin

@dataclass
class Task(TaskMixin):
    ayy: float = 69.69
    lmao: str = "420"

os.environ["ayy"] = "42.42"
os.environ["lmao"] = "69"

t = Task.create()
print(f"ayy: {t.ayy}, type: {type(t.ayy)}")
# ayy: 42.42, type: <class 'float'>
print(f"lmao: {t.lmao}, type: {type(t.lmao)}")
# lmao: 69, type: <class 'str'>

Cli

Venv

$ utilki venv 3.8.10
$ Enter venv name: new_venv
$ Created venv `new_venv` with Python version 3.8.10

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

utilki-0.4.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

utilki-0.4.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file utilki-0.4.2.tar.gz.

File metadata

  • Download URL: utilki-0.4.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.8.16 Linux/5.15.0-1038-azure

File hashes

Hashes for utilki-0.4.2.tar.gz
Algorithm Hash digest
SHA256 ffac267c73888b56b7edaa4106bff817ea6384ba8fe6985283f5ae940a0c08c2
MD5 f5c5946324bf91ec3f43d0d0f8c3011e
BLAKE2b-256 8ffdba418a529f1c4aece18b68cdb09ce3c029a2aa2bd857c7864e049e44ec34

See more details on using hashes here.

Provenance

File details

Details for the file utilki-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: utilki-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.8.16 Linux/5.15.0-1038-azure

File hashes

Hashes for utilki-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 829078707526f84d3196208cf017f73b718a50df4bcae464feafe9f86b64d01a
MD5 fc31ea786e145d1e389da0ad7c19f73c
BLAKE2b-256 24bda8ec74cdf3bbdbc0494992bca7da6a4f19db84ccb656324770f7ec436a40

See more details on using hashes here.

Provenance

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