Skip to main content

Several useful custom dictionaries for Python 📖 🐍

Project description

Several useful custom dictionaries for Python 📖 🐍

Docs

Documentation Status Docs Check Status

Tests

Travis Build Status Windows Tests Status macOS Tests Status Coverage CodeFactor Grade

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

Other

License GitHub top language Requirements Status pre-commit

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 OrederedDict 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 http://conda.anaconda.org/domdfcoding
$ conda config --add channels http://conda.anaconda.org/conda-forge
  • Then install

$ conda install cawdrey

And Finally:

Why “Cawdrey”?

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

cawdrey-0.1.7.tar.gz (13.0 kB view hashes)

Uploaded Source

Built Distribution

cawdrey-0.1.7-py3-none-any.whl (18.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page