{ "info": { "author": "Rahul Bhargava", "author_email": "rahulb@media.mit.edu", "bugtrack_url": null, "classifiers": [], "description": "Media CLoud CLIFF API Client\n============================\n\nThis is a simple Python client for the `Media Cloud CLIFF-CLAVIN\ngeocoder `__.\n\nUsage\n-----\n\nIf you just want to use this library to talk to a CLIFF server you have\nrunning somewhere, first install it\n\n::\n\n pip install mediacloud-cliff\n\nThen instantiate and use it like this:\n\n.. code:: python\n\n from cliff.api import Cliff\n my_cliff = Cliff('http://myserver.com:8080')\n my_cliff.parse_text(\"This is about Einstien at the IIT in New Delhi.\")\n\nThis will return results like this:\n\n.. code:: json\n\n {\n \"results\": {\n \"organizations\": [\n {\n \"count\": 1,\n \"name\": \"IIT\"\n }\n ],\n \"places\": {\n \"focus\": {\n \"cities\": [\n {\n \"id\": 1261481,\n \"lon\": 77.22445,\n \"name\": \"New Delhi\",\n \"score\": 1,\n \"countryGeoNameId\": \"1269750\",\n \"countryCode\": \"IN\",\n \"featureCode\": \"PPLC\",\n \"featureClass\": \"P\",\n \"stateCode\": \"07\",\n \"lat\": 28.63576,\n \"stateGeoNameId\": \"1273293\",\n \"population\": 317797\n }\n ],\n \"states\": [\n {\n \"id\": 1273293,\n \"lon\": 77.1,\n \"name\": \"National Capital Territory of Delhi\",\n \"score\": 1,\n \"countryGeoNameId\": \"1269750\",\n \"countryCode\": \"IN\",\n \"featureCode\": \"ADM1\",\n \"featureClass\": \"A\",\n \"stateCode\": \"07\",\n \"lat\": 28.6667,\n \"stateGeoNameId\": \"1273293\",\n \"population\": 16787941\n }\n ],\n \"countries\": [\n {\n \"id\": 1269750,\n \"lon\": 79,\n \"name\": \"Republic of India\",\n \"score\": 1,\n \"countryGeoNameId\": \"1269750\",\n \"countryCode\": \"IN\",\n \"featureCode\": \"PCLI\",\n \"featureClass\": \"A\",\n \"stateCode\": \"00\",\n \"lat\": 22,\n \"stateGeoNameId\": \"\",\n \"population\": 1173108018\n }\n ]\n },\n \"mentions\": [\n {\n \"id\": 1261481,\n \"lon\": 77.22445,\n \"source\": {\n \"charIndex\": 37,\n \"string\": \"New Delhi\"\n },\n \"name\": \"New Delhi\",\n \"countryGeoNameId\": \"1269750\",\n \"countryCode\": \"IN\",\n \"featureCode\": \"PPLC\",\n \"featureClass\": \"P\",\n \"stateCode\": \"07\",\n \"confidence\": 1,\n \"lat\": 28.63576,\n \"stateGeoNameId\": \"1273293\",\n \"population\": 317797\n }\n ]\n },\n \"people\": [\n {\n \"count\": 1,\n \"name\": \"Einstien\"\n }\n ]\n },\n \"status\": \"ok\",\n \"milliseconds\": 22,\n \"version\": \"2.4.2\"\n }\n\nYou can also just get info from the GeoNames database inside CLIFF:\n\n.. code:: python\n\n from cliff.api import Cliff\n my_cliff = Cliff('http://myserver.com:8080')\n my_cliff.geonames_lookup(4943351)\n\nThis will give you results like this:\n\n.. code:: json\n\n {\n \"results\": {\n \"id\": 4943351,\n \"lon\": -71.09172,\n \"name\": \"Massachusetts Institute of Technology\",\n \"countryGeoNameId\": \"6252001\",\n \"countryCode\": \"US\",\n \"featureCode\": \"SCH\",\n \"featureClass\": \"S\",\n \"parent\": {\n \"id\": 4943909,\n \"lon\": -71.39184,\n \"name\": \"Middlesex County\",\n \"countryGeoNameId\": \"6252001\",\n \"countryCode\": \"US\",\n \"featureCode\": \"ADM2\",\n \"featureClass\": \"A\",\n \"parent\": {\n \"id\": 6254926,\n \"lon\": -71.10832,\n \"name\": \"Massachusetts\",\n \"countryGeoNameId\": \"6252001\",\n \"countryCode\": \"US\",\n \"featureCode\": \"ADM1\",\n \"featureClass\": \"A\",\n \"parent\": {\n \"id\": 6252001,\n \"lon\": -98.5,\n \"name\": \"United States\",\n \"countryGeoNameId\": \"6252001\",\n \"countryCode\": \"US\",\n \"featureCode\": \"PCLI\",\n \"featureClass\": \"A\",\n \"stateCode\": \"00\",\n \"lat\": 39.76,\n \"stateGeoNameId\": \"\",\n \"population\": 310232863\n },\n \"stateCode\": \"MA\",\n \"lat\": 42.36565,\n \"stateGeoNameId\": \"6254926\",\n \"population\": 6433422\n },\n \"stateCode\": \"MA\",\n \"lat\": 42.48555,\n \"stateGeoNameId\": \"6254926\",\n \"population\": 1503085\n },\n \"stateCode\": \"MA\",\n \"lat\": 42.35954,\n \"stateGeoNameId\": \"6254926\",\n \"population\": 0\n },\n \"status\": \"ok\",\n \"version\": \"2.4.2\"\n }\n\nDevelopment\n-----------\n\nIf you want to work on this API client, then first clone `the source\nrepo from GitHub `__\nand install the dependencies\n\n::\n\n pip install -r requirements.pip\n\nThen copy ``settings.config.sample`` to ``settings.config`` and put in\nthe url and port of your CLIFF server. Now you should be able to\ndevelop!\n\nDistribution\n------------\n\n1. Run ``python test.py`` to make sure all the test pass\n2. Update the version number in ``cliff/__init__.py``\n3. Make a brief note in the version history section in the README file\n about the changes\n4. Run ``python setup.py sdist`` to test out a version locally\n5. Then run ``python setup.py sdist upload -r pypitest`` to release a\n test version to PyPI's test server\n6. Run ``pip install -i https://testpypi.python.org/pypi mediacloud``\n somewhere and then use it with Python to make sure the test release\n works.\n7. When you're ready to push to pypi run\n ``python setup.py sdist upload -r pypi``\n8. Run ``pip install mediacloud-cliff`` somewhere and then try it to\n make sure it worked.\n\nVersion History\n---------------\n\n- **v2.1.0**: upgrade to CLIFF v2.4.2\n- **v2.0.2**: update examples in readme file\n- **v2.0.1**: init with url instead of host/port\n- **v2.0.0**: move to mediacloud naming, underscored method names,\n remove deprecated NLP endpoint\n- **v1.4.0**: upgrade to CLIFF v2.4.1, add support for extractContent\n endpoint\n- **v1.3.1**: updates for python3\n- **v1.3.0**: updates for python3, support for client-side text\n replacements\n- **v1.2.0**: points at CLIFF v2.3.0 (updates Stanford NER & has new\n plugin architecture)\n- **v1.1.0**: points at CLIFF v2.2.0 (adds ancestry to\n ``geonamesLookup`` helper)\n- **v1.0.2**: first release to PyPI\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://cliff.mediacloud.org", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "mediacloud-cliff", "package_url": "https://pypi.org/project/mediacloud-cliff/", "platform": "", "project_url": "https://pypi.org/project/mediacloud-cliff/", "project_urls": { "Homepage": "http://cliff.mediacloud.org" }, "release_url": "https://pypi.org/project/mediacloud-cliff/2.1.0/", "requires_dist": null, "requires_python": "", "summary": "Media Cloud CLIFF API Client Library", "version": "2.1.0" }, "last_serial": 4705039, "releases": { "2.0.2": [ { "comment_text": "", "digests": { "md5": "d8a7b39d03d6a0e259dba10cbf96adf3", "sha256": "811d66748227d85636c3c22b701083f1853d5b420659ff2e9ca3ffd9198de5cb" }, "downloads": -1, "filename": "mediacloud-cliff-2.0.2.tar.gz", "has_sig": false, "md5_digest": "d8a7b39d03d6a0e259dba10cbf96adf3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5465, "upload_time": "2017-11-08T15:01:01", "url": "https://files.pythonhosted.org/packages/3b/72/975f5b8f0d99ce66afb2411f1e3fafd0d86a3b9ade1dd1f779f360ae42b2/mediacloud-cliff-2.0.2.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "98128b2e3644c6719b4d3cc122163ba1", "sha256": "0ae82d9ea28b780a9b2222a8412a8886704c49237af11beade4063b52388daa4" }, "downloads": -1, "filename": "mediacloud-cliff-2.1.0.tar.gz", "has_sig": false, "md5_digest": "98128b2e3644c6719b4d3cc122163ba1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5452, "upload_time": "2019-01-16T20:24:31", "url": "https://files.pythonhosted.org/packages/d6/e1/786ccd0569bd30fd0c19a8d395d10854e5e0b9a358cbb8e597c1e3549ba3/mediacloud-cliff-2.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "98128b2e3644c6719b4d3cc122163ba1", "sha256": "0ae82d9ea28b780a9b2222a8412a8886704c49237af11beade4063b52388daa4" }, "downloads": -1, "filename": "mediacloud-cliff-2.1.0.tar.gz", "has_sig": false, "md5_digest": "98128b2e3644c6719b4d3cc122163ba1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5452, "upload_time": "2019-01-16T20:24:31", "url": "https://files.pythonhosted.org/packages/d6/e1/786ccd0569bd30fd0c19a8d395d10854e5e0b9a358cbb8e597c1e3549ba3/mediacloud-cliff-2.1.0.tar.gz" } ] }