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-0.0.1a3.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

miniutils-0.0.1a3-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

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

Hashes for miniutils-0.0.1a3.tar.gz
Algorithm Hash digest
SHA256 090e5890645a7331c838adaddc15cf93f76cb8eadada75ef7ce116700c9b851c
MD5 cc3d03146da63a57c11f922ee307f104
BLAKE2b-256 56584f1e52693e31bdd122e8b0a6d894171e0d29f5f7f0d15a39095f5a37b0bf

See more details on using hashes here.

File details

Details for the file miniutils-0.0.1a3-py3-none-any.whl.

File metadata

File hashes

Hashes for miniutils-0.0.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 8750c7117a2dbcc5fe21719811db0ab3c64394960311dc0cf3d36ab01cc0e7fa
MD5 d49a5773c8270c76dbc99c3e00ed9936
BLAKE2b-256 86039ed6a77a05679588e30871330f138816cf8899d98787c65ae6bbc64b3300

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