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.1a5.tar.gz
.
File metadata
- Download URL: miniutils-0.0.1a5.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebde3f256e82d67e34fea666b4b7d9a8b3990c7dc4c1f6fa3de8dd36d0d8c72b |
|
MD5 | 251ee536121df2c2b128dee638b31fbe |
|
BLAKE2b-256 | 29cc7c6b97ef06fa1a2f6454466b8576facbdb198fa4c3e7b266b7febca80c05 |
File details
Details for the file miniutils-0.0.1a5-py3-none-any.whl
.
File metadata
- Download URL: miniutils-0.0.1a5-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52b391d7250ad869d928ed65e290379949ccc9773e987bb45738023a591166b9 |
|
MD5 | 3f9f1c175e48b409386f56219d07032c |
|
BLAKE2b-256 | 02c49b11623a34266ba1f797f90bb47e60c11a95e34f59351ea745fef39414d8 |