Skip to main content

Dictionary utilities (DotDict, safe_merge) for the SciTeX ecosystem

Project description

scitex-dict

Dictionary utilities for the SciTeX ecosystem.

Features

  • DotDict -- Dot-access dictionary with recursive nesting, JSON serialization, and full dict protocol
  • 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

scitex_dict-0.1.1.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

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

scitex_dict-0.1.1-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file scitex_dict-0.1.1.tar.gz.

File metadata

  • Download URL: scitex_dict-0.1.1.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_dict-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b746baf6755b4a44aa48fcf482affa8d53a997a68fe67ed65f4725ff49bb8e50
MD5 4ec58675c0a44390c534e3c9cb31137d
BLAKE2b-256 4078d6125ca0bca65386f11d558e0d3760bb1ac6817cab819ad0f467082d2b14

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_dict-0.1.1.tar.gz:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-dict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scitex_dict-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: scitex_dict-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_dict-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8000bf2032070b5f355ea8ed5a4b4a9ae48bbf99b683f889082625172b9c65c9
MD5 a5ed27181f074f8ad359dc63e3cd5c5f
BLAKE2b-256 5b5d5a4fd1ac4ca9a36e159ee1890ad205df15ba105ebc2eb1ded532082ca837

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_dict-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-dict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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