{ "info": { "author": "Hagen Eckert", "author_email": "pinpoint@eckert.science", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering :: Information Analysis" ], "description": "# PinPoint\n\n[![PyPI](https://img.shields.io/pypi/v/pinpoint.svg)](https://pypi.org/project/PinPoint/)\n[![PyPI - License](https://img.shields.io/pypi/l/pinpoint.svg)](https://bitbucket.org/nathan-diodan/pinpoint/src/master/LICENSE.txt)\n[![Codeship](https://img.shields.io/codeship/d6849780-6081-0136-b9bb-0a7a2647bd02.svg)](https://app.codeship.com/projects/296298)\n[![Bitbucket issues](https://img.shields.io/bitbucket/issues/nathan-diodan/pinpoint.svg)](https://bitbucket.org/nathan-diodan/pinpoint/issues?status=new&status=open)\n[![PyPI - Status](https://img.shields.io/pypi/status/pinpoint.svg)](https://pypi.org/project/PinPoint/)\n\n\nPinPoint is a fast geo toolkit for academic affiliation strings.\nIt provides the following base functions:\n\n* find a location (information about mapped city and country)\n* calculate the apparent location and cooperation distance for a list of weighted affiliation strings\n\n## Install\nInstall and update using pip\n\n```\npip install pinpoint\n```\n\n## Usage\n\n```python\nfrom pinpoint import Locator\nloc = Locator()\n```\n\nThe first time `Locator` is initialized the lookup tables and databases need to be created.\nFor this four files are downloaded from [GeoNames](http://www.geonames.org) [dump](http://download.geonames.org/export/dump/) (~ 150MB) and optimized:\n\n* cities1000.zip\n* admin1CodesASCII.txt\n* countryInfo.txt\n* alternateNames.zip\n\nIt is possible to rebuild the database at a later date:\n```python\nfrom pinpoint import Locator\nloc = Locator(refresh=True)\n```\nThe data will not be downloaded again from [GeoNames](http://www.geonames.org) if the cached files are younger than a week, to avoid unnecessary load on their servers.\nThe databases and cached files are stored in the appropriate folders depending on your operating system.\nIf necessary, you can empty them by hand.\n\n```python\nfrom pinpoint import Locator\nprint(Locator.resources_dir)\nprint(Locator.resources_cache_dir)\n```\n\n### Find a location\n\n```python\ntest_string = \"Department of Chemical and Biomolecular Engineering, Rice University, Houston, TX, United States\"\ncountry, region, city = loc.find(test_string)\n```\n\nThis function returns either a `dict()` or `None` for each the country, region, and city.\nThe following information is returned based on the data from [GeoNames](http://www.geonames.org):\n\n* county\n * `'a2'` ISO 3166-1 alpha-2 counry code\n * `'a3'` ISO 3166-1 alpha-3 counry code\n * `'n3'` ISO 3166-1 numeric counry code\n * `'name'`\n * `'short_name_list'` short name variants\n * `'name_list'` name in different languages\n * `'capital'`\n * `'continent'`\n * `'area'` in square kilometer\n * `'population'`\n * `'geonameid'` unique id given by [GeoNames](http://www.geonames.org)\n* region (just used for USA and Canada at the moment)\n * `'name'`\n * `'short_name_list'` short name variants\n * `'name_list'` name in different languages\n * `'region_code'`\n * `'a2'` ISO 3166-1 alpha-2 counry code\n * `'geonameid'` unique id given by [GeoNames](http://www.geonames.org)\n* city\n * `'name'`\n * `'asciiname'`\n * `'name_list'` name in different languages\n * `'latitude'`\n * `'longitude'`\n * `'a2'` ISO 3166-1 alpha-2 counry code\n * `'admin1_code'`\n * `'elevation'` and `'dem'` are linked to the elevation in meter\n * `'timezone'`\n * `'geonameid'` unique id given by [GeoNames](http://www.geonames.org)\n\n### Calculate the apparent location and cooperation distance\n\nBased on a weighted list of affiliations, an apparent location for a scientific document can be calculated.\n\n```python\nfrom pinpoint import Locator\nloc = Locator()\n\nweighted_affiliations = {\n \"Dresden Center for Computational Material Science, Technische Universit\u00e4t Dresden, Dresden, Germany\": 2,\n \"Department of Chemical and Biomolecular Engineering, Rice University, Houston, TX, United States\": 1,\n \"Nanoscience and Nanotechnology Center, Institute of Scientific and Industrial Research (ISIR), Osaka University, 8-1 Mihogaoka, Ibaraki, Osaka, Japan\": 0.5,\n \"Centro/Departamento de F\u00edsica da Universidade do Minho, Campus de Gualtar, 4710-057 Braga, Portugal\": 0.5,\n }\n\ncooperation_distance, apparent_location = loc.calculate_str(weighted_affiliations)\n```\n\nThe cooperation distance is returned in kilometers.\nIf the coordinates are already known, the calculation can be done directly, without the need to initialize the resources.\n\n```python\nLocator.calculate_coordinates(weighted_coordinates)\n```\n\n## redis subsystem\nThe underlying architecture of pinpoint is not well suited for the use in a system that spawns many processes or threads.\nTo enable its use under such conditions, the application data can be separated from the search logic.\n\nThe lookup tables and location databases are then stored in a [redis](https://redis.io) database (>4.0).\nAfter the [installation](https://redis.io/topics/quickstart) two additional python packages are needed:\n\n```\npip install redis\npip install hiredis\n```\n\nThe way to interact with pinpoint does not change by using the redis subsystem.\nWhen `Locator` is initialized the value of `server` needs to be set to `True`.\n\n```python\nfrom pinpoint import Locator\nloc = Locator(server=True)\n```\n\nIf different settings for redis server are needed, `server` can be set to a dictionary containing the settings.\nThe allowed keys are the same as listed in the redis-py [documentation](https://redis-py.readthedocs.io/en/latest/index.html#redis.Redis).\n\n```python\nfrom pinpoint import Locator\nloc = Locator(server={'host': 'localhost', 'port': 6379, 'db': 0})\n```\n\nThis approach is noticeable slower when directly compared to the default implementation.\nIt should be just used if multiple instances of pinpoint need to run in parallel.\n\n## Examples\n\nVarious examples can be found in the *extra* folder of the [source distribution](https://bitbucket.org/nathan-diodan/pinpoint/src/master/extras/README.md).\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://bitbucket.org/nathan-diodan/pinpoint/get/0.2.0.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pinpoint.eckert.science", "keywords": "collaboration metrics,weighted distance,cooperation distance,apparent location,affiliation strings,bibliometrics", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "PinPoint", "package_url": "https://pypi.org/project/PinPoint/", "platform": "", "project_url": "https://pypi.org/project/PinPoint/", "project_urls": { "Download": "https://bitbucket.org/nathan-diodan/pinpoint/get/0.2.0.zip", "Homepage": "http://pinpoint.eckert.science" }, "release_url": "https://pypi.org/project/PinPoint/0.2.0/", "requires_dist": [ "appdirs", "geopy", "numpy", "nvector", "scipy", "unidecode" ], "requires_python": "~=3.6", "summary": "A fast geo toolkit for academic affiliation strings", "version": "0.2.0" }, "last_serial": 5342081, "releases": { "0.1.5": [ { "comment_text": "", "digests": { "md5": "14965b82d7776b6e82e14affeaa58d38", "sha256": "72017db155d40d062619077a41e7432bbde2f3bd6f3cf73cea199e94dfbd4322" }, "downloads": -1, "filename": "PinPoint-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "14965b82d7776b6e82e14affeaa58d38", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.6", "size": 11523, "upload_time": "2018-06-20T04:06:47", "url": "https://files.pythonhosted.org/packages/c8/f0/cfa26039632baf18fe87a5b90690bff4aed8789b058d322ea523beb5a51a/PinPoint-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9e2bedddba900ab79bcac02a220bf09", "sha256": "bbdf4efe15c238649eb3f444acdf77501bc86cf1c36ee14eb491524cc9b36323" }, "downloads": -1, "filename": "PinPoint-0.1.5.tar.gz", "has_sig": false, "md5_digest": "d9e2bedddba900ab79bcac02a220bf09", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.6", "size": 12205, "upload_time": "2018-06-20T04:06:48", "url": "https://files.pythonhosted.org/packages/6c/3f/bf7684081ac320c7509ca75911fd8fc75e5133ec85ba6661e3b9568b2907/PinPoint-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "a5d0a5a1f40b19fe8827b505071e84be", "sha256": "8d7a715c46e298db0202a9081d67cdba55a37aa6ca0335f85daa5fd52ee1f252" }, "downloads": -1, "filename": "PinPoint-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "a5d0a5a1f40b19fe8827b505071e84be", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.6", "size": 49092, "upload_time": "2018-06-28T17:00:28", "url": "https://files.pythonhosted.org/packages/cb/1f/cdce1bf5b06b280299c755ed442016e6249bf6860fb3ea0b4b7a8caa4fa0/PinPoint-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4db96cdb12fc25b46391149f2ed7200e", "sha256": "11ecbbe366340f9b2a1949495efa1e688183aa8e04fb91df4d58b307b0a4f0fd" }, "downloads": -1, "filename": "PinPoint-0.1.6.tar.gz", "has_sig": false, "md5_digest": "4db96cdb12fc25b46391149f2ed7200e", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.6", "size": 50494, "upload_time": "2018-06-28T17:00:29", "url": "https://files.pythonhosted.org/packages/94/94/320de6c60adae4e78b1d54d282adef5026aa4e286d5c7ceab824886e2917/PinPoint-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "a87825ccfc08c3ef45a79acb245a061b", "sha256": "b0153c6dc45036b7a26f84fec75c95b3d21367bc541414c10e9b04f9cb9c3f78" }, "downloads": -1, "filename": "PinPoint-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "a87825ccfc08c3ef45a79acb245a061b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.6", "size": 50072, "upload_time": "2019-05-27T14:35:17", "url": "https://files.pythonhosted.org/packages/a2/89/0a5e9fe303c2f8a5af3609279e64d6c221d6aeb63f333e00be95572b7435/PinPoint-0.1.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "75c2d615dc5007628b9277cec3114172", "sha256": "bb2022b138ab7318479199b681d081396a3c4d93059d350b94c2c689979f6de5" }, "downloads": -1, "filename": "PinPoint-0.1.7.tar.gz", "has_sig": false, "md5_digest": "75c2d615dc5007628b9277cec3114172", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.6", "size": 48866, "upload_time": "2019-05-27T14:35:19", "url": "https://files.pythonhosted.org/packages/b0/18/4b39f0ccb134f7773933e533b2da5682964962ad4c763ed316c4297460eb/PinPoint-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "b9a1356f959160ec7e15ea564ee4ad24", "sha256": "c551d84764abd37c322d200700d3bd16ee68ef47d674cf8795d012c903fb2e0f" }, "downloads": -1, "filename": "PinPoint-0.1.8-py3-none-any.whl", "has_sig": false, "md5_digest": "b9a1356f959160ec7e15ea564ee4ad24", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.6", "size": 50080, "upload_time": "2019-05-27T15:28:50", "url": "https://files.pythonhosted.org/packages/93/85/023ab4cc6d84d50b5a36d36e9a5311d0a06fed3f3f61006a2fd97ed76f6f/PinPoint-0.1.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7bddc2c7147a56bb97932956903faa0", "sha256": "b2e2892eb3b588a8ce7449aaef6ef43e444c6c1f8e1d058fb67a973e9075252a" }, "downloads": -1, "filename": "PinPoint-0.1.8.tar.gz", "has_sig": false, "md5_digest": "a7bddc2c7147a56bb97932956903faa0", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.6", "size": 48862, "upload_time": "2019-05-27T15:28:57", "url": "https://files.pythonhosted.org/packages/1f/dd/5d53d78f5b085fe84fe964d2f6b3ba61585d010719bd4e2bfdc6f683e6cb/PinPoint-0.1.8.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7a994fc6047153ce927046e60065a9f5", "sha256": "107f6fcafc2b63591259f27d83c97b19dee162f2e3c7ed0fa4f10288481154a7" }, "downloads": -1, "filename": "PinPoint-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7a994fc6047153ce927046e60065a9f5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.6", "size": 52609, "upload_time": "2019-05-31T09:59:20", "url": "https://files.pythonhosted.org/packages/4f/eb/75bd73a658afafd8007048863f923ae8310c98293d420c234f257dd50085/PinPoint-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "36bb7b57404606cee6eb5ffbaae2c9e4", "sha256": "c9424bbea79e526d07d4b45ab8a1a024aa9e0170035fc493358539c0d159f551" }, "downloads": -1, "filename": "PinPoint-0.2.0.tar.gz", "has_sig": false, "md5_digest": "36bb7b57404606cee6eb5ffbaae2c9e4", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.6", "size": 51539, "upload_time": "2019-05-31T09:59:30", "url": "https://files.pythonhosted.org/packages/38/08/a1ad2d487413b2eb9db485683bc534b3ca464a1f237a4d954296192ec5d9/PinPoint-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7a994fc6047153ce927046e60065a9f5", "sha256": "107f6fcafc2b63591259f27d83c97b19dee162f2e3c7ed0fa4f10288481154a7" }, "downloads": -1, "filename": "PinPoint-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7a994fc6047153ce927046e60065a9f5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.6", "size": 52609, "upload_time": "2019-05-31T09:59:20", "url": "https://files.pythonhosted.org/packages/4f/eb/75bd73a658afafd8007048863f923ae8310c98293d420c234f257dd50085/PinPoint-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "36bb7b57404606cee6eb5ffbaae2c9e4", "sha256": "c9424bbea79e526d07d4b45ab8a1a024aa9e0170035fc493358539c0d159f551" }, "downloads": -1, "filename": "PinPoint-0.2.0.tar.gz", "has_sig": false, "md5_digest": "36bb7b57404606cee6eb5ffbaae2c9e4", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.6", "size": 51539, "upload_time": "2019-05-31T09:59:30", "url": "https://files.pythonhosted.org/packages/38/08/a1ad2d487413b2eb9db485683bc534b3ca464a1f237a4d954296192ec5d9/PinPoint-0.2.0.tar.gz" } ] }