{ "info": { "author": "Veit Heller", "author_email": "veit@veitheller.de", "bugtrack_url": null, "classifiers": [], "description": "manipulator\n=============\n\nPython data manipulation made braindead.\n\nInstallation\n------------\n\n::\n\n pip install manipulator\n\nUsage\n-----\n\n``manipulator`` mainly exposes three functions, ``get``, ``update``, and ``set``.\n``get`` retrieves data, ``update`` transforms it based on its form, and ``set``\ntransforms it by simply resetting. Transformations can be applied in place or\non a copy. The default is in place, because copying is expensive. If you want a\ncopy of the data, set the keyword argument ``in_place`` to ``True``.\n\nIt uses a query \"language\" not unlike CSS, albeit much, much simpler. The only\ntwo entities in this \"language\" are IDs\u2014denoted by ``#``\u2014and Classes\u2014denoted by\n``.``. IDs are unique, whereas Classes are collections of all leaf values that\nconform.\n\nA few motivating examples (a more exhaustive list can be found in the ``test`` directory):\n\n.. code-block:: python\n\n import manipulator\n\n manipulator.get({\"k\": [1, [2], 3]}, \"#k #1 #0\")\n # => 2 (note how list indices are coerced into integers)\n\n manipulator.get([{\"k\": \"v\"}, {\"k\": \"v2\", \"k2\": \"v3\"}], \".k\")\n # => [\"v\", \"v2\"]\n\n manipulator.get([{\"k\": \"v\"},\n {\"k\": {\n \"a\": [{\"k\": 10}, {\"k\": 11}]\n }\n }], \".k #1 #a .k\")\n # => [10, 11]\n\n manipulator.set({\"k\": [1, [2], 3]}, \"#k #1 #0\", 3)\n # => {\"k\": [1, [3], 3]} (in place)\n\n manipulator.set({\"k\": [1, [2], 3]}, \"#k #1 #0\", 3, in_place=False)\n # => {\"k\": [1, [3], 3]} (will create a copy of the data)\n\n manipulator.set([{\"k\": \"v\"},\n {\n \"k\": {\n \"a\": [{\"k\": 10}, {\"k\": 11}]\n }\n }], \".k #1 #a .k\", 100)\n # => [{\"k\": \"v\"}, {\"k\": {\"a\": [{\"k\": 100}, {\"k\": 100}]}}]\n\n manipulator.update({\"k\": [1, [2], 3]}, \"#k #1 #0\", lambda x: x-1)\n # => {\"k\": [1, [1], 3]} (in place, use in_place=False to copy)\n\n manipulator.update([{\"k\": \"v\"},\n {\n \"k\": {\n \"a\": [{\"k\": 10}, {\"k\": 11}]\n }\n }], \".k #1 #a .k\", lambda x: x+1)\n # => [{\"k\": \"v\"}, {\"k\": {\"a\": [{\"k\": 11}, {\"k\": 12}]}}]\n\n\nThat is all.\n\n\nHave fun!\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/hellerve/hawkweed/tarball/0.0.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hellerve/manipulator", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "manipulator", "package_url": "https://pypi.org/project/manipulator/", "platform": "", "project_url": "https://pypi.org/project/manipulator/", "project_urls": { "Download": "https://github.com/hellerve/hawkweed/tarball/0.0.2", "Homepage": "https://github.com/hellerve/manipulator" }, "release_url": "https://pypi.org/project/manipulator/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "Python data manipulation made braindead", "version": "0.0.2" }, "last_serial": 2580660, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2feee3c7afc301cb21ecde24a99b63a1", "sha256": "469a75b34fb36c113ab04d0b192799eca894df976164677358a317f4a5a63158" }, "downloads": -1, "filename": "manipulator-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2feee3c7afc301cb21ecde24a99b63a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2884, "upload_time": "2017-01-17T14:26:29", "url": "https://files.pythonhosted.org/packages/48/e2/5259595be28b78256dd90c27cb233487238d127fad624d1006172580642f/manipulator-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "d03559a8b1fcaa4adef278671490a4ee", "sha256": "5231ffa162b345c55f89883ac6f2550aa0dc81dd696a432b2454d98fc318ee51" }, "downloads": -1, "filename": "manipulator-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d03559a8b1fcaa4adef278671490a4ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2911, "upload_time": "2017-01-17T20:08:29", "url": "https://files.pythonhosted.org/packages/db/97/6b9624fc20a24c4bb40fee8fb1beaf4ae47f6e744b07ea3894b2ec85eff3/manipulator-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d03559a8b1fcaa4adef278671490a4ee", "sha256": "5231ffa162b345c55f89883ac6f2550aa0dc81dd696a432b2454d98fc318ee51" }, "downloads": -1, "filename": "manipulator-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d03559a8b1fcaa4adef278671490a4ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2911, "upload_time": "2017-01-17T20:08:29", "url": "https://files.pythonhosted.org/packages/db/97/6b9624fc20a24c4bb40fee8fb1beaf4ae47f6e744b07ea3894b2ec85eff3/manipulator-0.0.2.tar.gz" } ] }