All Projects → MartinThoma → mpu

MartinThoma / mpu

Licence: MIT license
Martins Python Utilities - Stuff that comes in Handy

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to mpu

Lodash Php
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP
Stars: ✭ 412 (+776.6%)
Mutual labels:  utility, utility-library
go-tools
A utility tool library of Golang.
Stars: ✭ 44 (-6.38%)
Mutual labels:  utility, utility-library
fastnumbers
Super-fast and clean conversions to numbers.
Stars: ✭ 85 (+80.85%)
Mutual labels:  utility, utility-library
react-pendulum
A React Context utility library.
Stars: ✭ 15 (-68.09%)
Mutual labels:  utility, utility-library
C Utils
Tiny, modular, drop-in, library of some most commonly used utility methods for C (embedded) applications. Intended to be used as a git-submodule inside your projects to kickstart development. See https://c-utils.gotomain.io for more details.
Stars: ✭ 47 (+0%)
Mutual labels:  utility, utility-library
Fakeit
The Kotlin fake data generator library!
Stars: ✭ 482 (+925.53%)
Mutual labels:  utility, utility-library
Infinite-File-Curtailer
Curtail is a utility program that reads stdin and writes to a file bound by size.
Stars: ✭ 23 (-51.06%)
Mutual labels:  utility, utility-library
Utils
A collection of useful PHP functions, mini classes and snippets that you need and can use every day.
Stars: ✭ 750 (+1495.74%)
Mutual labels:  utility, utility-library
Bbo
bbo is a utility library of zero dependencies for javascript. 🍖🌭🍔
Stars: ✭ 227 (+382.98%)
Mutual labels:  utility, utility-library
seedboxsync
Script for sync operations between your NAS and your seedbox.
Stars: ✭ 17 (-63.83%)
Mutual labels:  python-3-7, python-3-8
laika
Log, test, intercept and modify Apollo Client's operations
Stars: ✭ 99 (+110.64%)
Mutual labels:  utility
black hole flutter
🛠 A package absorbing all Flutter utility functions, including extension functions and commonly used widgets
Stars: ✭ 18 (-61.7%)
Mutual labels:  utility
ios
CoThings's iOS application. CoThings is a realtime counter for shared things.
Stars: ✭ 13 (-72.34%)
Mutual labels:  utility
not-enough-standards
A modern header-only C++ library that provides platform-independent utilities.
Stars: ✭ 197 (+319.15%)
Mutual labels:  utility-library
discord-paginationembed
A pagination utility for MessageEmbed in Discord.JS
Stars: ✭ 93 (+97.87%)
Mutual labels:  utility
HEAPUtil
Code for the RA-L (IROS) 2021 paper "A Hierarchical Dual Model of Environment- and Place-Specific Utility for Visual Place Recognition"
Stars: ✭ 46 (-2.13%)
Mutual labels:  utility
suspend
suspend/resume a list of processes in Windows
Stars: ✭ 23 (-51.06%)
Mutual labels:  utility
eth-rpc-errors
Ethereum RPC Errors
Stars: ✭ 78 (+65.96%)
Mutual labels:  utility
js-utils
🔥 A collection of some JavaScript utility functions for everyday use
Stars: ✭ 16 (-65.96%)
Mutual labels:  utility
TestCards
A simple test pattern generator.
Stars: ✭ 46 (-2.13%)
Mutual labels:  utility

PyPI version Python Support Documentation Status Build Status MartinThoma Build Status Coverage Status Code style: black GitHub last commit GitHub commits since latest release (by SemVer) CodeFactor mutmut

mpu

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 120 kB in zipped form. This makes it a candidate to include into AWS Lambda projects.

Installation

$ pip install git+https://github.com/MartinThoma/mpu.git

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

Usage

Datastructures

>>> from mpu.datastructures import EList

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

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

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

Shell

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

from mpu.shell import Codes

print("{c.GREEN}{c.UNDERLINED}Works{c.RESET_ALL}".format(c=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()
print(df)

gives

     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

Money

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
print(savings)

prints 1375.31 Euro

IO

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].