cawdrey


Namecawdrey JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttps://github.com/domdfcoding/cawdrey
SummarySeveral useful custom dictionaries for Python 📖 🐍
upload_time2023-11-22 15:32:13
maintainer
docs_urlNone
author
requires_python>=3.6
licenseLGPL-3.0-or-later
keywords counter dict dictionary frozen frozendict frozenordereddict immutable mapping mappingproxytype map orderedfrozendict
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
==========
Cawdrey
==========

.. start short_desc

**Several useful custom dictionaries for Python 📖 🐍**

.. end short_desc

.. start shields

.. list-table::
	:stub-columns: 1
	:widths: 10 90

	* - Docs
	  - |docs| |docs_check|
	* - Tests
	  - |actions_linux| |actions_windows| |actions_macos| |coveralls|
	* - PyPI
	  - |pypi-version| |supported-versions| |supported-implementations| |wheel|
	* - Anaconda
	  - |conda-version| |conda-platform|
	* - Activity
	  - |commits-latest| |commits-since| |maintained| |pypi-downloads|
	* - QA
	  - |codefactor| |actions_flake8| |actions_mypy|
	* - Other
	  - |license| |language| |requires|

.. |docs| image:: https://img.shields.io/readthedocs/cawdrey/latest?logo=read-the-docs
	:target: https://cawdrey.readthedocs.io/en/latest
	:alt: Documentation Build Status

.. |docs_check| image:: https://github.com/domdfcoding/cawdrey/workflows/Docs%20Check/badge.svg
	:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22Docs+Check%22
	:alt: Docs Check Status

.. |actions_linux| image:: https://github.com/domdfcoding/cawdrey/workflows/Linux/badge.svg
	:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22Linux%22
	:alt: Linux Test Status

.. |actions_windows| image:: https://github.com/domdfcoding/cawdrey/workflows/Windows/badge.svg
	:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22Windows%22
	:alt: Windows Test Status

.. |actions_macos| image:: https://github.com/domdfcoding/cawdrey/workflows/macOS/badge.svg
	:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22macOS%22
	:alt: macOS Test Status

.. |actions_flake8| image:: https://github.com/domdfcoding/cawdrey/workflows/Flake8/badge.svg
	:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22Flake8%22
	:alt: Flake8 Status

.. |actions_mypy| image:: https://github.com/domdfcoding/cawdrey/workflows/mypy/badge.svg
	:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22mypy%22
	:alt: mypy status

.. |requires| image:: https://dependency-dash.repo-helper.uk/github/domdfcoding/cawdrey/badge.svg
	:target: https://dependency-dash.repo-helper.uk/github/domdfcoding/cawdrey/
	:alt: Requirements Status

.. |coveralls| image:: https://img.shields.io/coveralls/github/domdfcoding/cawdrey/master?logo=coveralls
	:target: https://coveralls.io/github/domdfcoding/cawdrey?branch=master
	:alt: Coverage

.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/domdfcoding/cawdrey?logo=codefactor
	:target: https://www.codefactor.io/repository/github/domdfcoding/cawdrey
	:alt: CodeFactor Grade

.. |pypi-version| image:: https://img.shields.io/pypi/v/cawdrey
	:target: https://pypi.org/project/cawdrey/
	:alt: PyPI - Package Version

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/cawdrey?logo=python&logoColor=white
	:target: https://pypi.org/project/cawdrey/
	:alt: PyPI - Supported Python Versions

.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/cawdrey
	:target: https://pypi.org/project/cawdrey/
	:alt: PyPI - Supported Implementations

.. |wheel| image:: https://img.shields.io/pypi/wheel/cawdrey
	:target: https://pypi.org/project/cawdrey/
	:alt: PyPI - Wheel

.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/cawdrey?logo=anaconda
	:target: https://anaconda.org/domdfcoding/cawdrey
	:alt: Conda - Package Version

.. |conda-platform| image:: https://img.shields.io/conda/pn/domdfcoding/cawdrey?label=conda%7Cplatform
	:target: https://anaconda.org/domdfcoding/cawdrey
	:alt: Conda - Platform

