{ "info": { "author": "Shenggao Zhu", "author_email": "zshgao@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "MIDict (Multi-Index Dict)\n=========================\n\n.. image:: https://img.shields.io/pypi/l/midict.svg\n :alt: License\n :target: ./LICENSE\n\n.. image:: https://img.shields.io/pypi/v/midict.svg\n :target: https://pypi.python.org/pypi/midict\n :alt: PyPI Release\n\n.. image:: https://img.shields.io/pypi/pyversions/midict.svg\n :target: https://pypi.python.org/pypi/midict\n :alt: Supported Python versions\n\n.. .. image:: https://img.shields.io/pypi/dm/midict.svg\n :target: https://pypi.python.org/pypi/midict\n :alt: PyPI Downloads\n\n.. image:: https://readthedocs.org/projects/midict/badge/?version=latest\n :target: https://midict.readthedocs.org/\n :alt: Documentation\n\n.. image:: https://travis-ci.org/ShenggaoZhu/midict.svg?branch=master\n :target: https://travis-ci.org/ShenggaoZhu/midict\n :alt: Travis Build Status\n\n.. image:: https://coveralls.io/repos/github/ShenggaoZhu/midict/badge.svg?branch=master\n :target: https://coveralls.io/github/ShenggaoZhu/midict?branch=master\n :alt: Test coverage\n\n\n.. image:: https://api.codacy.com/project/badge/Grade/206345cabe8f44598c3632fb0a553eb1\n :target: https://www.codacy.com/app/zshgao/midict\n :alt: Code quality\n\n\n\n``MIDict`` is an ordered \"dictionary\" with multiple indices\nwhere any index can serve as \"keys\" or \"values\",\ncapable of assessing multiple values via its powerful indexing syntax,\nand suitable as a bidirectional/inverse dict (a drop-in replacement\nfor dict/OrderedDict in Python 2 & 3).\n\n\n\n\nFeatures\n--------\n\n* Multiple indices\n* Multi-value indexing syntax\n* Convenient indexing shortcuts\n* Bidirectional/inverse dict\n* Compatible with normal dict in Python 2 & 3\n* Accessing keys via attributes\n* Extended methods for multi-indices\n* Additional APIs to handle indices\n* Duplicate keys/values handling\n\n\nQuickstart\n----------\n\n+---------+---------+---------+\n| name | uid | ip |\n+=========+=========+=========+\n| jack | 1 | 192.1 |\n+---------+---------+---------+\n| tony | 2 | 192.2 |\n+---------+---------+---------+\n\nThe above table-like data set (with multiple columns/indices) can be represented using a ``MIDict``:\n\n.. code-block:: python\n\n user = MIDict([['jack', 1, '192.1'], # list of items (rows of data)\n ['tony', 2, '192.2']],\n ['name', 'uid', 'ip']) # a list of index names\n\nAccess a key and get a value or a list of values (similar to a normal ``dict``):\n\n.. code-block:: python\n\n user['jack'] == [1, '192.1']\n\nAny index (column) can be used as the \"keys\" or \"values\" via the advanced\n\"multi-indexing\" syntax ``d[index_key:key, index_value]``.\nBoth ``index_key`` and ``index_value`` can be a normal index name\nor an ``int`` (the order the index), and ``index_value`` can also be a\n``tuple``, ``list`` or ``slice`` object to specify multiple values, e.g.:\n\n.. code-block:: python\n\n user['name':'jack', 'uid'] == 1\n user['ip':'192.1', 'name'] == 'jack'\n\n user['name':'jack', ('uid', 'ip')] == [1, '192.1']\n user[0:'jack', [1, 2]] == [1, '192.1']\n user['name':'jack', 'uid':] == [1, '192.1']\n\nThe \"multi-indexing\" syntax also has convenient shortcuts:\n\n.. code-block:: python\n\n user['jack'] == [1, '192.1']\n user[:'192.1'] == ['jack', 1]\n user['jack', :] == ['jack', 1, '192.1']\n\nA ``MIDict`` with 2 indices can be used as a bidirectional/inverse dict:\n\n.. code-block:: python\n\n mi_dict = MIDict(jack=1, tony=2)\n\n mi_dict['jack'] == 1 # forward indexing: d[key] -> value\n mi_dict[:1] == 'jack' # backward/inverse indexing: d[:value] -> key\n\n\n\nDocumentation\n-------------\n\nSee https://midict.readthedocs.io\n\n\nInstallation\n------------\n\n``pip install midict``\n\nPyPI repository: https://pypi.python.org/pypi/midict\n\nDevelopment\n-----------\n\nSource code: https://github.com/ShenggaoZhu/midict\n\nReport issues: https://github.com/ShenggaoZhu/midict/issues/new\n\nTesting\n^^^^^^^\n\n``python tests/tests.py``\n\nTested with both Python 2.7 and Python 3,3, 3.4, 3.5.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ShenggaoZhu/midict", "keywords": "dict,dictionary,mapping,bidirectional,bijective,two-way,double,inverse,reverse,multiple,index,multiple indices,multiple values,multiple keys,MIMapping,MIDict,FrozenMIDict,AttrDict,IndexDict,multi-indexing syntax", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "midict", "package_url": "https://pypi.org/project/midict/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/midict/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ShenggaoZhu/midict" }, "release_url": "https://pypi.org/project/midict/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "MIDict (Multi-Index Dict) can be indexed by any \"keys\" or \"values\", suitable as a bidirectional/inverse dict or a multi-key/multi-value dict (a drop-in replacement for dict in Python 2 & 3).", "version": "0.1.4" }, "last_serial": 2121872, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a54d716526b2f99689d518639d009e45", "sha256": "ee44bf76bc27f9086bef2a3957d2b64d748d723a74061dee7b138dad37e8d083" }, "downloads": -1, "filename": "midict-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a54d716526b2f99689d518639d009e45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15976, "upload_time": "2016-05-16T15:17:07", "url": "https://files.pythonhosted.org/packages/1a/51/f7c845a6d17f7f892ef6f24f924e75f89ff60cd9aac5a42f276be5c1ec6f/midict-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "04be659a6b5834df6f20545cd6e45fd3", "sha256": "6d246def5d1ea46439ea8acc29eb86900bdcbcd14917609c8385ce29140dcd8d" }, "downloads": -1, "filename": "midict-0.1.1.tar.gz", "has_sig": false, "md5_digest": "04be659a6b5834df6f20545cd6e45fd3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16413, "upload_time": "2016-05-17T07:38:14", "url": "https://files.pythonhosted.org/packages/9d/15/14116d417d97b3c97dd708f1a6a529ac44c5af9345c9ebdf4145a65da9c1/midict-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "57728c062fd548039ec428df4d2b9a4b", "sha256": "1d825bbeedfc582bbc6f2e390146b7ff0ae46e6e56bec81f6ae0a210bdb9802b" }, "downloads": -1, "filename": "midict-0.1.2.tar.gz", "has_sig": false, "md5_digest": "57728c062fd548039ec428df4d2b9a4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16395, "upload_time": "2016-05-18T04:08:18", "url": "https://files.pythonhosted.org/packages/43/c2/8a0c4ea02c6724401b1db6a9f06930ea11ea7639d66f485842abc644c74b/midict-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "c116ae7f3ada492a9fde5059511166ce", "sha256": "6c3c4573a15a61096405dd221dea8c08bf11a03f2b71ce9862062cbf5775b74a" }, "downloads": -1, "filename": "midict-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c116ae7f3ada492a9fde5059511166ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16437, "upload_time": "2016-05-18T09:44:47", "url": "https://files.pythonhosted.org/packages/c8/c2/2bb15a53a31b66f4f50b8d30c2cc3eeb10f84382a10539053d61c07932b7/midict-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f19dc249fda538739b61d1dabaf7b17b", "sha256": "27cdb3116f1fcd8e5291d62ecea5c6de319e5db3d726e93de5c8f00aa172645c" }, "downloads": -1, "filename": "midict-0.1.4.tar.gz", "has_sig": false, "md5_digest": "f19dc249fda538739b61d1dabaf7b17b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16446, "upload_time": "2016-05-18T14:28:48", "url": "https://files.pythonhosted.org/packages/30/6b/d697c05b33da2b8b8330914021c0bedb75a3591839d36b9b912d30c812c0/midict-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f19dc249fda538739b61d1dabaf7b17b", "sha256": "27cdb3116f1fcd8e5291d62ecea5c6de319e5db3d726e93de5c8f00aa172645c" }, "downloads": -1, "filename": "midict-0.1.4.tar.gz", "has_sig": false, "md5_digest": "f19dc249fda538739b61d1dabaf7b17b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16446, "upload_time": "2016-05-18T14:28:48", "url": "https://files.pythonhosted.org/packages/30/6b/d697c05b33da2b8b8330914021c0bedb75a3591839d36b9b912d30c812c0/midict-0.1.4.tar.gz" } ] }