{ "info": { "author": "Matt Elwell", "author_email": "mjelwell89@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Map Dictionary Keys\n\n## Installation\n\n```pip install map-dictionary-keys```\n\n## Usage \n\n```python\nfrom map_dictionary_keys import map_dictionary_keys\n\nd = {\n 'some_key_to_map': 'value'\n}\n\n\ndef some_mapping_function(key_name):\n return key_name.upper()\n\nmapped_dictionary = map_dictionary_keys(d, some_mapping_function)\n```\n\nIn the above example, `mapped_dictionary` will be mapped according to the function `some_mapping_function` as follows:\n\n```python\nmapped_dictionary = {\n 'SOME_KEY_TO_MAP': 'value'\n}\n``` \n\n\nThis function _will_ work for all levels of nested dictionaries. In the following example, both `'sub_dictionary'` and `'key_name'` will be converted as per the mapping function passed to `map_dictionary_keys`. \n\n```python\ndictionary = {\n 'sub_dictionary': {\n 'key_name': 'value'\n }\n}\n```\n\nIt _will_ also work for nested lists of dictionaries. For example, in the following example, `'key_name'` will be mapped according to the mapping function provided to `map_dictionary_keys`. \n\n```python\ndictionary = {\n 'list_of_dictionaries': [\n {\n 'key_name': 'value'\n }\n ]\n}\n```\n\nThis function does not currently work for lists nested beyond the first level. For example, in the following example, `'key_name'` will _not_ be mapped according to the mapping function provided to `map_dictionary_keys`. \n\n```python\ndictionary = {\n 'my_list': [\n [\n {\n 'key_name': 'value'\n }\n ]\n ]\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/melwell89/map-dictionary-keys", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "map-dictionary-keys", "package_url": "https://pypi.org/project/map-dictionary-keys/", "platform": "", "project_url": "https://pypi.org/project/map-dictionary-keys/", "project_urls": { "Homepage": "https://github.com/melwell89/map-dictionary-keys" }, "release_url": "https://pypi.org/project/map-dictionary-keys/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "A function to map the keys in a dictionary", "version": "0.0.2" }, "last_serial": 4803090, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7f0ed4cf5d5a7fa21f2110906e083258", "sha256": "6250bf8f2e2963ca74336dd5a0d32d2d172584da0634f9a23376262dca46e72c" }, "downloads": -1, "filename": "map_dictionary_keys-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7f0ed4cf5d5a7fa21f2110906e083258", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4020, "upload_time": "2019-02-10T02:27:16", "url": "https://files.pythonhosted.org/packages/4d/2e/10be189243efd9d7b95eae5e8f4ddcaa67c7661f72d0f4cd410f03ac8cf3/map_dictionary_keys-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9dbe521a343a77a265077942b937736a", "sha256": "79005df488a44625a80516eccb61f209da85ce885b580e457cf232334c147641" }, "downloads": -1, "filename": "map-dictionary-keys-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9dbe521a343a77a265077942b937736a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2233, "upload_time": "2019-02-10T02:27:18", "url": "https://files.pythonhosted.org/packages/e5/04/9c90ab3beac152dfb9e3df6038a7eaa7504d38ac1159a723b1764dea8980/map-dictionary-keys-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "2a56f2d75a64fb3b872b58cb0afaeaad", "sha256": "3f57734cbf6cdeb62710ef0353782e19e2336c6608bde6057b8cbaa87588f8db" }, "downloads": -1, "filename": "map_dictionary_keys-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2a56f2d75a64fb3b872b58cb0afaeaad", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4213, "upload_time": "2019-02-10T19:23:44", "url": "https://files.pythonhosted.org/packages/d0/0f/38044309b6284a2c7865a964549cb51f627f22a82659b677837d0ea224bc/map_dictionary_keys-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e895e0ecde2300fa3a05ed086fa7b5d3", "sha256": "96c83be81d39222c656436f656932b5836b668f1cf8d9945987d0b73576d3fd6" }, "downloads": -1, "filename": "map-dictionary-keys-0.0.2.tar.gz", "has_sig": false, "md5_digest": "e895e0ecde2300fa3a05ed086fa7b5d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2365, "upload_time": "2019-02-10T19:23:46", "url": "https://files.pythonhosted.org/packages/72/8c/bc64d0965644b4ddd587a10082def4ba1fbd3497229e097ae6be5fd82b8f/map-dictionary-keys-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2a56f2d75a64fb3b872b58cb0afaeaad", "sha256": "3f57734cbf6cdeb62710ef0353782e19e2336c6608bde6057b8cbaa87588f8db" }, "downloads": -1, "filename": "map_dictionary_keys-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2a56f2d75a64fb3b872b58cb0afaeaad", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4213, "upload_time": "2019-02-10T19:23:44", "url": "https://files.pythonhosted.org/packages/d0/0f/38044309b6284a2c7865a964549cb51f627f22a82659b677837d0ea224bc/map_dictionary_keys-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e895e0ecde2300fa3a05ed086fa7b5d3", "sha256": "96c83be81d39222c656436f656932b5836b668f1cf8d9945987d0b73576d3fd6" }, "downloads": -1, "filename": "map-dictionary-keys-0.0.2.tar.gz", "has_sig": false, "md5_digest": "e895e0ecde2300fa3a05ed086fa7b5d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2365, "upload_time": "2019-02-10T19:23:46", "url": "https://files.pythonhosted.org/packages/72/8c/bc64d0965644b4ddd587a10082def4ba1fbd3497229e097ae6be5fd82b8f/map-dictionary-keys-0.0.2.tar.gz" } ] }