.. |license| image:: https://img.shields.io/github/license/domdfcoding/cawdrey
	:target: https://github.com/domdfcoding/cawdrey/blob/master/LICENSE
	:alt: License

.. |language| image:: https://img.shields.io/github/languages/top/domdfcoding/cawdrey
	:alt: GitHub top language

.. |commits-since| image:: https://img.shields.io/github/commits-since/domdfcoding/cawdrey/v0.5.1
	:target: https://github.com/domdfcoding/cawdrey/pulse
	:alt: GitHub commits since tagged version

.. |commits-latest| image:: https://img.shields.io/github/last-commit/domdfcoding/cawdrey
	:target: https://github.com/domdfcoding/cawdrey/commit/master
	:alt: GitHub last commit

.. |maintained| image:: https://img.shields.io/maintenance/yes/2023
	:alt: Maintenance

.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/cawdrey
	:target: https://pypi.org/project/cawdrey/
	:alt: PyPI - Downloads

.. end shields

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:

.. code-block:: python

	{"foo.bar": "val"}

to this:

.. code-block:: python

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

check out `unflatten`_, `flattery`_ or `morph`_  to accomplish that.

.. _unflatten: https://github.com/dairiki/unflatten
.. _morph: https://github.com/metagriffin/morph
.. _flattery: https://github.com/acg/python-flattery


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

.. _indexed: https://github.com/niklasf/indexed.py

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**.

.. _python-benedict: https://github.com/fabiocaccamo/python-benedict

Installation
===========================

.. start installation

``Cawdrey`` can be installed from PyPI or Anaconda.

To install with ``pip``:

.. code-block:: bash

	$ python -m pip install cawdrey

To install with ``conda``:

	* First add the required channels

	.. code-block:: bash

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

	* Then install

	.. code-block:: bash

		$ conda install cawdrey

.. end installation



And Finally:
==============

