Skip to main content

Martins Python Utilities

Project description

PyPI version Python Support Documentation Status Build Status Coverage Status


Martins Python Utilities (mpu) is a collection of utility functions and classes with no other dependencies.

The total size of the package will never be bigger than 10 MB and currently it is 15.7 kB in zipped form. This makes it a candidate to include into AWS Lambda projects.


$ pip install git+

It can, of course, also be installed via PyPI.



>>> from mpu.datastructures import EList

>>> l = EList([2, 1, 0])
>>> l[2]

>>> l[[2, 0]]
[0, 2]

>>> l[l]
[0, 1, 2]


To enhance your terminals output, you might want to do something like:

from import Codes


Quick Examples

Creating small example datastructures is a task I encounter once in a while for StackExchange answers.

from mpu.pd import example_df

df = example_df()


     country   population population_time    EUR
0    Germany   82521653.0      2016-12-01   True
1     France   66991000.0      2017-01-01   True
2  Indonesia  255461700.0      2017-01-01  False
3    Ireland    4761865.0             NaT   True
4      Spain   46549045.0      2017-06-01   True
5    Vatican          NaN             NaT   True


import mpu
from fractions import Fraction

gross_income = mpu.units.Money("2345.10", "EUR")
net_income = gross_income * Fraction("0.80")
apartment = mpu.units.Money("501.23", "EUR")
savings = net_income - apartment

prints 1375.31 Euro


  • Download files with, sink)
  • Read CSV, JSON and pickle with
  • Write CSV, JSON and pickle with, data)

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

mpu-0.23.1.tar.gz (65.4 kB view hashes)

Uploaded source

Built Distribution

mpu-0.23.1-py3-none-any.whl (69.7 kB view hashes)

Uploaded py3

Supported by

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