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.0.tar.gz (33.0 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.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_dict-0.1.0.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for scitex_dict-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5f935bc06dca17032db65c9cd882d3d69e205a9d17b8ae9faec23ebb1c39a7e9
MD5 a63113accc258d2082fcd11777d2b942
BLAKE2b-256 229cfc278effd31062e6c593e1f767bba4d9c27eae7429e837675e8468ce0d08

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scitex_dict-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for scitex_dict-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c104a96a1a3c40e15a6b1ec657556161917a2cd296655415ef9a1fbaef50c733
MD5 53a22ee6a8ade100947a38061bd5e026
BLAKE2b-256 36fabdccde5b5a24c8ab1045774aa41fc96777ec2a6f0fa3be15f8c962f23365

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