Skip to main content

Several useful custom dictionaries for Python 📖 🐍

Docs

Documentation Build Status Docs Check Status

Tests

Linux Test Status Windows Test Status macOS Test Status Coverage

PyPI

PyPI - Package Version PyPI - Supported Python Versions PyPI - Supported Implementations PyPI - Wheel

Anaconda

Conda - Package Version Conda - Platform

Activity

GitHub last commit GitHub commits since tagged version Maintenance PyPI - Downloads

QA

CodeFactor Grade Flake8 Status mypy status

Other

License GitHub top language Requirements Status

Contents

  • frozendict: An immutable dictionary that cannot be changed after creation.

  • FrozenOrderedDict: An immutable OrderedDict where the order of keys is preserved, but that cannot be changed after creation.

  • AlphaDict: A FrozenOrderedDict where the keys are stored in alphabetical order.

  • bdict: A dictionary where key, value pairs are stored both ways round.

This package also provides two base classes for creating your own custom dictionaries:

  • FrozenBase: An Abstract Base Class for Frozen dictionaries.

  • MutableBase: An Abstract Base Class for mutable dictionaries.


Other Dictionary Packages

If you’re looking to unflatten a dictionary, such as to go from this:

{"foo.bar": "val"}

to this:

{"foo": {"bar": "val"}}

check out unflatten, flattery or morph to accomplish that.

indexed provides an OrderedDict where the values can be accessed by their index as well as by their keys.

There’s also python-benedict, which provides a custom dictionary with keylist/keypath support, I/O shortcuts (Base64, CSV, JSON, TOML, XML, YAML, pickle, query-string) and many utilities.

Installation

Cawdrey can be installed from PyPI or Anaconda.

To install with pip:

$ python -m pip install cawdrey

To install with conda:

  • First add the required channels

$ conda config --add channels https://conda.anaconda.org/conda-forge
$ conda config --add channels https://conda.anaconda.org/domdfcoding
  • Then install

$ conda install cawdrey

And Finally:

Why “Cawdrey”?

Metadata

Release files for cawdrey 0.5.1

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

Source distribution (sdist)

Source distribution for cawdrey 0.5.1
File Size Uploaded
cawdrey-0.5.1.tar.gz 15.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cawdrey 0.5.1
File Interpreter ABI Platform
cawdrey-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 77.4 kB

Release files / cawdrey-0.5.1.tar.gz

Download URL cawdrey-0.5.1.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1878ce4ea83328c7567caaf244d2bfac78aa85e78ce04113451a43ae474dbe8e
BLAKE2b-256 checksum
How to use checksums
1b3c5001f8120570f469a795414c51155677c0c75c6112932e70a96b8cad49cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / cawdrey-0.5.1-py3-none-any.whl

Download URL cawdrey-0.5.1-py3-none-any.whl
Size 61.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd1406e80b84cd851d95d3f857685c2e76f7f0429154f18dff264998743d5456
BLAKE2b-256 checksum
How to use checksums
69b2ed71fe821087d9eb1ed7aac99677fa544b10b83ae395994e908140d06ab3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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