Skip to main content

PyPI PyPI - Downloads docs

Checks Checks Coverage

GitHub commits GitHub commit activity GitHub closed pull requests code size, bytes

muutils, stylized as "$\mu$utils" or "μutils", is a collection of miscellaneous python utilities, meant to be small and with no dependencies outside of standard python.

installation

PyPi: muutils

pip install muutils

Optional dependencies:

pip install muutils[array]    # numpy, torch, jaxtyping -- for mlutils, tensor_utils, tensor_info, ml, json_serialize array features
pip install muutils[notebook] # ipython -- for nbutils.configure_notebook
pip install muutils[parallel] # multiprocess, tqdm -- for parallel processing with progress
pip install muutils[web]      # weasyprint -- for web/html_to_pdf

documentation

https://miv.name/muutils

modules

Module Description
statcounter Extension of collections.Counter with smart stats computation (mean, variance, percentiles)
dictmagic Dictionary utilities: dotlist conversion, DefaulterDict, tensor dict condensing
kappa Anonymous getitem (Kappa(lambda x: x**2)[2] returns 4)
sysinfo System information collection for logging
misc Utilities: stable_hash, list_join/list_split, filename sanitization, freeze
interval Mathematical intervals (open/closed/half-open) with containment, clamping, set operations
errormode Enum-based error handling (raise/warn/log/ignore)
validate_type Runtime type validation for basic and generic types
console_unicode Safe console output with Unicode/ASCII fallback
spinner Animated spinners with elapsed time and status updates
timeit_fancy Enhanced timing with multiple runs, profiling, and statistics
dbg Debug printing inspired by Rust's dbg! macro
collect_warnings Context manager to capture and summarize warnings
parallel Simplified parallel processing with progress bars
jsonlines Simple jsonl file reading/writing
group_equiv Group elements by equivalence relation (non-transitive)
json_serialize Serialize arbitrary Python objects to JSON (works with ZANJ)
nbutils Jupyter utilities: notebook conversion, configuration, mermaid/TeX display
math Binning functions and matrix power computation
cli CLI utilities: boolean argument parsing, flag actions
web HTML asset inlining for standalone documents
logger (deprecated) Logging framework, use trnbl instead
mlutils ML pipeline: device detection, seeding, checkpoints (requires array)
tensor_utils PyTorch/numpy type conversions (requires array)
tensor_info Tensor metadata extraction and formatting (requires array)
ml CUDA memory monitoring (requires array)

ZANJ

ZANJ is a human-readable and simple format for ML models, datasets, and arbitrary objects. It's built around having a zip file with json and npy files, and has been spun off into its own project.

There are a couple work-in-progress utilities in _wip that aren't ready for anything, but nothing in this repo is suitable for production. Use at your own risk!

Release files for muutils 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for muutils 0.9.1
File Size Uploaded
muutils-0.9.1.tar.gz 3.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for muutils 0.9.1
File Interpreter ABI Platform
muutils-0.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 MB

Release files / muutils-0.9.1.tar.gz

Download URL muutils-0.9.1.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
7191ed23ca4b6b83cee0bc125f99db02be3ee5bb89d38fba86f144178f4823f5
BLAKE2b-256 checksum
How to use checksums
36dd17cae234b7fb930686450f5c2eddd43b04cb96a3a2bf095c06a69dfeb338
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / muutils-0.9.1-py3-none-any.whl

Download URL muutils-0.9.1-py3-none-any.whl
Size 144.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e7740a0d4080ed01f6490604d1c05b9989b7f88c02b6c987d7a073a02120c32
BLAKE2b-256 checksum
How to use checksums
fe896ca110cfeb7287586578b69459f7e1ab798f36fcca9aa642a5784e4d0f93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.9.1 This release

2 release files

0.9.0

2 release files

0.8.12

2 release files

0.8.9

2 release files

0.8.8

2 release files

0.8.7

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.21

2 release files

0.6.20

2 release files

0.6.19

2 release files

0.6.18

2 release files

0.6.17

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.12

2 release files

0.5.10

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.12

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.2

2 release files

0.3.1

1 release file

0.3.0

1 release file

0.2.2

2 release files

0.2.1

2 release files

0.2.0

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page