{ "info": { "author": "Renchen Sun", "author_email": "sunrenchen@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "woied Python\n\nWelcome to woeid's documentation!\n---------------------------------\n--A Python interface for Yahoo GeoPlanet Web Services REST APIs. Python 2 and 3 are all supported!--\n\n.. image:: https://readthedocs.org/projects/woeid/badge/?version=latest\n :target: http://woeid.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://requires.io/github/Ray-SunR/woeid/requirements.svg?branch=master\n :target: https://requires.io/github/Ray-SunR/woeid/requirements/?branch=master\n :alt: Requirements Status\n\n+----------+-----------------------------------------+\n|Author | Renchen Sun |\n+----------+-----------------------------------------+\n|Email | sunrenchen@gmail.com |\n+----------+-----------------------------------------+\n|Github | https://github.com/Ray-SunR/ |\n+----------+-----------------------------------------+\n|LinkedIn | https://ca.linkedin.com/in/renchensun |\n+----------+-----------------------------------------+\n\n============\nIntroduction\n============\n\nThis library provides a pure Python interface for the `Yahoo GeoPlanet API `_. It works with Python 2.7+ and Python 3.\n\nYahoo! GeoPlanetTM is designed to bridge the gap between the Real and Virtual worlds by providing the Internet with an open, comprehensive, and intelligent infrastructure for geo-referencing data on Earth\u2019s surface.\n\nIn practical terms, Yahoo! GeoPlanet is a resource for managing all geo-permanent named places on earth. It provides the Geographic Developer Community with the vocabulary and grammar to describe the world's geography in an unequivocal, permanent, and language-neutral manner, and is designed to facilitate spatial interoperability and geographic discovery. Developers looking to geo-enable their applications can use GeoPlanet to traverse the spatial hierarchy, identify the geography relevant to their users and their business, and in turn, unambiguously geotag, geotarget, and geolocate data across the Web.\n\n============\nInstallation\n============\n\n--From PyPI-- ::\n\n $ pip install woeid\n\n--From source--\n\nDownload from pypi https://pypi.python.org/pypi/woeid/0.1.4\n\nDownload the latest `woeid` library from: https://github.com/Ray-SunR/woeid\n\nExtract the source distribution and run::\n\n $ python setup.py install\n\n================\nGetting the code\n================\n\nThe code is hosted at `Github` https://github.com/Ray-SunR/woeid\n\nCheck out the latest development version anonymously with::\n\n$ git clone https://github.com/Ray-SunR/woeid.git\n$ cd woeid\n\n=======\nTesting\n=======\n\nNavigate into test folder::\n\n $ cd test\n\nand run::\n\n $ python test.py\n\n===============================\nGetting your application tokens\n===============================\n\nThis section is subject to changes made by Yahoo and may not always be completely up-to-date. If you see something change on their end, please create a `new issue on Github `_ or submit a pull request to update it.\n\n\nIn order to use the woeid API client, you first need to acquire the consumer key. The ``consumer key`` will be required in order to create a ``woeid.Api`` object.\n\n---------------\nCreate your app\n---------------\n\nThe first step in doing so is to create a `Yahoo App `_. Click the \"Create an App\" button and fill out the fields on the next page.\n\n\n.. image:: docs/yahoo-app-creation-part1.png\n\nIf there are any problems with the information on that page, Yahoo will complain and you can fix it. (Make sure to get the name correct - it is unclear if you can change this later.) On the next screen, you'll see the application that you created and some information about it:\n\n--------\nYour app\n--------\n\nOnce your app is created, you'll be directed to a new page showing you some information about it.\n\n.. image:: docs/yahoo-app-creation-part2.png\n\n---------\nYour Keys\n---------\n\nThe stirng which is ecnlosed in red rectangle is your ``consumer key``.\n\n.. image:: docs/yahoo-app-creation-part3.png\n\nAt this point, you can test out your application using the ``consumer key`` to instantiate a ``woeid.Api(client_id=`YOUR_CLIENT_ID`)`` as follows::\n\n import woeid\n api = woeid.Api(client_id=[consumer_key])\n\n========\nExamples\n========\n\n-----------------------------------------\nExample 1: Create an ``woeid`` api object\n-----------------------------------------\n::\n\n import woeid\n api = woeid.Api(client-id=`YOUR-CLIENT-ID`, select='long', format='xml')\n\n # Specify the requesting language\n api.Lang = 'zh-Hans'\n\n # Specify the view\n api.Select = 'short'\n\n # Set the response format\n api.Format = 'json'\n\n # Set the maximum number of records returned\n api.Count = 5\n\n-------------------------------------------------------------------\nExample 2: Retrieving the Most Likely Place for a Given Place Name'\n-------------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetPlaces(q='SFO'))\n\n------------------------------------------------------------------------\nExample 3: Retrieving the Five Most Likely Places for a Given Placename'\n------------------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetPlaces(q=u'\u4e2d\u56fd'))\n\n------------------------------------------------------------------------------\nExample 4: Retrieving All Places for a Given ``place name`` and ``placetype``'\n------------------------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetPlaces(q='Long Island', typ=22, nd=True))\n\n------------------------------------------------------------\nExample 5: Retrieving Places That Have the Given ``woeids``'\n------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetPlaces(woeid=[2488042, 2488836, 2486340]))\n\n------------------------------------------------------\nExample 6: Retrieving a Place Using a Given ``woeid``'\n------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetPlace(woeid=2507854))\n\n-------------------------------------------------------------------------------\nExample 7: Retrieving a Place with a Given ``woeid``, in `short` Representation\n-------------------------------------------------------------------------------\n\n::\n\n api.Select = 'short'\n woeid.PrettyPrintResult(api.GetPlace(woeid=2507854))\n\n-----------------------------------------------------------------------------------------\nExample 8: Retrieving the Parent Place of a Given ``woeid``, as a ``long`` Representation\n-----------------------------------------------------------------------------------------\n\n::\n\n api.Select = 'long'\n woeid.PrettyPrintResult(api.GetPlace(woeid=638242, parent=True))\n\n----------------------------------------------------------\nExample 9. Retrieving the Ancestors for a Given ``woeid``'\n----------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetPlace(woeid=12587712, ancestors=True))\n\n---------------------------------------------------------------------------\nExample 10. Retrieving a Place That is a ``common`` Ancestor of Two Places'\n---------------------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetPlace(woeid=(2507854, 2380824), common=True))\n\n---------------------------------------------------------------------------\nExample 11. Retrieving a Place That is ``common`` Ancestor of Three Places'\n---------------------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetPlace(woeid=(2488042, 2488836, 2486340), common=True))\n\n--------------------------------------\nExample 12. Retrieving All Continents'\n--------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetContinents())\n\n-------------------------------------------------------------------------\nExample 13. Retrieving the Seas Adjacent to or Part of the Pacific Ocean'\n-------------------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetSeas(place='Pacific Ocean'))\n\n---------------------------------------------------------------\nExample 14. Retrieving the Countries Within North America (NA)'\n---------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetCountries(place='NA'))\n\n----------------------------------------------------------------\nExample 15. Retrieving the States Within the United States (US)'\n----------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetStates(country='US'))\n\n-------------------------------------------------------\nExample 16. Retrieving the Districts of Greater London'\n-------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetDistricts(county='Greater London'))\n\n--------------------------------------------------------------------\nExample 17. Retrieving the WOEID and FIPs Code for a Given ISO Code'\n--------------------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetConcordance(namespace='iso', id='CA-BC'))\n\n-----------------------------------------------------------\nExample 18. Retrieving a Partial Collection of Place Types'\n-----------------------------------------------------------\n\n::\n\n woeid.PrettyPrintResult(api.GetPlacetypes(typ=[0,2,22,37,38,15,16]))\n\n\nAbout me\n========\n\n.. image:: favicon1.gif\n\nHello! My name is Renchen. I am a 24-year-old Full-Stack Software Developer from Vancouver BC, Canada.\n\nI consider myself:\n\n\t- A heavy ``vimer``\n\n\t- A\tcommand line lover\n\n\t- Most capable of ``C/C++`` and ``Python`` programming. Also capable of programming in ``Java``, ``Javascript``, ``C#``, ``ObjC``\n\n\t- Comfortable writing portable codes for different platforms (``Windows``, ``Linux``, ``MacOS``, ``iOS``, ``Android``)\n\n\t- Passionate about server-side development (``Node``, ``Meteor``)\n\n\t- An expert in ``OpenXml`` standards", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Ray-SunR/woeid", "keywords": "woeid,geoplanet,yahoo", "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "woeid", "package_url": "https://pypi.org/project/woeid/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/woeid/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Ray-SunR/woeid" }, "release_url": "https://pypi.org/project/woeid/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "A python REST APIs for Yahoo GeoPlanet web services (https://developer.yahoo.com/geo/geoplanet/guide/)", "version": "1.0.0" }, "last_serial": 2239261, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "923bdf7aa9854cf6f7274b67e46df2a5", "sha256": "04717ac7598096a28e767799fb504feabf92bbddfbadcaa55ac3a6d479379987" }, "downloads": -1, "filename": "woeid-1.0.0.tar.gz", "has_sig": false, "md5_digest": "923bdf7aa9854cf6f7274b67e46df2a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14378, "upload_time": "2016-07-23T03:05:08", "url": "https://files.pythonhosted.org/packages/66/a4/2b5d7efc0a1309584d3e9c62e0c0246b47acc301378353c2b33f4763ff09/woeid-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "923bdf7aa9854cf6f7274b67e46df2a5", "sha256": "04717ac7598096a28e767799fb504feabf92bbddfbadcaa55ac3a6d479379987" }, "downloads": -1, "filename": "woeid-1.0.0.tar.gz", "has_sig": false, "md5_digest": "923bdf7aa9854cf6f7274b67e46df2a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14378, "upload_time": "2016-07-23T03:05:08", "url": "https://files.pythonhosted.org/packages/66/a4/2b5d7efc0a1309584d3e9c62e0c0246b47acc301378353c2b33f4763ff09/woeid-1.0.0.tar.gz" } ] }