All Projects → Detrous → Darksky

Detrous / Darksky

Licence: mit
Python API wrapper for the DarkSky (async&sync)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Darksky

solar-weather
React Native Weather App w. Realm, Redux, ReasonReact & Forecast.io
Stars: ✭ 13 (-83.95%)
Mutual labels:  weather, forecast
Jupiter
🌞 The Swift Weather Framework
Stars: ✭ 14 (-82.72%)
Mutual labels:  weather, forecast
temps-lite
A smart, good-looking little app which tries to speak your language the way you are used to.
Stars: ✭ 40 (-50.62%)
Mutual labels:  weather, forecast
mpxday
mpxday是基于mpx开发的天气预报微信小程序
Stars: ✭ 3 (-96.3%)
Mutual labels:  weather, forecast
Wego
weather app for the terminal
Stars: ✭ 6,918 (+8440.74%)
Mutual labels:  forecast, weather
MMM-forecast-io
Forecast.io Module for MagicMirror
Stars: ✭ 58 (-28.4%)
Mutual labels:  weather, forecast
File-Maker
Generate data files for Wii Channels that have the latest news, forecast data, etc.
Stars: ✭ 65 (-19.75%)
Mutual labels:  weather, forecast
Getme
CLI utility for everyday tasks. With getme you get weather, forecast, currency rate, upload files, IP address, word definitions, text translations, internet speed, do google searches, get inspirational quotes and get Chuck Norris jokes
Stars: ✭ 118 (+45.68%)
Mutual labels:  forecast, weather
Temps
Simple menubar application based on Electron with actual weather information and forecast.
Stars: ✭ 553 (+582.72%)
Mutual labels:  forecast, weather
darksky2influxdb
Stores wheather forcecast data from darkskyapi into a influxdb database
Stars: ✭ 21 (-74.07%)
Mutual labels:  weather, forecast
Dark Sky Api
PHP Library for the Dark Sky API.
Stars: ✭ 70 (-13.58%)
Mutual labels:  forecast, weather
Weather
A module for obtaining weather information
Stars: ✭ 54 (-33.33%)
Mutual labels:  forecast, weather
Good Weather
Open source weather app for Andorid
Stars: ✭ 198 (+144.44%)
Mutual labels:  forecast, weather
Weather
Weather Android App using apixu API https://www.apixu.com
Stars: ✭ 48 (-40.74%)
Mutual labels:  weather, forecast
Forecastr
A simple, asynchronous Objective-C wrapper for the Forecast.io API
Stars: ✭ 143 (+76.54%)
Mutual labels:  forecast, weather
darksky
Forecast.io API wrapper in Go (Golang)
Stars: ✭ 74 (-8.64%)
Mutual labels:  weather, forecast
Darkskylib
Python wrapper for the Dark Sky API
Stars: ✭ 112 (+38.27%)
Mutual labels:  forecast, weather
weather-milliseconds
Experiment to render a forecast as fast as possible
Stars: ✭ 24 (-70.37%)
Mutual labels:  weather, forecast
Node Forecastio
A node.js client for Forecast.io API
Stars: ✭ 32 (-60.49%)
Mutual labels:  forecast, weather
Weacast
Weacast demo application
Stars: ✭ 55 (-32.1%)
Mutual labels:  forecast, weather

DarkSky

CircleCI CircleCI

Dark Sky, the provider on which this repo relies, will no longer accept new signups. The API will continue to function through the end of 2021.

This library for the Dark Sky API provides access to detailed weather information from around the globe.

Installation

pip3 install darksky_weather

Get started

Before you start using this library, you need to get your API key here.

All classes are fully annotated, source code it's your best doc : )

from darksky.api import DarkSky, DarkSkyAsync
from darksky.types import languages, units, weather


API_KEY = '0123456789abcdef9876543210fedcba'

# Synchronous way
darksky = DarkSky(API_KEY)

latitude = 42.3601
longitude = -71.0589
forecast = darksky.get_forecast(
    latitude, longitude,
    extend=False, # default `False`
    lang=languages.ENGLISH, # default `ENGLISH`
    values_units=units.AUTO, # default `auto`
    exclude=[weather.MINUTELY, weather.ALERTS], # default `[]`,
    timezone='UTC' # default None - will be set by DarkSky API automatically
)

# Synchronous way Time Machine 

from datetime import datetime as dt

darksky = DarkSky(API_KEY)
t = dt(2018, 5, 6, 12)

latitude = 42.3601
longitude = -71.0589
forecast = darksky.get_time_machine_forecast(
    latitude, longitude,
    extend=False, # default `False`
    lang=languages.ENGLISH, # default `ENGLISH`
    values_units=units.AUTO, # default `auto`
    exclude=[weather.MINUTELY, weather.ALERTS], # default `[]`,
    timezone='UTC', # default None - will be set by DarkSky API automatically
    time=t
)

# Asynchronous way
# NOTE! On Mac os you will have problem with ssl checking https://github.com/aio-libs/aiohttp/issues/2822
# So you need to create your own session with disabled ssl verify and pass it into the get_forecast
# session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False))
# darksky = DarkSkyAsync(API_KEY)
# forecast = await darksky.get_forecast(
#     *arguments*,
#     client_session=session
# )

darksky = DarkSkyAsync(API_KEY)

latitude = 42.3601
longitude = -71.0589
forecast = await darksky.get_forecast(
    latitude, longitude,
    extend=False, # default `False`
    lang=languages.ENGLISH, # default `ENGLISH`
    values_units=units.AUTO, # default `auto`
    exclude=[weather.MINUTELY, weather.ALERTS], # default `[]`
    timezone='UTC' # default None - will be set by DarkSky API automatically,
    client_session=aiohttp.ClientSession() # default aiohttp.ClientSession()
)

# Final wrapper identical for both ways
forecast.latitude # 42.3601
forecast.longitude # -71.0589
forecast.timezone # timezone for coordinates. For exmaple: `America/New_York`

forecast.currently # CurrentlyForecast. Can be found at darksky/forecast.py
forecast.minutely # MinutelyForecast. Can be found at darksky/forecast.py
forecast.hourly # HourlyForecast. Can be found at darksky/forecast.py
forecast.daily # DailyForecast. Can be found at darksky/forecast.py
forecast.alerts # [Alert]. Can be found at darksky/forecast.py

Contact us.

If you have any issues or questions regarding the library, you are welcome to create an issue, or You can write an Email to [email protected]

License.

Library is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].