Skip to content

Welcome to MayPy

Logo

Pythonic Java Optional API

Language License Style Lint Tests


Source Code: https://github.com/MLetrone/maypy

documentation: https://mletrone.github.io/maypy/


Maypy is python implementation of the well known Java Optional API. It's designed to help you handle potential None values, reducing error from NoneType.

Features :

  • Brings functional programming
  • Easy to use
  • Fully typed and compatible with mypy !
  • Lightweight

Description

It's not rare to handle return from function that maybe either a value or None. Like .get from a dictionary, results from api or ORM etc. With no more if value is None with MayPy, encapsulate your value and do what you want to.

MayPy brings Maybe a wrapper (container), it is either empty if the value passed was None or valuated, in this case it contains the value, and we can perform operation on it.