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

Uploaded Source

Built Distribution

utilki-0.3.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: utilki-0.3.4.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.10 Darwin/22.4.0

File hashes

Hashes for utilki-0.3.4.tar.gz
Algorithm Hash digest
SHA256 4ff31cf2d489004fe362475769f58123d1620440f559d2ffae10d7cbf0d87a9b
MD5 4356699e88e86883ffb5c67437437978
BLAKE2b-256 ba751554e23fa9c9655f0e8bf80062e5e80030c03cf111797fd2cc4247c43e98

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: utilki-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.10 Darwin/22.4.0

File hashes

Hashes for utilki-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fe6e69bed1c3a50a253d956a19a4c38b5c3ceeb4f62dde17fc2c2fc145d4308a
MD5 dc5fa558329312722e0834ac3af9e1fa
BLAKE2b-256 7e0bfc7ddf58e284edcf1abc7b2f58e266b2515db1dbf0cd685f91f7d29da4d4

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