Skip to main content

scitex-dict

SciTeX

Dictionary utilities — DotDict, safe_merge, flatten, listed_dict, replace.

Full Documentation · uv pip install scitex-dict[all]

PyPI Python Tests Coverage Docs License: AGPL v3


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

Installation

pip install scitex-dict

Architecture

scitex-dict/
├── src/scitex_dict/
│   ├── _DotDict.py        # attribute-access dict subclass
│   ├── _safe_merge.py     # raises on duplicate keys
│   ├── _flatten.py        # nested → dotted-key
│   └── _listed_dict.py    # default-list dict factory
└── tests/

1 Interfaces

Python API
from scitex_dict import (
    DotDict, flatten, listed_dict, pop_keys,
    replace, safe_merge, to_str,
)

cfg = DotDict({"model": {"lr": 0.001}})
cfg.model.lr                              # 0.001

safe_merge({"a": 1}, {"b": 2})

flatten({"x": {"y": 1, "z": [10, 20]}})   # {"x_y": 1, "x_z_0": 10, ...}

d = listed_dict(["a", "b"])

replace("hello world", {"hello": "hi"})   # "hi world"

to_str({"a": 1, "b": 2})

Demo

flowchart LR
    YAML[YAML config] --> DD[DotDict]
    DD -->|cfg.model.lr| Code[Your code]
    A[dict A] --> SM[safe_merge]
    B[dict B] --> SM
    SM --> Merged[merged dict]

Quick Start

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})

Part of SciTeX

scitex-dict is part of SciTeX. Install via the umbrella with pip install scitex[dict] to use as scitex.dict (Python) or scitex dict ... (CLI).

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.

License

AGPL-3.0. See LICENSE.


SciTeX

Metadata

Release files for scitex-dict 0.1.8

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

Source distribution (sdist)

Source distribution for scitex-dict 0.1.8
File Size Uploaded Provenance
scitex_dict-0.1.8.tar.gz 8.6 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scitex-dict 0.1.8
File Interpreter ABI Platform
scitex_dict-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 MB

Release files / scitex_dict-0.1.8.tar.gz

Download URL scitex_dict-0.1.8.tar.gz
Size 8.6 MB
Tags Source
SHA-256 checksum
How to use checksums
8070007beb108bcff20c729172c8812fd9e989d978e1908181975fd307f48db2
BLAKE2b-256 checksum
How to use checksums
5840b38db0c0395e802b23d44b1789b29ca074f474e454b4344e5fa0efa4cafe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / scitex_dict-0.1.8-py3-none-any.whl

Download URL scitex_dict-0.1.8-py3-none-any.whl
Size 8.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3768cedb11f4b5ce809de152fce96b1a56caa8cb4a41441b5760ee0ec8b782c3
BLAKE2b-256 checksum
How to use checksums
6bb4bd56a1020561b1e8f2ad0f543a4d7c547a5b437bc88284fb3798d7aedbd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Security for scitex-dict 0.1.8

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scitex_dict-0.1.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

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.

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