Metadata-Version: 2.1
Name: miniutils
Version: 1.0.2
Summary: Small Python utilities for adding concise functionality and usability to your code
Home-page: http://miniutils.readthedocs.io/en/latest/
Author: scnerd
Author-email: scnerd@gmail.com
License: MIT
Download-URL: https://github.com/scnerd/miniutils
Keywords: miniutils,utilities,decorators,minimal
Platform: UNKNOWN
Requires-Python: >=3
Requires-Dist: tqdm
Requires-Dist: pycontracts
Requires-Dist: coloredlogs

.. image:: https://coveralls.io/repos/github/scnerd/miniutils/badge.svg?branch=master
    :target: https://coveralls.io/github/scnerd/miniutils?branch=master

.. image:: https://travis-ci.org/scnerd/miniutils.svg?branch=master
    :target: https://travis-ci.org/scnerd/miniutils

.. image:: https://readthedocs.org/projects/miniutils/badge/?version=latest
    :target: http://miniutils.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

Overview
--------

Full documentation for this module is available over at `ReadTheDocs <http://miniutils.readthedocs.io/>`_.

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.


