{ "info": { "author": "Geoff Hing", "author_email": "geoffhing@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Multimedia :: Graphics", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "pandas-lookup\n=============\n\nA port of [agate-lookup](https://github.com/wireservice/agate-lookup) that provides the lookup in Pandas DataFrames instead of Agate Tables.\n\nThis uses lookup tables from Wireservice's [lookup](https://github.com/wireservice/lookup) project.\n\nInstallation\n------------\n\n```\npip install pandas-lookup\n```\n\nLook up a column from a lookup table\n------------------------------------\n\nWhen the key in your data is the same as the key in the lookup table:\n\n```\n>>> import pandaslookup\n>>> import pandas as pd\n>>> df = pd.DataFrame({'usps': ['CT', 'NY', 'NJ']})\n>>> print(df)\n state_abbr\n0 CT\n1 NY\n2 NJ\n>>> df.pipe(pandaslookup.lookup, 'usps', 'state')\n usps state\n0 CT Connecticut\n1 NY New York\n2 NJ New Jersey\n```\nWhen the key in your data is different than the key in the lookup table:\n\n```\n>>> import pandaslookup\n>>> import pandas as pd\n>>> df = pd.DataFrame({'state_abbr': ['CT', 'NY', 'NJ']})\n>>> print(df)\n state_abbr\n0 CT\n1 NY\n2 NJ\n>>> df.pipe(pandaslookup.lookup, 'state_abbr', 'state', lookup_key='usps')\n usps state\n0 CT Connecticut\n1 NY New York\n2 NJ New Jersey\n```\n\nRetrieve a table without joining\n--------------------------------\n\n```\n>>> import pandaslookup\n>>> table = pandaslookup.from_lookup(['usps', 'year'], 'population')\n>>> print(table.head())\n usps year population\n0 AL 1970 3454557\n1 AL 1971 3497349\n2 AL 1972 3540003\n3 AL 1973 3580759\n4 AL 1974 3627778\n```\n\nInstalling for development\n--------------------------\n\n```\npipenv install --dev -e .\n```\n\nRunning tests\n-------------\n\n```\npipenv run python -m unittest\n```\n\nPrior art\n---------\n\n- [harbolkn/pandas-lookup](https://github.com/harbolkn/pandas-lookup): This is the same idea, but it relies on the `agate-lookup` package, which createds a needless dependency on Agate. Also, I don't think I like monkey-patching `DataFrame`.\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/ghing/pandas-lookup", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pandas-lookup", "package_url": "https://pypi.org/project/pandas-lookup/", "platform": "", "project_url": "https://pypi.org/project/pandas-lookup/", "project_urls": { "Homepage": "https://github.com/ghing/pandas-lookup" }, "release_url": "https://pypi.org/project/pandas-lookup/0.1.4/", "requires_dist": [ "pandas (>=0.18.1)", "requests (>=2.9.1)", "pyyaml (>=3.11)" ], "requires_python": "", "summary": "pandas-lookup adds remote lookup tables to a Pandas DataFrame.", "version": "0.1.4" }, "last_serial": 4404565, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "5bb84cb820420419416462289795cb43", "sha256": "7f72ba2f21e7dbf038ed93402049ad911083c3db82ed9ecbcf6db691889daffe" }, "downloads": -1, "filename": "pandas_lookup-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5bb84cb820420419416462289795cb43", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5912, "upload_time": "2018-10-23T01:13:02", "url": "https://files.pythonhosted.org/packages/25/c5/4e8ed78eb496cefa073ef0f45e0ca347379b72b37e668ba02a2d67230be4/pandas_lookup-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cc401cb1e39865b82b309f67ce593ca4", "sha256": "d757e397e8a4e5869912ad64063c9d23a200c37fd6105eb42a39433ecaba8956" }, "downloads": -1, "filename": "pandas-lookup-0.1.2.tar.gz", "has_sig": false, "md5_digest": "cc401cb1e39865b82b309f67ce593ca4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4371, "upload_time": "2018-10-23T01:13:03", "url": "https://files.pythonhosted.org/packages/1c/86/ea89ae580684b874505f0adf551ad4f595799dfb63fe7454128dc59be225/pandas-lookup-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "3ae7acdf1b463d7a17ec2c252e718f5a", "sha256": "695590198cba43b50e76d8d8d67684e7f970d285669339b55f01b54336d94bdd" }, "downloads": -1, "filename": "pandas_lookup-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "3ae7acdf1b463d7a17ec2c252e718f5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5898, "upload_time": "2018-10-23T01:16:22", "url": "https://files.pythonhosted.org/packages/bd/18/8600de1aa9623c8b83a9d7bd890d92a66cfca100651f6953abbfe0737f80/pandas_lookup-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e980b9a9bbf32bc20b92532d5668f863", "sha256": "ba2c3cb67f95fc5557476e1aa4c5f63207e82f8f25a3425ceda56493178dbfcd" }, "downloads": -1, "filename": "pandas-lookup-0.1.3.tar.gz", "has_sig": false, "md5_digest": "e980b9a9bbf32bc20b92532d5668f863", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4352, "upload_time": "2018-10-23T01:16:23", "url": "https://files.pythonhosted.org/packages/c2/61/fac93c4d74a407de8cc1eefb01f84bb68ebec2f80031bd6ae2bbc3514390/pandas-lookup-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "0903afc84a3f149ac1feb05e01a8c064", "sha256": "b58f6c277ec5f16598624a7991f1171d4da49457f464675c7e34078a28c6f320" }, "downloads": -1, "filename": "pandas_lookup-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "0903afc84a3f149ac1feb05e01a8c064", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6016, "upload_time": "2018-10-23T02:26:23", "url": "https://files.pythonhosted.org/packages/0b/a8/b700161d7370691143f92f897b79fd7e38a98c993ba289c6a87eef1d47ea/pandas_lookup-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bce1af96e361eb770ec4aa4b67e80453", "sha256": "a3c689efc05d9e528f7938a23050abb6650487e679cf27890fa00a0fc30359f9" }, "downloads": -1, "filename": "pandas-lookup-0.1.4.tar.gz", "has_sig": false, "md5_digest": "bce1af96e361eb770ec4aa4b67e80453", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4562, "upload_time": "2018-10-23T02:26:25", "url": "https://files.pythonhosted.org/packages/4a/67/36f130788e87f552e389dda1e142a469293920b255918398c334ae16ba95/pandas-lookup-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0903afc84a3f149ac1feb05e01a8c064", "sha256": "b58f6c277ec5f16598624a7991f1171d4da49457f464675c7e34078a28c6f320" }, "downloads": -1, "filename": "pandas_lookup-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "0903afc84a3f149ac1feb05e01a8c064", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6016, "upload_time": "2018-10-23T02:26:23", "url": "https://files.pythonhosted.org/packages/0b/a8/b700161d7370691143f92f897b79fd7e38a98c993ba289c6a87eef1d47ea/pandas_lookup-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bce1af96e361eb770ec4aa4b67e80453", "sha256": "a3c689efc05d9e528f7938a23050abb6650487e679cf27890fa00a0fc30359f9" }, "downloads": -1, "filename": "pandas-lookup-0.1.4.tar.gz", "has_sig": false, "md5_digest": "bce1af96e361eb770ec4aa4b67e80453", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4562, "upload_time": "2018-10-23T02:26:25", "url": "https://files.pythonhosted.org/packages/4a/67/36f130788e87f552e389dda1e142a469293920b255918398c334ae16ba95/pandas-lookup-0.1.4.tar.gz" } ] }