Skip to main content

DevL's own standard library for Python 3

Project description

Ormgrop

DevL's own standard library for Python 3.

Collections

get_in and require_in

Access values in nested Python structures that respond to the [] indexing syntax.

Inspired by of Elixir's get_in. If you squint.

Usage

For "soft" getting a value, use get_in(collection, path) where path is a list of keys/indices. This function optionally takes a default value to be returned if the final key/index is not found. By default this is None.

For "hard" getting a value, use require_in(collection, path) where path is a list of keys/indices. This function raises a NestedValueNotFoundError if the final key/index is not found.

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

ormgrop-0.1.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

ormgrop-0.1.0-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

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