Small Python utilities for adding concise functionality and usability to your code
Project description
Overview
Full documentation for this module is available over at ReadTheDocs.
This module provides numerous helper utilities for Python3.X code to add functionality with minimal code footprint. It has tools for the following tasks:
Progress bars on serial loops and parallel mappings (leveraging the excellent tqdm library)
Simple lazy-compute and caching of class properties, including dependency chaining
Executing Python2 code from within a Python3 program
More intuitive contract decorator (leveraging pycontracts)
Installation
As usual, you can install the latest code version directly from Github:
pip install git+https://github.com/scnerd/miniutils
Or you can pip install the latest release from PyPi:
pip install miniutils
Examples
To get started, you can import your desired utilities directly from miniutils. For example, to use the CachedProperty decorator:
from miniutils import CachedProperty class MyClass: @CachedProperty def attribute(self): return some_slow_computation(self)
Or to use the progress bar utilities:
from miniutils import progbar, parallel_progbar def mapper(x): return x**2 assert [mapper(i) for i in progbar(100)] == parallel_progbar(mapper, range(100))
To see documentation for each feature, look through this documentation or the table of contents above.
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
File details
Details for the file miniutils-0.0.1a3.tar.gz
.
File metadata
- Download URL: miniutils-0.0.1a3.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 090e5890645a7331c838adaddc15cf93f76cb8eadada75ef7ce116700c9b851c |
|
MD5 | cc3d03146da63a57c11f922ee307f104 |
|
BLAKE2b-256 | 56584f1e52693e31bdd122e8b0a6d894171e0d29f5f7f0d15a39095f5a37b0bf |
File details
Details for the file miniutils-0.0.1a3-py3-none-any.whl
.
File metadata
- Download URL: miniutils-0.0.1a3-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8750c7117a2dbcc5fe21719811db0ab3c64394960311dc0cf3d36ab01cc0e7fa |
|
MD5 | d49a5773c8270c76dbc99c3e00ed9936 |
|
BLAKE2b-256 | 86039ed6a77a05679588e30871330f138816cf8899d98787c65ae6bbc64b3300 |