Dictionary utilities (DotDict, safe_merge) for the SciTeX ecosystem
Project description
scitex-dict
Dictionary utilities for the SciTeX ecosystem.
Interfaces: Python ⭐⭐⭐ (primary) · CLI — · MCP — · Skills ⭐ · Hook — · HTTP —
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | YAML config access ergonomics -- CONFIG["MODEL"]["hidden_size"] vs CONFIG.MODEL.hidden_size matters in a notebook |
DotDict -- attribute-access dict subclass with recursive .x.y.z; works as a drop-in for the umpteen competing alternatives (addict, easydict, box, dotmap) |
| 2 | Merging configs silently overwrites -- {**a, **b} on duplicate keys loses information |
safe_merge -- duplicate keys raise; flatten turns nested dicts into dotted-key single-level for logging/CSV |
Features
- DotDict -- Dot-access dictionary with recursive nesting, JSON serialization, and full
dictprotocol - safe_merge -- Merge multiple dicts with overlap detection
- flatten -- Flatten nested dicts into single-level with separator keys
- listed_dict --
defaultdict(list)factory with optional pre-initialized keys - pop_keys -- Remove specified keys from a key list
- replace -- Bulk string replacement using a mapping dict
- to_str -- Convert a dict to a compact string representation
Installation
pip install scitex-dict
Usage
from scitex_dict import DotDict, safe_merge
cfg = DotDict({"model": {"lr": 0.001, "epochs": 100}})
print(cfg.model.lr) # 0.001
merged = safe_merge({"a": 1}, {"b": 2})
# {"a": 1, "b": 2}
License
AGPL-3.0. See LICENSE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scitex_dict-0.1.2.tar.gz.
File metadata
- Download URL: scitex_dict-0.1.2.tar.gz
- Upload date:
- Size: 35.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35a0ba457c8c7e90f5517eda66c3cebe2c7e3cea4e8574cad73d7257657c5d61
|
|
| MD5 |
d0c02adc4d30696a8f726d13d0381dbf
|
|
| BLAKE2b-256 |
5cbaac6d758d1a1c738923312fcc6585cbba5ecb62d2c6ab1d8760a174abeb1a
|
Provenance
The following attestation bundles were made for scitex_dict-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-dict
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_dict-0.1.2.tar.gz -
Subject digest:
35a0ba457c8c7e90f5517eda66c3cebe2c7e3cea4e8574cad73d7257657c5d61 - Sigstore transparency entry: 1367140452
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-dict@5e3be1feb0d273c53d21e9ff596858829d76f18f -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5e3be1feb0d273c53d21e9ff596858829d76f18f -
Trigger Event:
push
-
Statement type:
File details
Details for the file scitex_dict-0.1.2-py3-none-any.whl.
File metadata
- Download URL: scitex_dict-0.1.2-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55de7882858870ec20598c486c08ef775e56498506ef116ecbd1a0bfc4156113
|
|
| MD5 |
0a765c63237afb8a47ae235a3d87a423
|
|
| BLAKE2b-256 |
be0c1ebeaa7b9bfb40f9a760bde757298eb89ae4f013b2fe958f8220c30e9ffe
|
Provenance
The following attestation bundles were made for scitex_dict-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-dict
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_dict-0.1.2-py3-none-any.whl -
Subject digest:
55de7882858870ec20598c486c08ef775e56498506ef116ecbd1a0bfc4156113 - Sigstore transparency entry: 1367140485
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-dict@5e3be1feb0d273c53d21e9ff596858829d76f18f -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5e3be1feb0d273c53d21e9ff596858829d76f18f -
Trigger Event:
push
-
Statement type: