utilki
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
Release files for utilki 0.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| utilki-0.13.0.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| utilki-0.13.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.1 kB
Release files / utilki-0.13.0.tar.gz
| Download URL | utilki-0.13.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9aba3ab59f12eb9ba0266fdd27da3c3fa44d4024e84c272fe99af70267c4b2d
|
|
BLAKE2b-256 checksum How to use checksums |
4472bbfedde444295d054aabb1f355943807d0427851106f0fdec175b2f4e0e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Linux/6.5.0-1015-azure
|
Release files / utilki-0.13.0-py3-none-any.whl
| Download URL | utilki-0.13.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09f795f2bb836568601df92dbfa691a8aaec9f7186c362effd03d43b6155d1d0
|
|
BLAKE2b-256 checksum How to use checksums |
c2526049c128bcedbcad851fc13e890a05844f77ffd491d5941a78fe1d5e3e1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Linux/6.5.0-1015-azure
|