py-utilz
Convenient helper functions, decorators, and data analysis tools to make life easier with minimal dependencies:
pip install py-utilz
dplyr like data grammar:
from utilz import pipe
import utilz.dfverbs as _
out = pipe(
df,
_.rename({"weight (male, lbs)": "male", "weight (female, lbs)": "female"}),
_.pivot_longer(columns=["male", "female"], into=("sex", "weight")),
_.split("weight", ("min", "max"), sep="-"),
_.pivot_longer(columns=["min", "max"], into=("stat", "weight")),
_.astype({"weight": float}),
_.groupby("genus", "sex"),
_.mutate(weight="weight.mean()"),
_.pivot_wider(column="sex", using="weight"),
_.mutate(dimorphism="male / female")
)
from utilz import map
# Combine function results into a list, array, or dataframe
map(myfunc, myiterable)
# Syntactic sugar for joblib.Parallel
map(myfunc, myiterable, n_jobs=4)
from utilz import log, maybe
# Print the shape of args and outputs before and after execute
@log
def myfunc(args):
return out
# Only run myfunc if results.csv doesn't eist
@maybe
def myfunc(args, out_file=None):
return out
myfunc(args, out_file='results.csv')
Development
- Install poetry:
curl -sSL https://install.python-poetry.org | python - Setup virtual environment
poetry install --with dev - Run all tests:
poetry run pytest - Live render docs:
poetry run mkdocs serve
Additional poetry/virtual environment commands
- Activate environment in current shell:
source activate .venv/bin/activate - Activate environment in sub-process shell:
poetry shell - Add/remove additional packages:
poetry add/remove package_name - Build local package:
poetry build - Deploy to pypi:
poetry publish(requires auth)
Metadata
Release files for py-utilz 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_utilz-0.4.1.tar.gz | 44.9 kB | Without provenance | Details for py_utilz-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_utilz-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for py_utilz-0.4.1-py3-none-any.whl |
Total release size: 99.5 kB
Release files / py_utilz-0.4.1.tar.gz
| Download URL | py_utilz-0.4.1.tar.gz |
|---|---|
| Size | 44.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71fbbbe37379b532a2eb2d018807c5dba6dee1f523e154b6c63cbb7d3abd92cb
|
|
BLAKE2b-256 checksum How to use checksums |
01721b30014b270c2f5d8b0facb85357971bc0c86ec2ef7c14363c0817dfae39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / py_utilz-0.4.1-py3-none-any.whl
| Download URL | py_utilz-0.4.1-py3-none-any.whl |
|---|---|
| Size | 54.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d5c84943893012a5551e9de41cf752e46b8e5ebab16b5102dd04f553e90470d5
|
|
BLAKE2b-256 checksum How to use checksums |
bb24a79f1212100e9db17c42f2ebc09eeb9f24bd562e5fad21d41fd4aeefb415
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for py-utilz 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.