Decorators and functional pipeline utilities
Project description
erofdmit-hw02-decorators
Набор утилит с декораторами и простым функциональным пайплайном.
Установка
pip install erofdmit-hw02-decorators
Декораторы
from hw02.decorators import retry, trace, validate_types
@retry(times=3, delay=0.1, exceptions=(ConnectionError,))
@trace(logger_name="app")
@validate_types
def fetch(url: str) -> str:
return f"ok: {url}"
Пайплайн
from hw02.pipeline import compose, filter_by, pipe, sort_by, take
pipeline = pipe(
filter_by(active=True),
sort_by("name"),
take(2),
)
transform = compose(take(2), sort_by("name"), filter_by(active=True))
Локальная проверка
uv sync --dev
uv run black .
uv run ruff check . --fix
uv run pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file erofdmit_hw02_decorators-0.1.0.tar.gz.
File metadata
- Download URL: erofdmit_hw02_decorators-0.1.0.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c553216b2b60da77a33fd98c15a5f66a1ecf2f8bc9f2836e5722dcdad1121f17
|
|
| MD5 |
a3029f8eaa6bfcf9d2e085ff1ccd9250
|
|
| BLAKE2b-256 |
b804bb05f4e6042fb058e26f6469c6aac4b1f64a57b6224056933ecc05372ec3
|
File details
Details for the file erofdmit_hw02_decorators-0.1.0-py3-none-any.whl.
File metadata
- Download URL: erofdmit_hw02_decorators-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99b29450aee2adfddd53a6276ae4b1af2c9b7aa5bceaf8fe64c886e5c753accd
|
|
| MD5 |
ecb2a760bbf3d049a4d0e1c4411854e8
|
|
| BLAKE2b-256 |
3a12a04d389055f9e6336b1fa1f71567e1f6475094f768d6f9e2634aaa797ce5
|