{ "info": { "author": "Stan Misiurev", "author_email": "smisiurev@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# ListLookup\nWrapper for faster lookups in a list of objects/dictionaries.\n**ATTENTION** Do not modify list once index are created!\n\n```\nfrom listlookup import ListLookup\ncities = ListLookup([\n {\"id\": 1, \"country\": \"us\", name: \"Atlanta\"},\n {\"id\": 2, \"country\": \"us\", name: \"Miami\"},\n {\"id\": 3, \"country\": \"uk\", name: \"Britain\"},\n {\"id\": 4, \"country\": \"ca\", \"name\": \"Barrie\"},\n])\n\ncities.index(\"id\", lambda d: d['id'], True)\ncities.index(\"country\", lambda d: d['country'])\n\nlist(cities.lookup(id=1))\n>>> [{\"id\": 1, \"country\": \"us\", name: \"Atlanta\"}]\n\nlist(cities.lookup(country=\"us\", preserve_order=True))\n>>> [{\"id\": 1, \"country\": \"us\", name: \"Atlanta\"}, {\"id\": 2, \"country\": \"us\", name: \"Miami\"}]\n\nlist(cities.lookup(id=2, country=\"uk\"))\n>>> []\n\ncities.index('name', lambda d: d['name'])\nlist(cities.lookup(name=lambda val: val.startswith('B'))\n>>> [{\"id\": 3, \"country\": \"uk\", name: \"Britain\"}, {\"id\": 4, \"country\": \"ca\", \"name\": \"Barrie\"}]\n```\n\n## Case insensitive index\nThis is not supported out of the box. You need to use same case for index and lookup values. E.g. use `.lower()`\n```\nfrom listlookup import ListLookup\ncities = ListLookup([\n {\"id\": 1, \"country\": \"us\", name: \"Atlanta\"},\n {\"id\": 2, \"country\": \"us\", name: \"Miami\"},\n {\"id\": 3, \"country\": \"uk\", name: \"Britain\"},\n {\"id\": 4, \"country\": \"ca\", \"name\": \"Barrie\"},\n])\n\ncities.index(\"country_ci\", lambda d: d['country'].lower())\n\nlist(cities.lookup(country_ci=\"UK\".lower()))\n>>> [{\"id\": 3, \"country\": \"uk\", name: \"Britain\"}]\n```\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gluk-w/python-list-lookup", "keywords": "lookup indexing list", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "list-lookup", "package_url": "https://pypi.org/project/list-lookup/", "platform": "", "project_url": "https://pypi.org/project/list-lookup/", "project_urls": { "Homepage": "https://github.com/gluk-w/python-list-lookup" }, "release_url": "https://pypi.org/project/list-lookup/1.0.5/", "requires_dist": [ "setuptools" ], "requires_python": "", "summary": "Wrapper for a list of objects that allows to create indexes for faster lookups", "version": "1.0.5" }, "last_serial": 4973427, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "7d1fe8adca86ae949d044fcaf5d4e99a", "sha256": "d7d6441aa68e3ebb12308aad219ca494e8c3cded51c41cbdb2fd08cde1d195b3" }, "downloads": -1, "filename": "list_lookup-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7d1fe8adca86ae949d044fcaf5d4e99a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3534, "upload_time": "2019-01-31T21:55:36", "url": "https://files.pythonhosted.org/packages/43/a4/2b2837cc82e24b13a04ac1346df74da113740e65a9580d28f8e2059b9509/list_lookup-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "559de190e7bbbf2ce291e7d1b8dd89e3", "sha256": "b3d59ef9e93392207584a12f3bb97fbf81ff62d24bc317d509b1242ff7539a95" }, "downloads": -1, "filename": "list-lookup-0.0.3.tar.gz", "has_sig": false, "md5_digest": "559de190e7bbbf2ce291e7d1b8dd89e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2882, "upload_time": "2019-01-31T21:55:38", "url": "https://files.pythonhosted.org/packages/32/1c/4909d34dcf694ce33dfc7aed2932ad85228ca459a92224ae32335b5afe93/list-lookup-0.0.3.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "da2f1f3bec09b49c3e15c6aeab029e2a", "sha256": "3915645f2312245a952f591966e2dd910c12552778a9d7d678a076ce0b882df1" }, "downloads": -1, "filename": "list_lookup-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "da2f1f3bec09b49c3e15c6aeab029e2a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3679, "upload_time": "2019-02-04T21:52:30", "url": "https://files.pythonhosted.org/packages/8c/dd/e01d2547b2fc0a28029388e6564e107a57b2d7ec454cd9c41218a8abcd71/list_lookup-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a58026a9ca50a6959a1ef8a60cb3edf", "sha256": "801e6520c802092f4159471f6db8a8b8fcee7c1794624f3c4144244a2dc1d15d" }, "downloads": -1, "filename": "list-lookup-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7a58026a9ca50a6959a1ef8a60cb3edf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3057, "upload_time": "2019-02-04T21:52:31", "url": "https://files.pythonhosted.org/packages/2c/a7/169bc9bd5af32406328ce1421fe9d0581c4d58133fa28a5b17eb02e5859d/list-lookup-1.0.1.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "7f9c5138ffc47847084072b95a4b5714", "sha256": "c822fdf9f858ba5fb6aa4c3a6b8a2ffc5abd908e844850f8a81b0721841a9054" }, "downloads": -1, "filename": "list_lookup-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7f9c5138ffc47847084072b95a4b5714", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3823, "upload_time": "2019-03-05T19:22:42", "url": "https://files.pythonhosted.org/packages/77/ad/04c560cfbd4eba186d4be17af6df99d20ea91dc32dd391ae1394ea9db4ef/list_lookup-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ffd1175eb84a97145f45741905983d0f", "sha256": "3cb16006ef2f728ababab1326b57bda432eb3e36431b67b34740813772e1d91f" }, "downloads": -1, "filename": "list-lookup-1.0.3.tar.gz", "has_sig": false, "md5_digest": "ffd1175eb84a97145f45741905983d0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3234, "upload_time": "2019-03-05T19:22:43", "url": "https://files.pythonhosted.org/packages/8f/a2/2914dd241863f495b844a0620c79096cee64c7dedda79bf9a3e06f4c4e79/list-lookup-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "1320c6f3151180d87dde4a7da62fb8e5", "sha256": "a38952fe44d3eba3a63db178cec2a582a7c2f0f6ff738c18bcd699baf4ebde77" }, "downloads": -1, "filename": "list_lookup-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1320c6f3151180d87dde4a7da62fb8e5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3896, "upload_time": "2019-03-22T15:06:50", "url": "https://files.pythonhosted.org/packages/b6/2e/95b54f7a36e1f4a77c1f91d23251d7a8e6ac9d95f69ac969448d07fd1547/list_lookup-1.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed8097e66be9f683fe2251ee216d8b11", "sha256": "36aaedb8b13e0706269710670a0b999d80bbd4a183ce9582da95a9b7791b27dd" }, "downloads": -1, "filename": "list-lookup-1.0.4.tar.gz", "has_sig": false, "md5_digest": "ed8097e66be9f683fe2251ee216d8b11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3311, "upload_time": "2019-03-22T15:06:51", "url": "https://files.pythonhosted.org/packages/39/59/fa16711c8bde70487f52fb89783fbfe2e66512fdc3e3e3f637c0b83ff508/list-lookup-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "3ef59dc8c3ce10b04e07c14dbac9e638", "sha256": "cd5b02328a61d92214aa952588ff3ad201a797c9e98307eaa8392c316ac6414d" }, "downloads": -1, "filename": "list_lookup-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3ef59dc8c3ce10b04e07c14dbac9e638", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3968, "upload_time": "2019-03-22T16:10:22", "url": "https://files.pythonhosted.org/packages/4a/bd/dc2bb9584126fc74f1b46229ee664f6db43b2919ac530dd1eb72788d751c/list_lookup-1.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f09b99568b078ea610e19405a81543a2", "sha256": "a10ba101da916ec48a854e0208d7d43d8729087c2f684d0a560381f3ca7d0d85" }, "downloads": -1, "filename": "list-lookup-1.0.5.tar.gz", "has_sig": false, "md5_digest": "f09b99568b078ea610e19405a81543a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3376, "upload_time": "2019-03-22T16:10:23", "url": "https://files.pythonhosted.org/packages/4f/3e/33efaa0bd799376cf89b72b89816b4316bca8ab4d3682526c86cdbc3865d/list-lookup-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3ef59dc8c3ce10b04e07c14dbac9e638", "sha256": "cd5b02328a61d92214aa952588ff3ad201a797c9e98307eaa8392c316ac6414d" }, "downloads": -1, "filename": "list_lookup-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3ef59dc8c3ce10b04e07c14dbac9e638", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3968, "upload_time": "2019-03-22T16:10:22", "url": "https://files.pythonhosted.org/packages/4a/bd/dc2bb9584126fc74f1b46229ee664f6db43b2919ac530dd1eb72788d751c/list_lookup-1.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f09b99568b078ea610e19405a81543a2", "sha256": "a10ba101da916ec48a854e0208d7d43d8729087c2f684d0a560381f3ca7d0d85" }, "downloads": -1, "filename": "list-lookup-1.0.5.tar.gz", "has_sig": false, "md5_digest": "f09b99568b078ea610e19405a81543a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3376, "upload_time": "2019-03-22T16:10:23", "url": "https://files.pythonhosted.org/packages/4f/3e/33efaa0bd799376cf89b72b89816b4316bca8ab4d3682526c86cdbc3865d/list-lookup-1.0.5.tar.gz" } ] }