https://github.com/kornelijus/gloomy
glom, but not as slow
https://github.com/kornelijus/gloomy
glom python python-library
Last synced: 4 months ago
JSON representation
glom, but not as slow
- Host: GitHub
- URL: https://github.com/kornelijus/gloomy
- Owner: Kornelijus
- License: mit
- Created: 2025-02-28T11:49:20.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-03-04T08:19:45.000Z (7 months ago)
- Last Synced: 2025-03-29T14:36:09.128Z (6 months ago)
- Topics: glom, python, python-library
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```sh
pip install gloomy
```### Usage
```python
from gloomy import gloomassert 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
```