pyweatherbit


Namepyweatherbit JSON
Version 2.2.2 PyPI version JSON
download
home_pagehttp://www.weatherbit.io
SummaryA python weather api wrapper for the Weatherbit.io API.
upload_time2024-02-14 00:41:12
maintainer
docs_urlNone
authorColin Craig
requires_python>=3.7
licenseMIT License Copyright (c) 2017 weatherbit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords weather api python wrapper weatherbit
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            *******************
# Python Weather API - Pyweatherbit
*******************

This is a wrapper for the Weatherbit API.

The Weatherbit IO allows you to access forecasts, current data, and historical data. This library wraps this functionality, and makes it accessible with Python.


## Installation

You should use pip to install pyweatherbit.

* To install: pip install pyweatherbit
* To remove:  pip uninstall pyweatherbit

## Requirements


- 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.


## Basic Use


For additional information, refer to the Weatherbit.io API [documentation](https://www.weatherbit.io/api "Api Documentation") .

To use the wrapper:

```python

	from weatherbit.api import Api
	api_key = "YOUR API KEY"
	lat = 35.50
	lon = -78.50

	api = Api(api_key)

	# Currently supported tp options (time period):
	# History: daily, hourly, subhourly
	# AGWeather History: daily, hourly
	# Forecast: daily, hourly, minutely
	# Air quality: hourly
	# Will only affect forecast requests.

	### Forecasts (daily)

	# Query by lat/lon - get extended forecast out to 240 hours (default 48 hours)
	api.get_forecast(lat=lat, lon=lon, days=10, tp='daily').get()

	# You can also query by city:
	api.get_forecast(city="Raleigh,NC", days=10, tp='daily').get()

	# Or City, state, and country:
	api.get_forecast(city="Raleigh", state="North Carolina", country="US", days=10, tp='daily').get()

	# Or Postal code:
	# See documentation for field names: https://www.weatherbit.io/api
	api.get_forecast(postal_code="27601", country="US", days=10, tp='daily').get(['high_temp','low_temp','precip','weather'])

	### Forecasts (hourly)

	# Query by lat/lon - get extended forecast out to 240 hours (default 48 hours)
	api.get_forecast(lat=lat, lon=lon, hours=240, tp='hourly').get()

	# Or Postal code:
	api.get_forecast(postal_code="27601", country="US", hours=240, tp='hourly').get()


	### Forecasts (hourly - Air quality)
	# Get an hourly air quality forecast for a lat/lon
	api.get_forecast(source='airquality', lat=lat, lon=lon, tp='hourly').get()

	### Forecasts (minutely / Nowcast)

	# Query by lat/lon - get 60 minute precip nowcast.
	api.get_forecast(lat=lat, lon=lon, tp='minutely').get()

	### HISTORY

	# Get sub-hourly history by lat/lon, with imperial units.
	# get time series of temperature, precipitation, and rh:
	api.get_history(lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-02', tp='subhourly', units="I").get(['precip','temp','rh'])
	# Or get all values. This time with metric units.
	api.get_history(lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-02', tp='subhourly', units="M").get()

	# Get daily history by lat/lon
	api.get_history(lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-02', tp='daily').get()

	# Get historical air quality data
	api.get_history(source='airquality', lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-02', tp='hourly').get()

	# Get daily climate normals for March for location:
	api.get_normals(lat=lat, lon=lon, start_day='03-01',end_day='04-01', tp='daily').get()

	# Get daily climate normals for September - December for location:
	# Select a few fields.
	api.get_normals(lat=lat, lon=lon, start_day='09-01',end_day='01-01', tp='monthly').get(['max_temp', 'min_temp', 'precip'])

	# Get daily historical AGWeather data. Select a few fields.
	api.get_history(source='agweather', lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-10', tp='daily').get(['evapotranspiration', 'soilt_0_10cm', 'v_soilm_0_10cm'])

	# Get hourly historical AGWeather data. This time, get all fields.
	api.get_history(source='agweather', lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-10', tp='hourly').get()


	### Current Conditions

	# Get current air quality. Select a few fields.
	api.get_current(source='airquality', lat=lat, lon=lon).get(['aqi','pm10','pm25'])

	# Get current conditions for select fields.
	api.get_current(lat=lat, lon=lon).get(['weather','temp','precip'])

	# Or simply get() for all values. This time with imperial units.
	api.get_current(lat=lat, lon=lon, units="I").get()

	# Get weather alerts for a location
	api.get_alerts(lat=lat, lon=lon).get()

	# Get current conditions with alerts, and a minutely forecast for a location
	api.get_current(lat=lat, lon=lon, include="alerts,minutely").get()

	...
```


### Advanced

#### *function* weatherbit.Api.get_forecast(lat=..., lon=...)
---------------------------------------------------

This makes an API request and returns a **Forecast** object (see below).

Parameters:  
- **key** - Your API key from https://www.weatherbit.io.  
- **lat** - The latitude of the location for the forecast  
- **lon** - The longitude of the location for the forecast  
- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units.  
- **source** - (optional) "airquality" or "agweather" - to return airquality/agweather data instead.  
- **tp** - (optional) A string denoting the time period of data 'minutely', 'hourly' or 'daily'.  

#### *function* weatherbit.Api.get_forecast(city=..., state=..., country=...)
---------------------------------------------------

This makes an API request and returns a **Forecast** object (see below).

Parameters:
- **key** - Your API key from https://www.weatherbit.io.  
- **city** - The City to search by. This can be appended with a state like -> "City,ST".  
- **state** - (optional) State of location.  
- **country** - (optional) Country of location  
- **source** - (optional) "airquality" or "agweather" - to return airquality/agweather data instead.  
- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units.  
- **tp** - (optional) A string denoting the time period of data 'minutely', 'hourly' or 'daily'.  

#### *function* weatherbit.Api.get_forecast(postal_code=..., country=...)
---------------------------------------------------

This makes an API request and returns a **Forecast** object (see below).

Parameters:
- **key** - Your API key from https://www.weatherbit.io.  
- **postal_code** - postal code.  
- **country** - (recommended) Country of location  
- **source** - (optional) "airquality" or "agweather" - to return airquality/agweather data instead.  
- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units.  
- **tp** - (optional) A string denoting the time period of data 'minutely', 'hourly' or 'daily'.  
  
#### *function* weatherbit.Api.get_history(lat=..., lon=..., start_date=..., end_date=...)  
---------------------------------------------------
  
This makes an API request and returns a **History** object (see below).  
  
Parameters:  
- **key** - Your API key from https://www.weatherbit.io.  
- **start_date** - Start date of data  
- **end_date** - End date of data  
- **lat** - The latitude of the location  
- **lon** - The longitude of the location    
- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units.  
- **source** - (optional) "airquality" or "agweather" - to return airquality/agweather data instead.  
- **tp** - (optional) A string denoting the time period of data 'hourly' or 'daily' or 'subhourly'.  

#### *function* weatherbit.Api.get_history(city=..., state=..., country=..., start_date=..., end_date=...)  
---------------------------------------------------  
  
This makes an API request and returns a **History** object (see below).   
  
Parameters:  
- **key** - Your API key from https://www.weatherbit.io.  
- **start_date** - Start date of data  
- **end_date** - End date of data  
- **city** - The City to search by. This can be appended with a state like -> "City,ST".  
- **state** - (optional) State of location.  
- **country** - (optional) Country of location  
- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units.   
- **source** - (optional) "airquality" or "agweather" - to return airquality/agweather data instead.  
- **tp** - (optional) A string denoting the time period of data 'hourly' or 'daily' or 'subhourly'. 

#### *function* weatherbit.Api.get_history(postal_code=..., country=..., start_date=..., end_date=...)  
---------------------------------------------------  
  
This makes an API request and returns a **History** object (see below).   
  
Parameters:  
- **key** - Your API key from https://www.weatherbit.io.  
- **start_date** - Start date of data  
- **end_date** - End date of data  
- **postal_code** - postal code.  
- **country** - (recommended) Country of location  
- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units.   
- **source** - (optional) "airquality" or "agweather" - to return airquality/agweather data instead.  
- **tp** - (optional) A string denoting the time period of data 'hourly' or 'daily' or 'subhourly'. 

----------------------------------------------------

#### *function* weatherbit.Api.get_current(postal_code=..., country=..., start_date=..., end_date=...)  
---------------------------------------------------  
  
This makes an API request and returns a **Current Data** object (see below).   
  
Parameters:  
- **key** - Your API key from https://www.weatherbit.io.  
- **postal_code** - postal code.  
- **country** - (recommended) Country of location  
- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units.   
- **source** - (optional) "airquality" - to return airquality data instead.  
- **include** - (optional) comma separated value of extra data responses to include. Ie. "alerts" or "minutely", or both "alerts,minutely". "alerts" being severe weather alerts, and "minutely" being a minutely nowcast.  

----------------------------------------------------

#### *function* weatherbit.Api.get_current(lat=..., lon=..., country=..., start_date=..., end_date=...)  
---------------------------------------------------  
  
This makes an API request and returns a **Current Data** object (see below).   
  
Parameters:  
- **key** - Your API key from https://www.weatherbit.io.  
- **lat** - The latitude of the location  
- **lon** - The longitude of the location  
- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units.   
- **source** - (optional) "airquality" - to return airquality data instead.  
- **include** - (optional) comma separated value of extra data responses to include. Ie. "alerts" or "minutely", or both "alerts,minutely". "alerts" being severe weather alerts, and "minutely" being a minutely nowcast.  

----------------------------------------------------

#### *function* weatherbit.Api.get_current(city=..., state=..., country=...)  
---------------------------------------------------  
  
This makes an API request and returns a **Current Data** object (see below).   
  
Parameters:  
- **key** - Your API key from https://www.weatherbit.io.  
- **city** - The City to search by. This can be appended with a state like -> "City,ST".  
- **state** - (optional) State of location.  
- **country** - (optional) Country of location  
- **units** - (optional) A string of the preferred units of measurement. Choices are currently 'S' for scientific, 'M' for Metric, or 'I' for imperial units.   
- **source** - (optional) "airquality" - to return airquality data instead.  
- **include** - (optional) comma separated value of extra data responses to include. Ie. "alerts" or "minutely", or both "alerts,minutely". "alerts" being severe weather alerts, and "minutely" being a minutely nowcast.  

----------------------------------------------------

----------------------------------------------------

#### *function* weatherbit.Api.get_alerts(lat=... , lon=...)  
---------------------------------------------------  
  
This makes an API request and returns a **Alert** object (see below).   
  
Parameters:  
- **key** - Your API key from https://www.weatherbit.io.  
- **lat** - The latitude of the location for the forecast  
- **lon** - The longitude of the location for the forecast  

----------------------------------------------------


----------------------------------------------------

#### *function* weatherbit.Models.Current.get(api_vars=[])  
---------------------------------------------------  
  
Gets data from Current Weather API Response (weatherbit.Api.get_current).
  
Parameters:  
- **api_vars** - Optional list of vars to retrieve from API. 

----------------------------------------------------


----------------------------------------------------

#### *function* weatherbit.Models.Alert.get()  
---------------------------------------------------  
  
Gets data from Current Weather API Response (weatherbit.Api.get_current).
 

----------------------------------------------------

----------------------------------------------------

#### *function* weatherbit.Models.Forecast.get(api_vars=[])  
---------------------------------------------------  
  
Gets data from Forecast API Response (weatherbit.Api.get_forecast).  
  
Parameters:  
- **api_vars** - Optional list of vars to retrieve from API. 

----------------------------------------------------

----------------------------------------------------

#### *function* weatherbit.Models.History.get(api_vars=[])  
---------------------------------------------------  
  
Gets data from History Weather API Response (weatherbit.Api.get_history).  
  
Parameters:  
- **api_vars** - Optional list of vars to retrieve from API. 

----------------------------------------------------

----------------------------------------------------

#### *function* weatherbit.Models.Normals.get(api_vars=[])  
---------------------------------------------------  
  
Gets data from Normals API Response (weatherbit.Api.get_normals).  
  
Parameters:  
- **api_vars** - Optional list of vars to retrieve from API. 

----------------------------------------------------



            

Raw data

            {
    "_id": null,
    "home_page": "http://www.weatherbit.io",
    "name": "pyweatherbit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "weather,API,python,wrapper,weatherbit",
    "author": "Colin Craig",
    "author_email": "Colin Craig <colin@weatherbit.io>",
    "download_url": "https://files.pythonhosted.org/packages/c8/26/090329c1abc30144f140da7a72e30196975a23c87d360eed910f64efa0f6/pyweatherbit-2.2.2.tar.gz",
    "platform": null,
    "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 = 35.50\n\tlon = -78.50\n\n\tapi = Api(api_key)\n\n\t# Currently supported tp options (time period):\n\t# History: daily, hourly, subhourly\n\t# AGWeather History: daily, hourly\n\t# Forecast: daily, hourly, minutely\n\t# Air quality: hourly\n\t# Will only affect forecast requests.\n\n\t### Forecasts (daily)\n\n\t# Query by lat/lon - get extended forecast out to 240 hours (default 48 hours)\n\tapi.get_forecast(lat=lat, lon=lon, days=10, tp='daily').get()\n\n\t# You can also query by city:\n\tapi.get_forecast(city=\"Raleigh,NC\", days=10, tp='daily').get()\n\n\t# Or City, state, and country:\n\tapi.get_forecast(city=\"Raleigh\", state=\"North Carolina\", country=\"US\", days=10, tp='daily').get()\n\n\t# Or Postal code:\n\t# See documentation for field names: https://www.weatherbit.io/api\n\tapi.get_forecast(postal_code=\"27601\", country=\"US\", days=10, tp='daily').get(['high_temp','low_temp','precip','weather'])\n\n\t### Forecasts (hourly)\n\n\t# Query by lat/lon - get extended forecast out to 240 hours (default 48 hours)\n\tapi.get_forecast(lat=lat, lon=lon, hours=240, tp='hourly').get()\n\n\t# Or Postal code:\n\tapi.get_forecast(postal_code=\"27601\", country=\"US\", hours=240, tp='hourly').get()\n\n\n\t### Forecasts (hourly - Air quality)\n\t# Get an hourly air quality forecast for a lat/lon\n\tapi.get_forecast(source='airquality', lat=lat, lon=lon, tp='hourly').get()\n\n\t### Forecasts (minutely / Nowcast)\n\n\t# Query by lat/lon - get 60 minute precip nowcast.\n\tapi.get_forecast(lat=lat, lon=lon, tp='minutely').get()\n\n\t### HISTORY\n\n\t# Get sub-hourly history by lat/lon, with imperial units.\n\t# get time series of temperature, precipitation, and rh:\n\tapi.get_history(lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-02', tp='subhourly', units=\"I\").get(['precip','temp','rh'])\n\t# Or get all values. This time with metric units.\n\tapi.get_history(lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-02', tp='subhourly', units=\"M\").get()\n\n\t# Get daily history by lat/lon\n\tapi.get_history(lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-02', tp='daily').get()\n\n\t# Get historical air quality data\n\tapi.get_history(source='airquality', lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-02', tp='hourly').get()\n\n\t# Get daily climate normals for March for location:\n\tapi.get_normals(lat=lat, lon=lon, start_day='03-01',end_day='04-01', tp='daily').get()\n\n\t# Get daily climate normals for September - December for location:\n\t# Select a few fields.\n\tapi.get_normals(lat=lat, lon=lon, start_day='09-01',end_day='01-01', tp='monthly').get(['max_temp', 'min_temp', 'precip'])\n\n\t# Get daily historical AGWeather data. Select a few fields.\n\tapi.get_history(source='agweather', lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-10', tp='daily').get(['evapotranspiration', 'soilt_0_10cm', 'v_soilm_0_10cm'])\n\n\t# Get hourly historical AGWeather data. This time, get all fields.\n\tapi.get_history(source='agweather', lat=lat, lon=lon, start_date='2024-02-01',end_date='2024-02-10', tp='hourly').get()\n\n\n\t### Current Conditions\n\n\t# Get current air quality. Select a few fields.\n\tapi.get_current(source='airquality', lat=lat, lon=lon).get(['aqi','pm10','pm25'])\n\n\t# Get current conditions for select fields.\n\tapi.get_current(lat=lat, lon=lon).get(['weather','temp','precip'])\n\n\t# Or simply get() for all values. This time with imperial units.\n\tapi.get_current(lat=lat, lon=lon, units=\"I\").get()\n\n\t# Get weather alerts for a location\n\tapi.get_alerts(lat=lat, lon=lon).get()\n\n\t# Get current conditions with alerts, and a minutely forecast for a location\n\tapi.get_current(lat=lat, lon=lon, include=\"alerts,minutely\").get()\n\n\t...\n```\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- **source** - (optional) \"airquality\" or \"agweather\" - to return airquality/agweather data instead.  \n- **tp** - (optional) A string denoting the time period of data 'minutely', 'hourly' or 'daily'.  \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- **source** - (optional) \"airquality\" or \"agweather\" - to return airquality/agweather data instead.  \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- **tp** - (optional) A string denoting the time period of data 'minutely', 'hourly' or 'daily'.  \n\n#### *function* weatherbit.Api.get_forecast(postal_code=..., 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- **postal_code** - postal code.  \n- **country** - (recommended) Country of location  \n- **source** - (optional) \"airquality\" or \"agweather\" - to return airquality/agweather data instead.  \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- **tp** - (optional) A string denoting the time period of data 'minutely', 'hourly' or 'daily'.  \n  \n#### *function* weatherbit.Api.get_history(lat=..., lon=..., start_date=..., end_date=...)  \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- **start_date** - Start date of data  \n- **end_date** - End date of data  \n- **lat** - The latitude of the location  \n- **lon** - The longitude of the 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- **source** - (optional) \"airquality\" or \"agweather\" - to return airquality/agweather data instead.  \n- **tp** - (optional) A string denoting the time period of data 'hourly' or 'daily' or 'subhourly'.  \n\n#### *function* weatherbit.Api.get_history(city=..., state=..., country=..., start_date=..., end_date=...)  \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- **start_date** - Start date of data  \n- **end_date** - End date of data  \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- **source** - (optional) \"airquality\" or \"agweather\" - to return airquality/agweather data instead.  \n- **tp** - (optional) A string denoting the time period of data 'hourly' or 'daily' or 'subhourly'. \n\n#### *function* weatherbit.Api.get_history(postal_code=..., country=..., start_date=..., end_date=...)  \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- **start_date** - Start date of data  \n- **end_date** - End date of data  \n- **postal_code** - postal code.  \n- **country** - (recommended) 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- **source** - (optional) \"airquality\" or \"agweather\" - to return airquality/agweather data instead.  \n- **tp** - (optional) A string denoting the time period of data 'hourly' or 'daily' or 'subhourly'. \n\n----------------------------------------------------\n\n#### *function* weatherbit.Api.get_current(postal_code=..., country=..., start_date=..., end_date=...)  \n---------------------------------------------------  \n  \nThis makes an API request and returns a **Current Data** object (see below).   \n  \nParameters:  \n- **key** - Your API key from https://www.weatherbit.io.  \n- **postal_code** - postal code.  \n- **country** - (recommended) 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- **source** - (optional) \"airquality\" - to return airquality data instead.  \n- **include** - (optional) comma separated value of extra data responses to include. Ie. \"alerts\" or \"minutely\", or both \"alerts,minutely\". \"alerts\" being severe weather alerts, and \"minutely\" being a minutely nowcast.  \n\n----------------------------------------------------\n\n#### *function* weatherbit.Api.get_current(lat=..., lon=..., country=..., start_date=..., end_date=...)  \n---------------------------------------------------  \n  \nThis makes an API request and returns a **Current Data** object (see below).   \n  \nParameters:  \n- **key** - Your API key from https://www.weatherbit.io.  \n- **lat** - The latitude of the location  \n- **lon** - The longitude of the 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- **source** - (optional) \"airquality\" - to return airquality data instead.  \n- **include** - (optional) comma separated value of extra data responses to include. Ie. \"alerts\" or \"minutely\", or both \"alerts,minutely\". \"alerts\" being severe weather alerts, and \"minutely\" being a minutely nowcast.  \n\n----------------------------------------------------\n\n#### *function* weatherbit.Api.get_current(city=..., state=..., country=...)  \n---------------------------------------------------  \n  \nThis makes an API request and returns a **Current Data** 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- **source** - (optional) \"airquality\" - to return airquality data instead.  \n- **include** - (optional) comma separated value of extra data responses to include. Ie. \"alerts\" or \"minutely\", or both \"alerts,minutely\". \"alerts\" being severe weather alerts, and \"minutely\" being a minutely nowcast.  \n\n----------------------------------------------------\n\n----------------------------------------------------\n\n#### *function* weatherbit.Api.get_alerts(lat=... , lon=...)  \n---------------------------------------------------  \n  \nThis makes an API request and returns a **Alert** 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\n----------------------------------------------------\n\n\n----------------------------------------------------\n\n#### *function* weatherbit.Models.Current.get(api_vars=[])  \n---------------------------------------------------  \n  \nGets data from Current Weather API Response (weatherbit.Api.get_current).\n  \nParameters:  \n- **api_vars** - Optional list of vars to retrieve from API. \n\n----------------------------------------------------\n\n\n----------------------------------------------------\n\n#### *function* weatherbit.Models.Alert.get()  \n---------------------------------------------------  \n  \nGets data from Current Weather API Response (weatherbit.Api.get_current).\n \n\n----------------------------------------------------\n\n----------------------------------------------------\n\n#### *function* weatherbit.Models.Forecast.get(api_vars=[])  \n---------------------------------------------------  \n  \nGets data from Forecast API Response (weatherbit.Api.get_forecast).  \n  \nParameters:  \n- **api_vars** - Optional list of vars to retrieve from API. \n\n----------------------------------------------------\n\n----------------------------------------------------\n\n#### *function* weatherbit.Models.History.get(api_vars=[])  \n---------------------------------------------------  \n  \nGets data from History Weather API Response (weatherbit.Api.get_history).  \n  \nParameters:  \n- **api_vars** - Optional list of vars to retrieve from API. \n\n----------------------------------------------------\n\n----------------------------------------------------\n\n#### *function* weatherbit.Models.Normals.get(api_vars=[])  \n---------------------------------------------------  \n  \nGets data from Normals API Response (weatherbit.Api.get_normals).  \n  \nParameters:  \n- **api_vars** - Optional list of vars to retrieve from API. \n\n----------------------------------------------------\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2017 weatherbit  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A python weather api wrapper for the Weatherbit.io API.",
    "version": "2.2.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/weatherbit/weatherbit-python/issues",
        "Homepage": "https://github.com/weatherbit/weatherbit-python"
    },
    "split_keywords": [
        "weather",
        "api",
        "python",
        "wrapper",
        "weatherbit"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0ed2880806168eaf7996623b725a312a9cbdca800c0cfdd9c053a6876dbab0c3",
                "md5": "7e5bb853bf82086d07b23610fc5bd74d",
                "sha256": "b65a6ad0d48ed63f1fc1af5f00e04e6ec6f980af8041e1b8adc8ce9ecc697387"
            },
            "downloads": -1,
            "filename": "pyweatherbit-2.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7e5bb853bf82086d07b23610fc5bd74d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 11166,
            "upload_time": "2024-02-14T00:41:10",
            "upload_time_iso_8601": "2024-02-14T00:41:10.697750Z",
            "url": "https://files.pythonhosted.org/packages/0e/d2/880806168eaf7996623b725a312a9cbdca800c0cfdd9c053a6876dbab0c3/pyweatherbit-2.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c826090329c1abc30144f140da7a72e30196975a23c87d360eed910f64efa0f6",
                "md5": "0388fecac82808bc7ebb3a628d0b0d1b",
                "sha256": "7a4b81349e380cb26580279b7e201cf59849ead1e38fe75513c7cd9a70e000c6"
            },
            "downloads": -1,
            "filename": "pyweatherbit-2.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0388fecac82808bc7ebb3a628d0b0d1b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11377,
            "upload_time": "2024-02-14T00:41:12",
            "upload_time_iso_8601": "2024-02-14T00:41:12.393607Z",
            "url": "https://files.pythonhosted.org/packages/c8/26/090329c1abc30144f140da7a72e30196975a23c87d360eed910f64efa0f6/pyweatherbit-2.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-14 00:41:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "weatherbit",
    "github_project": "weatherbit-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyweatherbit"
}
        
Elapsed time: 0.20654s