{ "info": { "author": "Miroslav Shubernetskiy", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4" ], "description": "==========\nsimplepath\n==========\n\n.. image:: https://badge.fury.io/py/simplepath.png\n :target: http://badge.fury.io/py/simplepath\n\n.. image:: https://travis-ci.org/dealertrack/simplepath.png?branch=master\n :target: https://travis-ci.org/dealertrack/simplepath\n\n.. image:: https://coveralls.io/repos/dealertrack/simplepath/badge.svg\n :target: https://coveralls.io/r/dealertrack/simplepath\n\n\n``simplepath`` is a library for data-structure lookups\nusing super simple expressions with performance in mind.\n*\"simplepath\"* is a word play on some other ``*path`` technologies\nsuch as ``xpath``, ``jsonpath``, ``jpath``, etc.\n\n* Free software: MIT license\n* GitHub: https://github.com/dealertrack/simplepath\n\nInspiration\n-----------\n\nThe inspiration for ``simplepath`` was performance. Many other\nlibraries focus on making single lookups, however they fall \nshort when a lot of data needs to be queried.\n\nFor example if a dictionary with some structure needs to be converted\ninto another dictionary with a different structure, a simple and\nconfigurable way of doing that might be to define a configuration\ndictionary where the keys will be the keys of the output dictionary, \nand values will be lookup expressions to get appropriate data::\n\n {\n \"greetings\": \"foo.greeting\",\n \"planet\": \"foo.[0].planet\",\n ...\n }\n\nThe above approach is easy to implement, however is not very performant\nsince for each lookup the lookup expression will have to be evaluated.\nAt dealertrack, we needed to do something similar at some point and\ntried `jsonpath-rw `_\nwhich would sometimes take 15 seconds to map dictionaries with only\na couple hundred expressions. Upon some investigation, most of the\ntime was being spent in `ply `_.\nUnfortunately we did not find another comparable library which\naccomplished everything we needed, and satisfied our performance\nrequirements, so ``simplepath`` was born.\n\nInstalling\n----------\n\nYou can install ``simplepath`` using pip::\n\n $ pip install simplepath\n\nQuick Guide\n-----------\n\nHere is a quick example.\n\n::\n\n from simplepath.mapper import Mapper\n\n class MyMapper(Mapper):\n config = {\n 'greetings': 'example.greetings',\n 'to': 'example.planets..residents',\n }\n\n data = {\n 'example': {\n 'greetings': 'Hello',\n 'planets': [\n {\n 'planet': 'Mars',\n 'residents': 'martians',\n },\n {\n 'planet': 'Earth',\n 'residents': 'people',\n },\n {\n 'planet': 'Space',\n 'residents': 'aliens',\n },\n ]\n }\n }\n\n MyMapper.map_data(data) == {\n 'greetings': 'Hello',\n 'to': 'people',\n }\n\nTesting\n-------\n\nTo run the tests you need to install testing requirements first::\n\n $ make install\n\nThen to run tests, you can use ``nosetests`` or simply use Makefile command::\n\n $ nosetests -sv\n # or\n $ make test\n\n\n\n\nHistory\n-------\n\n0.3.5 (2018-06-14)\n~~~~~~~~~~~~~~~~~~~~~\n\n* Fixed bug in which ``TypeError`` would result if a ``None`` value were mapped to a ``ListConfig``\n\n\n0.3.4 (2017-07-28)\n~~~~~~~~~~~~~~~~~~~~~\n\n* Using wheel for distribution\n* Removed tests from being packaged\n* Switched to using Python 3.6 vs 3.5 for running Travis builds\n\n0.3.3 (2016-05-15)\n~~~~~~~~~~~~~~~~~~~~~\n\n* Fixed bug where global LUT would leak data when calling expressions\n within custom lookups. See `#11 `_.\n* Switched to using Python 3.5 vs 3.4 for running Travis builds\n\n0.3.2 (2015-09-14)\n~~~~~~~~~~~~~~~~~~~~~\n\n* Registered ``AsTypeLookup`` and ``ArithmeticLookup`` as ``as_type`` and ``arith`` lookups\n in default lookup registry\n\n0.3.1 (2015-08-28)\n~~~~~~~~~~~~~~~~~~~~~\n\n* Added the ``AsTypeLookup`` and ``ArithmeticLookup``\n\n0.3.0 (2015-07-15)\n~~~~~~~~~~~~~~~~~~~~~\n\n* Added ability to use lists in the simplepath config which will generate a list in the mapped data\n\n0.2.0 (2015-06-26)\n~~~~~~~~~~~~~~~~~~~~~\n\n* Added ``deepvars`` utility which is useful when using simplepath with objects\n\n0.1.1 (2015-03-31)\n~~~~~~~~~~~~~~~~~~~~~\n\n* Fixed a link to the repo in the package description\n\n0.1.0 (2015-01-08)\n~~~~~~~~~~~~~~~~~~~~~\n\n* First release\n\n\nCredits\n-------\n\nThis utility was created at `dealertrack technologies`_\n(`dealertrack GitHub`_) for our internal use so thank you\ndealertrack for allowing to contribute the utility\nto the open-source community.\n\nDevelopment Lead\n~~~~~~~~~~~~~~~~\n\n* Miroslav Shubernetskiy - https://github.com/miki725\n\nContributors\n~~~~~~~~~~~~\n\n* Ndubisi Onuora - https://github.com/NdubisiOnuora\n\n\n.. _dealertrack GitHub: https://github.com/Dealertrack\n.. _dealertrack technologies: https://www.dealertrack.com\n\n\nLicense\n-------\n\nThe MIT License (MIT)\n\nCopyright (c) 2014, dealertrack technologies\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dealertrack/simplepath", "keywords": "simplepath", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "simplepath", "package_url": "https://pypi.org/project/simplepath/", "platform": "", "project_url": "https://pypi.org/project/simplepath/", "project_urls": { "Homepage": "https://github.com/dealertrack/simplepath" }, "release_url": "https://pypi.org/project/simplepath/0.3.5/", "requires_dist": null, "requires_python": "", "summary": "simplepath is a dictionary lookup utility/mapper with performance in mind", "version": "0.3.5" }, "last_serial": 3965515, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "dd12167276757c9bff9f24601c8ac3e4", "sha256": "369568f951a4c5c600b2b4619f76410060e62fbd28dd68aac91262cfb91aeac9" }, "downloads": -1, "filename": "simplepath-0.1.0.tar.gz", "has_sig": false, "md5_digest": "dd12167276757c9bff9f24601c8ac3e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24224, "upload_time": "2015-03-31T18:18:41", "url": "https://files.pythonhosted.org/packages/f6/80/b73983e98a4431a768aae9a2b05f5610578f7e9aa7f1c5a3af9bdb73cd47/simplepath-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d05b80185e31d13f24983fe28e14c2d1", "sha256": "6f33137c6d8d5e840ddeb9cfb7209b5ac938304e6e681dfd43468e5c991299cd" }, "downloads": -1, "filename": "simplepath-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d05b80185e31d13f24983fe28e14c2d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24210, "upload_time": "2015-03-31T18:40:53", "url": "https://files.pythonhosted.org/packages/49/a1/e601f1f481ec4b913abd5aeff715dd5f8b2cc70d31c25f615bf4de6a8d04/simplepath-0.1.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "4bfd316d6375ed75e389c6e7b0d2f8c8", "sha256": "a382dcb9e8c3011569a956b2d3959739dc354a4c81b8b85886942840278bff44" }, "downloads": -1, "filename": "simplepath-0.2.tar.gz", "has_sig": false, "md5_digest": "4bfd316d6375ed75e389c6e7b0d2f8c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25296, "upload_time": "2015-06-26T18:16:33", "url": "https://files.pythonhosted.org/packages/f3/04/0f8fc515a5405c05b8336ec2a2fc187e3d778badaeeb4b5533bd4a729a4c/simplepath-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "bb1f48cead7213d606ed401d3ee0a108", "sha256": "454c771934c27fe6353bbe2bc6366606e896296ab095955b3f460b5f8392b1d1" }, "downloads": -1, "filename": "simplepath-0.3.tar.gz", "has_sig": false, "md5_digest": "bb1f48cead7213d606ed401d3ee0a108", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26145, "upload_time": "2015-07-15T15:34:11", "url": "https://files.pythonhosted.org/packages/9a/3e/a60ccd0dd755b01d0223e7b910d930caca22afefa74899402b47b7a0b571/simplepath-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "83176c92accb336b8f5fc7dba2f43735", "sha256": "b61a821df391e0e1e0d105fcef695c306b41ee62e453782e6e3a6f224ea2aee1" }, "downloads": -1, "filename": "simplepath-0.3.1.tar.gz", "has_sig": false, "md5_digest": "83176c92accb336b8f5fc7dba2f43735", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27602, "upload_time": "2015-08-31T14:24:55", "url": "https://files.pythonhosted.org/packages/0d/84/85e8c421027f9bd678b30439badbdb8fdc867534855bc906fc3f62a95ccd/simplepath-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "bc657dd3909c20f51d615428bf2db476", "sha256": "07b37c51435c256f4d12930455c967b4ebad3f1d1df67c8bcdcf614958fcd0ba" }, "downloads": -1, "filename": "simplepath-0.3.2.tar.gz", "has_sig": false, "md5_digest": "bc657dd3909c20f51d615428bf2db476", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27735, "upload_time": "2015-09-14T16:19:05", "url": "https://files.pythonhosted.org/packages/7a/12/fd952788ad62afe13102a3b8e6b80347488e13442fb51ba5dd246d0c7a67/simplepath-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "a0076d9d7b66482acc19a577d5b24790", "sha256": "c62961f3c548bbea6ab3251a7a4ee3fc822d1a4fb2677c1e1fe6fda4eb22d412" }, "downloads": -1, "filename": "simplepath-0.3.3.tar.gz", "has_sig": false, "md5_digest": "a0076d9d7b66482acc19a577d5b24790", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27958, "upload_time": "2016-07-15T18:47:26", "url": "https://files.pythonhosted.org/packages/9f/3b/47931c937474c4c1a3086c74bcf39b734dd670abb17f1354aa93e32b63c0/simplepath-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "0329bd015d400e5de7856a95b117a5fe", "sha256": "65722718507de27a1cb611fa6d8c95cc13753570a09749b226c3328aac90c37b" }, "downloads": -1, "filename": "simplepath-0.3.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0329bd015d400e5de7856a95b117a5fe", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 16043, "upload_time": "2017-07-28T14:49:59", "url": "https://files.pythonhosted.org/packages/68/8e/9541d1024d0fbcb8a04f16418a231cdd7069ba1cbff4ac18d213d55aca95/simplepath-0.3.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48caa407c98d403ee8c595764f5cbea7", "sha256": "a8802292ccd76d5d746b7dc97284941bda5e218fd38f1fe0a59b98413c4c191e" }, "downloads": -1, "filename": "simplepath-0.3.4.tar.gz", "has_sig": false, "md5_digest": "48caa407c98d403ee8c595764f5cbea7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28239, "upload_time": "2017-07-28T14:49:57", "url": "https://files.pythonhosted.org/packages/6f/51/1a5e3d68f83b19716292f450cbe6666134ee750c53a1f51579a45dab9c66/simplepath-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "ed9b0fa1a26838a3b37cd2532f6953c1", "sha256": "00772f9e2c9128d25506bbef607d1577bba5a6e7aa8fd8e77f8073b19649c0ca" }, "downloads": -1, "filename": "simplepath-0.3.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ed9b0fa1a26838a3b37cd2532f6953c1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16225, "upload_time": "2018-06-15T17:06:31", "url": "https://files.pythonhosted.org/packages/4e/2d/a08e877bc2c7538b2c5b3124b26951152c0d689baaa26e3761378421cf17/simplepath-0.3.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a373b8c65b85a6766f6e74ba2387deea", "sha256": "a002a7312d41895974a7b57760a5517be46d4679a9bb0c5e712d89c3d6d173b3" }, "downloads": -1, "filename": "simplepath-0.3.5.tar.gz", "has_sig": false, "md5_digest": "a373b8c65b85a6766f6e74ba2387deea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28502, "upload_time": "2018-06-15T17:06:28", "url": "https://files.pythonhosted.org/packages/df/90/3c97423c1eaa0da4b95720fd2d486b24b3e31c1671677aebcca3fd3e88f6/simplepath-0.3.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ed9b0fa1a26838a3b37cd2532f6953c1", "sha256": "00772f9e2c9128d25506bbef607d1577bba5a6e7aa8fd8e77f8073b19649c0ca" }, "downloads": -1, "filename": "simplepath-0.3.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ed9b0fa1a26838a3b37cd2532f6953c1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16225, "upload_time": "2018-06-15T17:06:31", "url": "https://files.pythonhosted.org/packages/4e/2d/a08e877bc2c7538b2c5b3124b26951152c0d689baaa26e3761378421cf17/simplepath-0.3.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a373b8c65b85a6766f6e74ba2387deea", "sha256": "a002a7312d41895974a7b57760a5517be46d4679a9bb0c5e712d89c3d6d173b3" }, "downloads": -1, "filename": "simplepath-0.3.5.tar.gz", "has_sig": false, "md5_digest": "a373b8c65b85a6766f6e74ba2387deea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28502, "upload_time": "2018-06-15T17:06:28", "url": "https://files.pythonhosted.org/packages/df/90/3c97423c1eaa0da4b95720fd2d486b24b3e31c1671677aebcca3fd3e88f6/simplepath-0.3.5.tar.gz" } ] }