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

Uploaded Source

Built Distribution

utilki-0.5.4-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: utilki-0.5.4.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.8.17 Linux/5.15.0-1040-azure

File hashes

Hashes for utilki-0.5.4.tar.gz
Algorithm Hash digest
SHA256 7d2fcc5a7e3efb00765dfc6e2b9e7bcfb2c501c60a00436846c7d1e83f8227f5
MD5 55b5f3691e1bd515ff9f4cd9e557e510
BLAKE2b-256 7cf63dada1a8183149966ce0a4fc606ad4ecaa5f27488e80276697c50e0c9b25

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for utilki-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4efc797f28be8accab99a8b4271593ba3cebc93cc1c6cb987812c513aa528e4b
MD5 d6095f8a726c9e074485337495f19605
BLAKE2b-256 c1b0df1746ec64b833cb59c99fc45531c058c8264aae6dc840948b389bc0d46c

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