Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

glom-dict

ci documentation pypi version

Custom Dictionary with glom path compatible get, set and delete methods.

https://glom.readthedocs.io/en/latest/

For easy access to and operations on nested data.

Installation

python -m pip install glom-dict

Examples

>>> from glom_dict import GlomDict
>>> d = GlomDict(my_dict={"a": {"b": "c"}})
>>> d["my_dict.a.b"]
 'c'

>>> d["my_dict.a.b"] = "C"
>>> d["my_dict.a.b"]
 'C'

Better error messages.

>>> d = GlomDict({'a': {'b': None}})
>>> d["a.b.c"]
Traceback (most recent call last):
...
PathAccessError: could not access 'c', index 2 in path Path('a', 'b', 'c'), got error: ...

Glom Paths

from glom_dict import GlomDict, Path
>>> my_path = Path("a", "b", 1)
>>> d = GlomDict({"a": {"b": ["it", "works", "with", "lists", "too"]}})
>>> d[my_path]
'works'

For more examples refer to the excellent glom tutorial.

https://glom.readthedocs.io/en/latest/tutorial.html

Details

Based on collections.UserDict

Implemented methods

  • __getitem__ - glom.glom()
  • __setitem__ - glom.assign()
  • __delitem__ - glom.delete()
  • assign - glom.assign() - can pass missing callable to automatically backfill missing structures.
  • update - Works but no special behavior

Metadata

Release files for glom-dict 0.0.2a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glom-dict 0.0.2a0
File Size Uploaded Provenance Actions
glom-dict-0.0.2a0.tar.gz 3.7 kB Without provenance Details for glom-dict-0.0.2a0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for glom-dict 0.0.2a0
File Interpreter ABI Platform Actions
glom_dict-0.0.2a0-py3-none-any.whl Python 3 none any Details for glom_dict-0.0.2a0-py3-none-any.whl

Total release size: 7.3 kB

Release files / glom-dict-0.0.2a0.tar.gz

Download URL glom-dict-0.0.2a0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
61d92dc9befb3ee2c058fd05b1fff102160507c6b0a3c1bc60851b30de06d14f
BLAKE2b-256 checksum
How to use checksums
04936eef46f07bb6d4f049a0a5cbe4d41d14e4a3a63c15abd0ca34580fd26bb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Darwin/21.5.0

Release files / glom_dict-0.0.2a0-py3-none-any.whl

Download URL glom_dict-0.0.2a0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e24f5dd34bc85f32e2dbf59549516deef3197fe4ad66d2a9968acb5ea48c2339
BLAKE2b-256 checksum
How to use checksums
b67ce9bd98449a8b3b9bd10dec5ddb42503040ac4b633da266b56cee5a608614
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Darwin/21.5.0

Security for glom-dict 0.0.2a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page