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

Uploaded Source

Built Distribution

utilki-0.8.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: utilki-0.8.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.8.18 Linux/6.2.0-1016-azure

File hashes

Hashes for utilki-0.8.1.tar.gz
Algorithm Hash digest
SHA256 fc96bf284ff817cc65c16e445e12c7861f37d0d34505c29ef6f8c93d1fa294b7
MD5 9a3e16b159e5679351669e6effff93fa
BLAKE2b-256 5fa69df3f9fddb66f07be6c61359c300f19ce1a8cd94c547778c4338079f1358

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: utilki-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.8.18 Linux/6.2.0-1016-azure

File hashes

Hashes for utilki-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89363d8516c890eea6d9864378abb7acab1dd8513ede1451d2b1d97c91e73863
MD5 949a1b355ccffc9fa8e84ab80409e256
BLAKE2b-256 2a264c8dcc4ae4b48d39b8afb7fd6c8b5f782a1e1659167cbf45dc7cdf2ecd19

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