`Why "Cawdrey"? <https://en.wikipedia.org/wiki/Robert_Cawdrey>`_

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/domdfcoding/cawdrey",
    "name": "cawdrey",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "Counter,dict,dictionary,frozen,frozendict,frozenordereddict,immutable,Mapping,MappingProxyType,map,orderedfrozendict",
    "author": "",
    "author_email": "Dominic Davis-Foster <dominic@davis-foster.co.uk>",
    "download_url": "https://files.pythonhosted.org/packages/1b/3c/5001f8120570f469a795414c51155677c0c75c6112932e70a96b8cad49cc/cawdrey-0.5.1.tar.gz",
    "platform": "Windows",
    "description": "\n==========\nCawdrey\n==========\n\n.. start short_desc\n\n**Several useful custom dictionaries for Python \ud83d\udcd6\u2002\ud83d\udc0d**\n\n.. end short_desc\n\n.. start shields\n\n.. list-table::\n\t:stub-columns: 1\n\t:widths: 10 90\n\n\t* - Docs\n\t  - |docs| |docs_check|\n\t* - Tests\n\t  - |actions_linux| |actions_windows| |actions_macos| |coveralls|\n\t* - PyPI\n\t  - |pypi-version| |supported-versions| |supported-implementations| |wheel|\n\t* - Anaconda\n\t  - |conda-version| |conda-platform|\n\t* - Activity\n\t  - |commits-latest| |commits-since| |maintained| |pypi-downloads|\n\t* - QA\n\t  - |codefactor| |actions_flake8| |actions_mypy|\n\t* - Other\n\t  - |license| |language| |requires|\n\n.. |docs| image:: https://img.shields.io/readthedocs/cawdrey/latest?logo=read-the-docs\n\t:target: https://cawdrey.readthedocs.io/en/latest\n\t:alt: Documentation Build Status\n\n.. |docs_check| image:: https://github.com/domdfcoding/cawdrey/workflows/Docs%20Check/badge.svg\n\t:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22Docs+Check%22\n\t:alt: Docs Check Status\n\n.. |actions_linux| image:: https://github.com/domdfcoding/cawdrey/workflows/Linux/badge.svg\n\t:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22Linux%22\n\t:alt: Linux Test Status\n\n.. |actions_windows| image:: https://github.com/domdfcoding/cawdrey/workflows/Windows/badge.svg\n\t:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22Windows%22\n\t:alt: Windows Test Status\n\n.. |actions_macos| image:: https://github.com/domdfcoding/cawdrey/workflows/macOS/badge.svg\n\t:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22macOS%22\n\t:alt: macOS Test Status\n\n.. |actions_flake8| image:: https://github.com/domdfcoding/cawdrey/workflows/Flake8/badge.svg\n\t:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22Flake8%22\n\t:alt: Flake8 Status\n\n.. |actions_mypy| image:: https://github.com/domdfcoding/cawdrey/workflows/mypy/badge.svg\n\t:target: https://github.com/domdfcoding/cawdrey/actions?query=workflow%3A%22mypy%22\n\t:alt: mypy status\n\n.. |requires| image:: https://dependency-dash.repo-helper.uk/github/domdfcoding/cawdrey/badge.svg\n\t:target: https://dependency-dash.repo-helper.uk/github/domdfcoding/cawdrey/\n\t:alt: Requirements Status\n\n.. |coveralls| image:: https://img.shields.io/coveralls/github/domdfcoding/cawdrey/master?logo=coveralls\n\t:target: https://coveralls.io/github/domdfcoding/cawdrey?branch=master\n\t:alt: Coverage\n\n.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/domdfcoding/cawdrey?logo=codefactor\n\t:target: https://www.codefactor.io/repository/github/domdfcoding/cawdrey\n\t:alt: CodeFactor Grade\n\n.. |pypi-version| image:: https://img.shields.io/pypi/v/cawdrey\n\t:target: https://pypi.org/project/cawdrey/\n\t:alt: PyPI - Package Version\n\n.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/cawdrey?logo=python&logoColor=white\n\t:target: https://pypi.org/project/cawdrey/\n\t:alt: PyPI - Supported Python Versions\n\n.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/cawdrey\n\t:target: https://pypi.org/project/cawdrey/\n\t:alt: PyPI - Supported Implementations\n\n.. |wheel| image:: https://img.shields.io/pypi/wheel/cawdrey\n\t:target: https://pypi.org/project/cawdrey/\n\t:alt: PyPI - Wheel\n\n.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/cawdrey?logo=anaconda\n\t:target: https://anaconda.org/domdfcoding/cawdrey\n\t:alt: Conda - Package Version\n\n.. |conda-platform| image:: https://img.shields.io/conda/pn/domdfcoding/cawdrey?label=conda%7Cplatform\n\t:target: https://anaconda.org/domdfcoding/cawdrey\n\t:alt: Conda - Platform\n\n.. |license| image:: https://img.shields.io/github/license/domdfcoding/cawdrey\n\t:target: https://github.com/domdfcoding/cawdrey/blob/master/LICENSE\n\t:alt: License\n\n.. |language| image:: https://img.shields.io/github/languages/top/domdfcoding/cawdrey\n\t:alt: GitHub top language\n\n.. |commits-since| image:: https://img.shields.io/github/commits-since/domdfcoding/cawdrey/v0.5.1\n\t:target: https://github.com/domdfcoding/cawdrey/pulse\n\t:alt: GitHub commits since tagged version\n\n.. |commits-latest| image:: https://img.shields.io/github/last-commit/domdfcoding/cawdrey\n\t:target: https://github.com/domdfcoding/cawdrey/commit/master\n\t:alt: GitHub last commit\n\n.. |maintained| image:: https://img.shields.io/maintenance/yes/2023\n\t:alt: Maintenance\n\n.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/cawdrey\n\t:target: https://pypi.org/project/cawdrey/\n\t:alt: PyPI - Downloads\n\n.. end shields\n\nContents\n=============\n\n* ``frozendict``: An immutable dictionary that cannot be changed after creation.\n* ``FrozenOrderedDict``: An immutable ``OrderedDict`` where the order of keys is preserved, but that cannot be changed after creation.\n* ``AlphaDict``: A ``FrozenOrderedDict`` where the keys are stored in alphabetical order.\n* ``bdict``: A dictionary where ``key, value`` pairs are stored both ways round.\n\nThis package also provides two base classes for creating your own custom dictionaries:\n\n* ``FrozenBase``: An Abstract Base Class for Frozen dictionaries.\n\n* ``MutableBase``: An Abstract Base Class for mutable dictionaries.\n\n|\n\nOther Dictionary Packages\n===========================\n\nIf you're looking to unflatten a dictionary, such as to go from this:\n\n.. code-block:: python\n\n\t{\"foo.bar\": \"val\"}\n\nto this:\n\n.. code-block:: python\n\n\t{\"foo\": {\"bar\": \"val\"}}\n\ncheck out `unflatten`_, `flattery`_ or `morph`_  to accomplish that.\n\n.. _unflatten: https://github.com/dairiki/unflatten\n.. _morph: https://github.com/metagriffin/morph\n.. _flattery: https://github.com/acg/python-flattery\n\n\n`indexed`_ provides an OrderedDict where the values can be accessed by their index as well as by their keys.\n\n.. _indexed: https://github.com/niklasf/indexed.py\n\nThere'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**.\n\n.. _python-benedict: https://github.com/fabiocaccamo/python-benedict\n\nInstallation\n===========================\n\n.. start installation\n\n``Cawdrey`` can be installed from PyPI or Anaconda.\n\nTo install with ``pip``:\n\n.. code-block:: bash\n\n\t$ python -m pip install cawdrey\n\nTo install with ``conda``:\n\n\t* First add the required channels\n\n\t.. code-block:: bash\n\n\t\t$ conda config --add channels https://conda.anaconda.org/conda-forge\n\t\t$ conda config --add channels https://conda.anaconda.org/domdfcoding\n\n\t* Then install\n\n\t.. code-block:: bash\n\n\t\t$ conda install cawdrey\n\n.. end installation\n\n\n\nAnd Finally:\n==============\n\n`Why \"Cawdrey\"? <https://en.wikipedia.org/wiki/Robert_Cawdrey>`_\n",
    "bugtrack_url": null,
    "license": "LGPL-3.0-or-later",
    "summary": "Several useful custom dictionaries for Python \ud83d\udcd6\u2002\ud83d\udc0d",
    "version": "0.5.1",
    "project_urls": {
        "Documentation": "https://cawdrey.readthedocs.io/en/latest",
        "Homepage": "https://github.com/domdfcoding/cawdrey",
        "Issue Tracker": "https://github.com/domdfcoding/cawdrey/issues",
        "Source Code": "https://github.com/domdfcoding/cawdrey"
    },
    "split_keywords": [
        "counter",
        "dict",
        "dictionary",
        "frozen",
        "frozendict",
        "frozenordereddict",
        "immutable",
        "mapping",
        "mappingproxytype",
        "map",
        "orderedfrozendict"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69b2ed71fe821087d9eb1ed7aac99677fa544b10b83ae395994e908140d06ab3",
                "md5": "14908298115f0f19194a448db41e8920",
                "sha256": "fd1406e80b84cd851d95d3f857685c2e76f7f0429154f18dff264998743d5456"
            },
            "downloads": -1,
            "filename": "cawdrey-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "14908298115f0f19194a448db41e8920",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 61634,
            "upload_time": "2023-11-22T15:32:12",
            "upload_time_iso_8601": "2023-11-22T15:32:12.643791Z",
            "url": "https://files.pythonhosted.org/packages/69/b2/ed71fe821087d9eb1ed7aac99677fa544b10b83ae395994e908140d06ab3/cawdrey-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b3c5001f8120570f469a795414c51155677c0c75c6112932e70a96b8cad49cc",
                "md5": "902c20ba80c5140cf7970b28cc1b0949",
                "sha256": "1878ce4ea83328c7567caaf244d2bfac78aa85e78ce04113451a43ae474dbe8e"
            },
            "downloads": -1,
            "filename": "cawdrey-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "902c20ba80c5140cf7970b28cc1b0949",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 15767,
            "upload_time": "2023-11-22T15:32:13",
            "upload_time_iso_8601": "2023-11-22T15:32:13.839948Z",
            "url": "https://files.pythonhosted.org/packages/1b/3c/5001f8120570f469a795414c51155677c0c75c6112932e70a96b8cad49cc/cawdrey-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-22 15:32:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "domdfcoding",
    "github_project": "cawdrey",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "cawdrey"
}
        
Elapsed time: 0.16078s