Several useful custom dictionaries for Python 📖 🐍
Project description
Several useful custom dictionaries for Python 📖 🐍
Docs |
|
---|---|
Tests |
|
PyPI |
|
Anaconda |
|
Activity |
|
QA |
|
Other |
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:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cawdrey-0.5.1.tar.gz
.
File metadata
- Download URL: cawdrey-0.5.1.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1878ce4ea83328c7567caaf244d2bfac78aa85e78ce04113451a43ae474dbe8e |
|
MD5 | 902c20ba80c5140cf7970b28cc1b0949 |
|
BLAKE2b-256 | 1b3c5001f8120570f469a795414c51155677c0c75c6112932e70a96b8cad49cc |
File details
Details for the file cawdrey-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: cawdrey-0.5.1-py3-none-any.whl
- Upload date:
- Size: 61.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd1406e80b84cd851d95d3f857685c2e76f7f0429154f18dff264998743d5456 |
|
MD5 | 14908298115f0f19194a448db41e8920 |
|
BLAKE2b-256 | 69b2ed71fe821087d9eb1ed7aac99677fa544b10b83ae395994e908140d06ab3 |