Skip to content

Kornelijus/gloomy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

gloomy

glom, but not as slow

An utility for retrieving values from deeply nested object attributes, mapping keys, sequence indexes, or any combination of them.

Not meant as a drop in replacement for glom, only basic functionality is implemented.
A good use-case would be to improve existing codebases in which the glom pattern is commonly used for convenience, as it can significantly affect performance.

Planned features

๐Ÿ—๏ธ assign utility
๐Ÿ—๏ธ Path object

Installation

pip install gloomy

Usage

from gloomy import gloom

assert gloom({"a": {"b": {"c": [123]}}}, "a.b.c.0") == 123

# Or with a default in case the path is invalid
assert gloom({}, "a.b.c", default=None) is None

About

๐Ÿ” glom, but not as slow

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages