Skip to main content

Small Python utilities for adding concise functionality and usability to your code

Project description

https://coveralls.io/repos/github/scnerd/miniutils/badge.svg?branch=master https://travis-ci.org/scnerd/miniutils.svg?branch=master Documentation Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miniutils-1.0.2.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

miniutils-1.0.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file miniutils-1.0.2.tar.gz.

File metadata

  • Download URL: miniutils-1.0.2.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for miniutils-1.0.2.tar.gz
Algorithm Hash digest
SHA256 dd3bf623328e5c0b9bdc31599c4087d945fefa7307a29dbc8e79eb06131ff45c
MD5 6074af1c64bccc7e784ff05f098fd0b8
BLAKE2b-256 1151f94c293c860d81983ffb1eac36199ea2a5e2a84cd6d5b96f25f919dbe2c8

See more details on using hashes here.

File details

Details for the file miniutils-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: miniutils-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for miniutils-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1acd3549a0887a5d0982418bbdaa74adba4147e48547795d7376760999c61901
MD5 e0c14fa410ad4f29bc9a570802a86cde
BLAKE2b-256 efe0eec14c03ecc38e8a0653c6839767a31ce623d7ebfa92e217ebb7fe6a22ef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page