{ "info": { "author": "Tyler Santos", "author_email": "1tsantos7+wunderweather@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Programming Language :: Python :: 3.5" ], "description": ".. This package and all of its contents are supplied \"as-is\" and follow\n\tthe GNU General Public License\n\thttps://www.gnu.org/licenses/gpl.txt\n\nWelcome to WunderWeather!\n=========================================\n\nWhether you're already a user and want a refresher on the documentation or you're evaluating the package for the first time, you've come to the right place. So what do you want to learn more about?\n\n\n.. contents::\n\t:local:\n\nIntroduction\n************\n\nWunderWeather attempts to expose data supplied by `Weather Underground `_ in a way that is easy to use and easy to get weather data into your application quickly without having to deal with all of the details. \n\nAbout the Wunderground API\n##########################\n\nThe Wunderground API supplies different endpoints called `data features `_ which, when supplied the proper arguments, return numerous data points describing the feature being queried. \n\n`Documentation `_\n\nAbout the WunderWeather API\n###########################\n\nWunderWeather was built to expose the data supplied by Wunderground in a uniform fashion. For certain data features where it applied, wrapper classes were created to normalize the data returned and supply ease of access to that data. \n\nWhen developing WunderWeather there were a few key concepts kept in mind which are listed below. If you intend on contributing, please keep these ideas in mind.\n\t#. Out of the hundreds of data points that Wunderground so graciously supplies, expose shortcuts to the more frequently used/popular data points such as temperature and date through the data feature specific wrappers.\n\t\t#. For the history data feature, Wunderground exposes the average temperature data point using 3 keys rather than the one abstracted in WunderWeather\n\t\t\n\t\t**Wunderground:** \n\n\t\t>>> response[\"history\"][\"daily_summary\"][\"meantempi\"]\n\t\t\n\t\t**WunderWeather:**\n\n\t\t>>> response.temp_f\n\n\t#. Normalize the data point names being exposed.\n\t\t#. The Wunderground API does a great job at supplying endless amounts of weather data but unfortunately similar data points across different features have different names. A case where this crops up frequently is for imperial (i) and metric (m) and their respective Fahrenheit (f) and Celsius (c) identifiers for temperature. \n\t\t\n\t\t**Example Data Points:**\n\t\t \n\t\t* temp_i vs temp_f\n\t\t* temp_m vs temp_c \n\nInstallation\n############\n\n``pip install WunderWeather``\n\nCode Examples\n#############\n\nThe following code snippets are examples of extracting data from data feature responses. Some examples build off of previous examples (as to avoid repetition) but should be properly documented as ``continuation from NNN example``.\n\n.. warning::\n\n\tThe WunderWeather package is only Python 3 compatible. \n\n.. note::\n\n\tBecause the `requests package `_ is awesome, we're going to be using that to make our requests in the following examples. We use it to make requests in our package and so should you!\n\nWeather Underground Example\n----------------------------\n\n**Not using Requests**\n\n*Example listed in Wunderground documentation*\n\n.. code:: python\n\n\timport urllib2\n\timport json\n\tf = urllib2.urlopen('http://api.wunderground.com/api//geolookup/conditions/q/IA/Cedar_Rapids.json')\n\tjson_string = f.read()\n\tparsed_json = json.loads(json_string)\n\tlocation = parsed_json['location']['city']\n\ttemp_f = parsed_json['current_observation']['temp_f']\n\tprint \"Current temperature in %s is: %s\" % (location, temp_f)\n\tf.close()\n\n`example `_\n\n**Using Requests**\n\n*Example listed in Wunderground doc converted to use requests*\n\n.. code:: python\n\n\timport requests # learn more: https://python.org/pypi/requests\n\tresponse = requests.get('http://api.wunderground.com/api//geolookup/conditions/q/MA/Boston.json').json()\n\tlocation = response['location']['city']\n\ttemp_f = response['current_observation']['temp_f']\n\tprint(\"Current Temperature in %s is: %s\" %(location,temp_f))\n\n**Using WunderWeather**\n\n*Example listed in Wunderground doc converted to use WunderWeather*\n\n.. code:: python\n\n\tfrom wunder import weather\n\textractor = weather.Extract(api_key)\n\t[location,current] = extractor.features(\"MA/Boston\",(('geolookup',''),('now','')))\n\tprint(\"Current Temperature in %s is: %s\" %(location.data.city,current.temp_f))\n\n*In the example above, notice how data points can be extracted from a feature using dotted notation whether there is a feature specific wrapper class or not to provide a uniform look in the calling application. When referencing shortcuts from wrapper classes or directly accessing the data, the look is the same. As of writing this documentation Geolookup does not have a wrapper so all data extracted from that feature must use the* ``WeatherBase.data`` *member to use the dotted notation.*\n\nAdditional Examples\n-------------------\n\n.. code:: python\n\n From pprint import pprint\n import arrow\n From WunderWeather import weather\n\n # setup\n api_key = \"your api key\"\n location = 'MA/Boston'\n extractor = weather.Extract(api_key)\n\n # alerts\n response = extractor.alerts(location)\n pprint(response.data)\n\n # astronomy\n response = extractor.astronomy(location)\n pprint(response.data)\n\n # geolookup\n response = extractor.geolookup(location)\n pprint(response.data)\n\n # history\n date = arrow.get(\"20170601\",\"YYYYMMDD\")\n response = extractor.date(location,date.format('YYYYMMDD'))\n pprint(response.data)\n\n # addl date detail\n for observation in response.observations:\n print(\"Date:\",observation.date_pretty)\n print(\"Temp:\",observation.temp_f)\n\nContributors\n************\n\nThanks for checking out this section and showing interest in making this package better. The following are points of interest that could use polishing or expanding. As always, if you see data points across data features that could use a level of abstraction just add a wrapper class if not already defined and add a property member to that class to provide a shortcut or normalized external name across features. \n\nTODOs\n#######\n\n#. Several Data Features only exist using the generic WeatherBase, base class and thus their data is accessed using the data member. There are likely reasons to create wrappers for these features. current hurricane seemed to need a wrapper the most. But some others that might benefit from abstraction are listed below.\n\t#. currenthurricane\n\t#. rawtide and tide\n\t#. hourly\\* based features\n#. And of course, help with documentation, documentation, and more documentation.\n\n\nMentions\n********\n\nI just want give mention and thanks to the following:\n\n#. `Weather Underground `_ for supplying the data.\n#. `requests `_ for making http for me.\n\t\n\t* `requests github `_\n\n#. `EasyDict `_ for supplying the dotted dictionary notation functionality.\n\n\t* `EasyDict github `_", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/T-Santos/WunderWeather", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://wunderweather.readthedocs.io/en/latest/", "keywords": "weather,wunderground", "license": "", "maintainer": "", "maintainer_email": "", "name": "WunderWeather", "package_url": "https://pypi.org/project/WunderWeather/", "platform": "", "project_url": "https://pypi.org/project/WunderWeather/", "project_urls": { "Download": "https://github.com/T-Santos/WunderWeather", "Homepage": "http://wunderweather.readthedocs.io/en/latest/" }, "release_url": "https://pypi.org/project/WunderWeather/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Wrapper for Weather Underground API", "version": "1.1.0" }, "last_serial": 3739636, "releases": { "0.2.6": [ { "comment_text": "", "digests": { "md5": "dc788944f62909d97d3f00ceccbab324", "sha256": "d09e446b1678bca151187b9205f1f7a5e9ebc08f31450f676f1e4910584c7652" }, "downloads": -1, "filename": "WunderWeather-0.2.6.tar.gz", "has_sig": false, "md5_digest": "dc788944f62909d97d3f00ceccbab324", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24926, "upload_time": "2017-11-20T02:32:46", "url": "https://files.pythonhosted.org/packages/38/53/29b434b71485e6a6daacd8391740933ae430bc485906d0ced7ad7013b34f/WunderWeather-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "a1fb3d92624c2c34a0b156feedb52b30", "sha256": "156b041eb4a9e46995f227491b2205a1c156d9cbcb0cc5b2504e1225052d4d97" }, "downloads": -1, "filename": "WunderWeather-0.2.7.tar.gz", "has_sig": false, "md5_digest": "a1fb3d92624c2c34a0b156feedb52b30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25076, "upload_time": "2017-11-20T03:16:19", "url": "https://files.pythonhosted.org/packages/dc/d1/60544848ff7b0eb75f645b7dcfed3a04a9d9ee7758ea4953a615a05a07c6/WunderWeather-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "b851b6483abc0e042c7a85bfb03f0c1b", "sha256": "bda9810d93b7216b8ee67e071e69353200700dcc200b5a597c5362e9bd3fd964" }, "downloads": -1, "filename": "WunderWeather-0.2.8.tar.gz", "has_sig": false, "md5_digest": "b851b6483abc0e042c7a85bfb03f0c1b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28332, "upload_time": "2017-11-25T16:25:55", "url": "https://files.pythonhosted.org/packages/33/2c/5390466491d9b95f26bc149a1a31e4d56028c0f539d39e48dbfaf5fa387c/WunderWeather-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "f12fbf3c7647c71cbab668d12eb849b4", "sha256": "e21e439ff72a4fcf7a41c4758b8882fc1cb47de5ccc53dfa3409d19fb32e0413" }, "downloads": -1, "filename": "WunderWeather-0.2.9.tar.gz", "has_sig": false, "md5_digest": "f12fbf3c7647c71cbab668d12eb849b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28368, "upload_time": "2017-12-03T20:27:00", "url": "https://files.pythonhosted.org/packages/92/27/b6f656c43c9f85ed616467bfd58cfcc610a9220e6a55fdc3349014804c10/WunderWeather-0.2.9.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "467ac62775845ab96899caf21d04a685", "sha256": "89bb14de90c70a6fcbd07a13c196dbcff062035328f017bf4f464c7c96cbd1bb" }, "downloads": -1, "filename": "WunderWeather-0.3.0.tar.gz", "has_sig": false, "md5_digest": "467ac62775845ab96899caf21d04a685", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28366, "upload_time": "2017-12-05T23:08:18", "url": "https://files.pythonhosted.org/packages/5d/8f/d3b5fb1ad51824174ff1cea8e1206ecc028260ca4f3902d81622b16a3149/WunderWeather-0.3.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "d172f01e3b9c692e34ed214003363f1d", "sha256": "73fa07ccae1e6f579e4aea914ce8c1531f797cd0b4c96b82df53b5c235957338" }, "downloads": -1, "filename": "WunderWeather-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d172f01e3b9c692e34ed214003363f1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29003, "upload_time": "2017-12-16T18:43:54", "url": "https://files.pythonhosted.org/packages/6d/01/d1feae60796015e74405faa006e965c6927ca8d2936b7c540c24d772def2/WunderWeather-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "d35d9860bf727506037839688989749e", "sha256": "7156a98fae2aca1213b664ec5b4fa09149ba6b40bd5fea1799da8ff2368a5e68" }, "downloads": -1, "filename": "WunderWeather-1.1.0.tar.gz", "has_sig": false, "md5_digest": "d35d9860bf727506037839688989749e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29029, "upload_time": "2018-04-06T01:33:02", "url": "https://files.pythonhosted.org/packages/04/5a/0f29a58369f0e490b0201e5788af7b89e8711a132bd8fe18d421311d8b8c/WunderWeather-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d35d9860bf727506037839688989749e", "sha256": "7156a98fae2aca1213b664ec5b4fa09149ba6b40bd5fea1799da8ff2368a5e68" }, "downloads": -1, "filename": "WunderWeather-1.1.0.tar.gz", "has_sig": false, "md5_digest": "d35d9860bf727506037839688989749e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29029, "upload_time": "2018-04-06T01:33:02", "url": "https://files.pythonhosted.org/packages/04/5a/0f29a58369f0e490b0201e5788af7b89e8711a132bd8fe18d421311d8b8c/WunderWeather-1.1.0.tar.gz" } ] }