{ "info": { "author": "Colin Craig", "author_email": "admin@weatherbit.io", "bugtrack_url": null, "classifiers": [], "description": "*******************\n# Python Weather API - Pyweatherbit\n*******************\n\nThis is a wrapper for the Weatherbit API.\n\nThe Weatherbit IO allows you to access forecasts, current data, and historical data. This library wraps this functionality, and makes it accessible with Python.\n\n\n## Installation\n\nYou should use pip to install pyweatherbit.\n\n* To install: pip install pyweatherbit\n* To remove: pip uninstall pyweatherbit\n\n## Requirements\n\n\n- You need an API key to use it. Sign up for the free api [key](https://www.weatherbit.io/pricing \"Free API Key\") to get started.\n\n\n## Basic Use\n\n\nFor additional information, refer to the Weatherbit.io API [documentation](https://www.weatherbit.io/api \"Api Documentation\") .\n\nTo use the wrapper:\n\n```python\n\n\tfrom weatherbit.api import Api\n\tapi_key = \"YOUR API KEY\"\n\tlat = 38.00\n\tlon = -125.75\n\n\tapi = Api(api_key)\n\n\t# Set the granularity of the API - Options: ['daily','hourly','3hourly']\n\t# Will only affect forecast requests.\n\tapi.set_granularity('daily')\n\n\t# Query by lat/lon\n\tforecast = api.get_forecast(lat=lat, lon=long)\n\n\t# You can also query by city:\n\tforecast = api.get_forecast(city=\"Raleigh,NC\")\n\n\t# Or City, state, and country:\n\tforecast = api.get_forecast(city=\"Raleigh\", state=\"North Carolina\", country=\"US\")\n\n\t# To get a daily forecast of temperature, and precipitation:\n\tprint forecast.get_series(['temp','precipitation'])\n\n\t# Get hourly history by lat/lon:\n api.set_granularity('daily')\n\thistory = api.get_history(lat=lat, lon=lon, start_date='2018-02-01',end_date='2018-02-02')\n\n\t# To get a daily time series of temperature, precipitation, and rh:\n\tprint forecast.get_series(['precip','temp','rh'])\n\n\t# Get hourly history by lat/lon\n\tapi.set_granularity('hourly')\n history = api.get_history(lat=lat, lon=lon, start_date='2018-02-01',end_date='2018-02-02')\n\n\t# To get an hourly time series of temperature, precipitation, and rh:\n\tprint forecast.get_series(['precip','temp','rh'])\n\n\t...\n```\n\nThe ``get_forecast()`` method requires named parameters. The current choices are either (lat=..., lon=...), (city=\"City,ST\"), or (city=..., state=..., country=...)\n\n\n### Advanced\n\n#### *function* weatherbit.Api.get_forecast(lat=..., lon=...)\n---------------------------------------------------\n\nThis makes an API request and returns a **Forecast** object (see below).\n\nParameters: \n- **key** - Your API key from https://www.weatherbit.io. \n- **lat** - The latitude of the location for the forecast \n- **lon** - The longitude of the location for the forecast \n- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units. \n\n#### *function* weatherbit.Api.get_forecast(city=..., state=..., country=...)\n---------------------------------------------------\n\nThis makes an API request and returns a **Forecast** object (see below).\n\nParameters:\n- **key** - Your API key from https://www.weatherbit.io. \n- **city** - The City to search by. This can be appended with a state like -> \"City,ST\". \n- **state** - (optional) State of location. \n- **country** - (optional) Country of location \n- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units. \n\n#### *function* weatherbit.Api.get_history(lat=..., lon=...) \n---------------------------------------------------\n\nThis makes an API request and returns a **History** object (see below). \n\nParameters: \n- **key** - Your API key from https://www.weatherbit.io. \n- **lat** - The latitude of the location for the forecast \n- **lon** - The longitude of the location for the forecast \n- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units. \n\n#### *function* weatherbit.Api.get_history(city=..., state=..., country=...) \n--------------------------------------------------- \n\nThis makes an API request and returns a **History** object (see below). \n\nParameters: \n- **key** - Your API key from https://www.weatherbit.io. \n- **city** - The City to search by. This can be appended with a state like -> \"City,ST\". \n- **state** - (optional) State of location. \n- **country** - (optional) Country of location \n- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units. \n\n----------------------------------------------------\n\n\n\n#### *class* forecastio.models.Forecast \n------------------------------------ \n\nThe **Forecast** object, it contains both weather data and the HTTP response from Weatherbit \n\n**Attributes** \n- **http_headers** \n\t\t- A dictionary of response headers. \n- **json**\n\t\t- A dictionary containing the json data returned from the API call. \n- **city_name** \n \t- City Name of the forecast points. \n- **country_code**\n \t- Country Code of the forecast points \n- **state_code**\n \t- State Code of the forecast points \n- **lat** \n \t- Latitude of the forecast points \n- **lon** \n \t- Longitude of the forecast points \n- **points** \n\t- Array of forecast data Point objects. \n\n**Methods** \n- **get_series([var1, var2, ... , varn])** \n\t\t- Returns list of dicts sorted by datetime, containing the desired variables in a time series. \n- **update()** \n\t\t- Refreshes the forecast data by making a new request. \n\n----------------------------------------------------\n\n#### *class* forecastio.models.History \n------------------------------------\n\nThe **History** object, it contains both weather data and the HTTP response from Weatherbit \n\n**Attributes** \n- **response** \n\t\t- The Response object returned from requests request.get() method. \n- **http_headers** \n\t\t- A dictionary of response headers. \n- **json** \n\t\t- A dictionary containing the json data returned from the API call. \n- **city_name** \n \t- City Name of the historical points. \n- **country_code** \n \t- Country Code of the historical points \n- **state_code** \n \t- State Code of the historical points \n- **lat** \n \t- Latitude of the historical points \n- **lon** \n \t- Longitude of the historical points \n- **points** \n\t- Array of historical data Point objects. \n\n**Methods** \n- **get_series([var1, var2, ... , varn])** \n\t\t- Returns list of dicts sorted by datetime, containing the desired variables in a time series. \n- **update()** \n\t\t- Refreshes the forecast data by making a new request. \n\n----------------------------------------------------\n\n#### *class* weatherbit.models.Point\n---------------------------------------------\n\nContains data about a history or forecast over time. \n\n**Attributes** \n- **snow** \n\t\t- Total Snowfall. \n- **precip**\n\t\t- Total Liquid equivalent precipitation. \n- **snow6h** \n\t\t- 6h Total Snowfall. \n- **precip6h** \n\t\t- 6h Total Liquid equivalent precipitation. \n- **datetime** \n\t\t- Datetime object - Datetime (UTC). \n- **wind_dir** \n\t\t- Average Wind direction in degrees (0-360). \n- **wind_spd** \n\t\t- Average Wind speed. \n- **rh** \n\t\t- Average Relative Humidity (%). \n- **clouds** \n\t\t- Average Cloud cover (%). \n- **slp** \n\t\t- Average Sea level pressure in millibars. \n- **temp** \n\t\t- Average Temperature. \n- **max_temp** \n\t\t- Maximum Temperature. (daily only) \n- **min_temp** \n\t\t- Minimum Temperature. (daily only) \n- **weather** \n\t - Dict containing day/night weather icon, description, and code. \n\n----------------------------------------------------\n\n\n#### *class* weatherbit.models.SingleTimePoint \n---------------------------------------------\n\nContains data about a single point in time - Current weather data. \n\n**Attributes** \n- **snow** \n\t\t- Total Snowfall. \n- **precip**\n\t\t- Total Liquid equivalent precipitation. \n- **snow3h** \n\t\t- Total 3h Snowfall. \n- **precip3h** \n\t\t- Total 3h Liquid equivalent precipitation. \n- **datetime** \n\t\t- Datetime object - Datetime (UTC). \n- **sunrise** \n\t\t- Datetime object - Sunrise time (UTC). \n- **sunset** \n\t\t- Datetime object - Sunset time (UTC). \n- **wind_dir** \n\t\t- Wind direction in degrees (0-360). \n- **wind_spd** \n\t\t- Wind speed. \n- **rh** \n\t\t- Relative Humidity (%). \n- **slp** \n\t\t- Sea level pressure in millibars. \n- **temp** \n\t\t- Temperature. \n- **clouds** \n\t\t- Cloud cover (%). \n- **visibility** \n\t\t- Visibility text (for METAR observations only). \n- **station** \n\t\t- Station ID. \n- **weather** \n\t - Dict containing day/night weather icon, description, and code. \n\n----------------------------------------------------\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.weatherbit.io", "keywords": "weather API python wrapper weatherbit.io location", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyweatherbit", "package_url": "https://pypi.org/project/pyweatherbit/", "platform": "", "project_url": "https://pypi.org/project/pyweatherbit/", "project_urls": { "Homepage": "http://www.weatherbit.io" }, "release_url": "https://pypi.org/project/pyweatherbit/2.0.0/", "requires_dist": [ "requests (>=1.6)", "responses" ], "requires_python": "", "summary": "A python weather api wrapper for the Weatherbit.io API.", "version": "2.0.0" }, "last_serial": 4016707, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "50dfa4eda6124a5a97fc097afb76fc83", "sha256": "b190e45e898aa631a856d6a216501052a68e5bf8f8769873816e04f5c8e766ee" }, "downloads": -1, "filename": "pyweatherbit-1.0.0.tar.gz", "has_sig": false, "md5_digest": "50dfa4eda6124a5a97fc097afb76fc83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7022, "upload_time": "2017-02-28T23:09:03", "url": "https://files.pythonhosted.org/packages/76/d6/99bbcafb1a4615add093df2076b02e53670a44bca89a6482908b7937cce9/pyweatherbit-1.0.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "f3a64df97b9253d785af3d3fef7a0268", "sha256": "30a8578105fd8918090d0e6cad2bde9347a7b8ffbde304dfce8021066fa5f428" }, "downloads": -1, "filename": "pyweatherbit-2.0.0.tar.gz", "has_sig": false, "md5_digest": "f3a64df97b9253d785af3d3fef7a0268", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6519, "upload_time": "2018-06-29T21:17:44", "url": "https://files.pythonhosted.org/packages/dd/30/f9e1e0eb21dd256229f3d9b39cffa464eba8f1bf279965f7771aa67a82dd/pyweatherbit-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f3a64df97b9253d785af3d3fef7a0268", "sha256": "30a8578105fd8918090d0e6cad2bde9347a7b8ffbde304dfce8021066fa5f428" }, "downloads": -1, "filename": "pyweatherbit-2.0.0.tar.gz", "has_sig": false, "md5_digest": "f3a64df97b9253d785af3d3fef7a0268", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6519, "upload_time": "2018-06-29T21:17:44", "url": "https://files.pythonhosted.org/packages/dd/30/f9e1e0eb21dd256229f3d9b39cffa464eba8f1bf279965f7771aa67a82dd/pyweatherbit-2.0.0.tar.gz" } ] }