A set of utilities for Python (3).
Juha Jokela ([email protected])
Built for Python 3 runtime.
pip install git+https://github.com/juhajokela/swiss-army-knife
from swiss_army_knife.monad import Maybe
def get_street_from_company(company):
return (
Maybe(company)
.then(lambda company: company.get('address'))
.then(lambda address: address.get('street'))
.value
)