Skip to main content

glom, but not as slow

Project description

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.

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

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

gloomy-0.2.5.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gloomy-0.2.5-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file gloomy-0.2.5.tar.gz.

File metadata

  • Download URL: gloomy-0.2.5.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for gloomy-0.2.5.tar.gz
Algorithm Hash digest
SHA256 daba23ef0437c07b51836e7b73a73a0792b8d064a0bab9db0c2a9ae4538e64db
MD5 d977d45f37c057c071c9d0faad7e0129
BLAKE2b-256 c08e7082e4260bdedb4e794767d2ec4c618a7039b274e7507a75df9195658ef5

See more details on using hashes here.

File details

Details for the file gloomy-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: gloomy-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for gloomy-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 48ff3e81786b94cce4c59fe35fb2beaea95c9faedad2dce41e5ef78ec2a8ef71
MD5 876acc66bbace56ce2b35c45df676cf3
BLAKE2b-256 0653d57cb4c88ab771ffbc8c0b6e10f9aafb7cac94206e28f76ccc19dc6df586

See more details on using hashes here.

Supported by

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