{ "info": { "author": "Tai Sakuma", "author_email": "tai.sakuma@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "[![PyPI version](https://badge.fury.io/py/atdict.svg)](https://badge.fury.io/py/atdict) [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.2576006.svg)](https://doi.org/10.5281/zenodo.2576006) [![Build Status](https://travis-ci.org/alphatwirl/atdict.svg?branch=master)](https://travis-ci.org/alphatwirl/atdict) [![codecov](https://codecov.io/gh/alphatwirl/atdict/branch/master/graph/badge.svg)](https://codecov.io/gh/alphatwirl/atdict)\n\n# atdict\n\nAn attribute-access ordered dictionary\n\n*****\n\n_atdict_ is an attribute-access ordered dictionary. You can use a key\nname as an attribute to access the value of the dictionary for a key,\nfor example, `o.key_name` rather than `o['key_name']`. Only a minimum\nset of methods are implemented so as to minimize the chances of name\nconflicts.\n\n_atdict_ was originally developed in 2017 as the class\n[`Object`](https://github.com/alphatwirl/scribblers/blob/v0.10.0/scribblers/obj.py),\nin [_scribblers_](https://github.com/alphatwirl/scribblers), which\nrepresented _event objects_ in\n[_alphatwirl_](https://github.com/alphatwirl/alphatwirl). It was\nreleased as an independent package in 2019 as _atdict_.\n\n*****\n\n- [**Requirement**](#requirement)\n- [**Install**](#install)\n- [**How to use**](#how-to-use)\n - [Import atdict](#import-atdict)\n - [Initialize atdict](#initialize-atdict)\n - [Access to a value](#access-to-a-value)\n - [Modify a value](#modify-a-value)\n - [Add a key](#add-a-key)\n - [Delete a key](#delete-a-key)\n - [Copy and deepcopy](#copy-and-deepcopy)\n - [Pickle](#pickle)\n- [**License**](#license)\n- [**Contact**](#contact)\n\n*****\n\n## Requirement\n\n- Python 2.7, 3.6, or 3.7\n\n*****\n\n## Install\n\nYou can install with `pip`.\n\n```bash\n$ pip install -U atdict\n```\n\n*****\n\n## How to use\n\n### Import atdict\n\nImport `atdict` from the package `atdict`.\n\n```python\nfrom atdict import atdict\n```\n\n### Initialize atdict\n\nYou can initialize an `atdict` with any arguments that can initialize\n[`collections.OrderedDict`](https://docs.python.org/3/library/collections.html#ordereddict-objects).\n\nFor example:\n```python\no1 = atdict([('foo', 40), ('bar', 'ham')])\nprint(o1)\n```\n\nIt will print.\n\n```python\natdict(foo=40, bar='ham')\n```\n\nAn `atdict` can be also initialized with another `atdict`.\n\n```\no2 = atdict(o1)\nprint(o2)\n```\n\nThe `o2` is initialized with a (shallow) copy of the contents of `o1`.\n\n```\natdict(foo=40, bar='ham')\n```\n\n### Access to a value\n\nYon can use a key name as an attribute of `atdict`.\n\n```python\nprint(o1.foo)\n```\n\nThis will print the value for the key `foo`, which is `40`.\n\n```\n40\n```\n\n### Modify a value\n\nTo modify a value, you can assign a new value to the attribute.\n\n```python\no1.foo = 50\nprint(o1)\n```\n\n```\natdict(foo=50, bar='ham')\n```\n\nThe value for the key `foo` changed from `40` to `50`.\n\n### Add a key\n\nTo add a key, you can also assign a value to the attribute\n\n```python\no1.baz = 'eggs'\nprint(o1)\n```\n\n```\natdict(foo=50, bar='ham', baz='eggs')\n```\n\n### Delete a key\n\n`del` deletes a key.\n\n```python\ndel o1.bar\nprint(o1)\n```\n\n```\natdict(foo=50, baz='eggs')\n```\n\n### Copy and deepcopy\n\nA copy will be created if `atdict` is initialized with another\n`atdict`. However, this will be a _shallow_ copy.\n\n```python\nl = [1, 2]\no1 = atdict([('foo', l)])\no2 = atdict(o1)\nprint(o2.foo is o1.foo)\n```\n\n```\nTrue\n```\n\nTo make a _deep_ copy, you can use `copy.deepcopy()`.\n\n```python\nimport copy\nl = [1, 2]\no1 = atdict([('foo', l)])\no2 = copy.deepcopy(o1)\nprint(o2)\n```\n\n```\natdict(foo=[1, 2])\n```\n\n`o2.foo` and `o1.foo` are not the same object.\n\n```python\nprint(o2.foo is o1.foo)\n```\n\n```\nFalse\n```\n\n### Pickle\n\nAn `atdict` is picklable as long as all values are picklable.\n\n```python\nimport pickle\no1 = atdict([('foo', 40), ('bar', 'ham')])\np1 = pickle.dumps(o1)\no2 = pickle.loads(p1)\nprint(o2)\n```\n\n```\natdict(foo=40, bar='ham')\n```\n\n\n*****\n\n## License\n\n- atdict is licensed under the BSD license.\n\n*****\n\n## Contact\n\n- Tai Sakuma - tai.sakuma@gmail.com\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alphatwirl/atdict", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "atdict", "package_url": "https://pypi.org/project/atdict/", "platform": "", "project_url": "https://pypi.org/project/atdict/", "project_urls": { "Homepage": "https://github.com/alphatwirl/atdict" }, "release_url": "https://pypi.org/project/atdict/0.9.3/", "requires_dist": null, "requires_python": "", "summary": "Attribute-access ordered dictionary", "version": "0.9.3" }, "last_serial": 4922189, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "5ccc5ae55446a5aab3ee7ddd1f20c970", "sha256": "556c3cdbc09a4919506b2c8cc4cdc3ec748fcae1ceb2b420f4787cd86e0277a5" }, "downloads": -1, "filename": "atdict-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5ccc5ae55446a5aab3ee7ddd1f20c970", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3819, "upload_time": "2019-02-23T10:59:55", "url": "https://files.pythonhosted.org/packages/fd/a1/9247d9553de61d9a3f878c4660964c226d78ec9ab0c2e898387b43a80618/atdict-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7f08c2a345fe4cc06c75f4d43ae73d8", "sha256": "d6749b6e299622d00ea32e64a55dc6fda135775b951716801c9b15c9afa09fd0" }, "downloads": -1, "filename": "atdict-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d7f08c2a345fe4cc06c75f4d43ae73d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18005, "upload_time": "2019-02-23T10:59:57", "url": "https://files.pythonhosted.org/packages/f3/48/0ebbaff54d6aae4b5fffdf81a3cc169218042d0d05521766631b17cf574a/atdict-0.1.1.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "21ba3584c02d74c6bb8a4ddfcc4875ef", "sha256": "89e3a1988dc4453c81ebb0c5e3cc5ee1e4cf715b1d32d7a414c9ac91ae53be93" }, "downloads": -1, "filename": "atdict-0.9.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "21ba3584c02d74c6bb8a4ddfcc4875ef", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5181, "upload_time": "2019-02-23T15:18:27", "url": "https://files.pythonhosted.org/packages/f7/da/680f4c34a1a63ddf56ee13678759006a20fee5344830544c57847556635f/atdict-0.9.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd09a887c42cb1dad2105e3c5d950897", "sha256": "543c954786d74c96ebf49b57525d8f26118782ddcdaf729d8a85dedbb5704e45" }, "downloads": -1, "filename": "atdict-0.9.0.tar.gz", "has_sig": false, "md5_digest": "bd09a887c42cb1dad2105e3c5d950897", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19833, "upload_time": "2019-02-23T15:18:28", "url": "https://files.pythonhosted.org/packages/0b/4b/c53bb6e68360c715e4b79337b3231bcfc2b7b5782e00d59ff4eba1160aaf/atdict-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "1685003616f13d65c7e14acc99fbaa3f", "sha256": "591fe5329078767ec9d7492d39a09886792334b7a6afec913a494386448e4a6f" }, "downloads": -1, "filename": "atdict-0.9.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1685003616f13d65c7e14acc99fbaa3f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5175, "upload_time": "2019-02-23T15:59:31", "url": "https://files.pythonhosted.org/packages/b0/8d/0f3db209f2b10ad5d0bb3eaf71c4e7fce9d4921fea81d4d31acbb3762dec/atdict-0.9.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5f95281fd16795917645700b7c526b1e", "sha256": "61a298fb0bb7561249d96b3a1df4d73767fc734044a0aa828890014101ef3e0d" }, "downloads": -1, "filename": "atdict-0.9.1.tar.gz", "has_sig": false, "md5_digest": "5f95281fd16795917645700b7c526b1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19840, "upload_time": "2019-02-23T15:59:32", "url": "https://files.pythonhosted.org/packages/16/97/6a5f392f015050907f91b9f3ee94697140e2006579e5c198c272be47d3dc/atdict-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "7b77527bd59e18f3d6d509341734b60a", "sha256": "6d801b1fc3aa68a6d620be7655b37a06e899bbe311d07e23372abe6a76dfb5b5" }, "downloads": -1, "filename": "atdict-0.9.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7b77527bd59e18f3d6d509341734b60a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5168, "upload_time": "2019-02-23T16:57:07", "url": "https://files.pythonhosted.org/packages/ca/93/c3b72bba09c08c62fe52b8405ac3f23e20ccfe909789bae84cdba8276794/atdict-0.9.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "870ec67ee16bae10d94e9127b5be9c8c", "sha256": "24d01266698aa396751721ba39c724ba11235de15a469e8ec0db1bbc102fe1c9" }, "downloads": -1, "filename": "atdict-0.9.2.tar.gz", "has_sig": false, "md5_digest": "870ec67ee16bae10d94e9127b5be9c8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19841, "upload_time": "2019-02-23T16:57:08", "url": "https://files.pythonhosted.org/packages/c6/e4/78a27363200a6b17d8106097d05a2c631b6aa568af4b2659f1862a2704db/atdict-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "0ae8e5cf1dabf9e1c7f7bc74ad69c182", "sha256": "e16fa897ae822c80050519d39ec39876848573c3a970f71156208de42c7c9fc8" }, "downloads": -1, "filename": "atdict-0.9.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0ae8e5cf1dabf9e1c7f7bc74ad69c182", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5155, "upload_time": "2019-03-10T17:49:57", "url": "https://files.pythonhosted.org/packages/c1/aa/b4452e0dd28920efa6396c46f0d92da943c4b98a4784d15bfaf49e338f2c/atdict-0.9.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "84e2e510f91d63f7459cbc6bdf792600", "sha256": "33b3fbd653f2e683ff5c6e5bc74d2ba4831abc69ac6a8b2e530806eaf9f52288" }, "downloads": -1, "filename": "atdict-0.9.3.tar.gz", "has_sig": false, "md5_digest": "84e2e510f91d63f7459cbc6bdf792600", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20634, "upload_time": "2019-03-10T17:49:58", "url": "https://files.pythonhosted.org/packages/a5/9d/6eee077736386530ec08c2bf78d6743c45f2f908b5c5b62d4b6b3bfe0c4e/atdict-0.9.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0ae8e5cf1dabf9e1c7f7bc74ad69c182", "sha256": "e16fa897ae822c80050519d39ec39876848573c3a970f71156208de42c7c9fc8" }, "downloads": -1, "filename": "atdict-0.9.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0ae8e5cf1dabf9e1c7f7bc74ad69c182", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5155, "upload_time": "2019-03-10T17:49:57", "url": "https://files.pythonhosted.org/packages/c1/aa/b4452e0dd28920efa6396c46f0d92da943c4b98a4784d15bfaf49e338f2c/atdict-0.9.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "84e2e510f91d63f7459cbc6bdf792600", "sha256": "33b3fbd653f2e683ff5c6e5bc74d2ba4831abc69ac6a8b2e530806eaf9f52288" }, "downloads": -1, "filename": "atdict-0.9.3.tar.gz", "has_sig": false, "md5_digest": "84e2e510f91d63f7459cbc6bdf792600", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20634, "upload_time": "2019-03-10T17:49:58", "url": "https://files.pythonhosted.org/packages/a5/9d/6eee077736386530ec08c2bf78d6743c45f2f908b5c5b62d4b6b3bfe0c4e/atdict-0.9.3.tar.gz" } ] }