This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
DarkSkyPy - Python 3
A Different Python3 wrapper for the []( API.

Rewriting the API to reduce clutter and make obtaining data much more flexible. Based heavily off David Ervideira's forecastiopy.

This API is a work in progress, still very rough not guaranteed to work.
Please use [forecastiopy]( (python2.7) or [forecastiopy3]( (python3) if you actually need an API

Powered by [Dark Sky](

####Quick Start:
Install the package:
python install

Get the coordinates of your location, let's say Lisbon:
>>> Lisbon = [38.7252993, -9.1500364]

Get the current temperature and precipitation probability:
>>> from darkskypy import DarkSky
>>> ds = DarkSky(Lisbon, key=YOUR_APY_KEY)
>>> current_temp = ds.forecast.currently.temperature
>>> print('Temperature:', current_temp)
Temperature: 11.07
>>> print('Precipitation Probability:', ds.forecast.currently.precipProbability)
Precipitation Probability: 0.29

* Read Data Points and Data blocks from the []( API.

Sets up a a hierarchical dictionary object that allows easy access to the currently, minutely, hourly, daily, etc. reports with their nested data. Data can be accessed directly by attributes as a [AttrDict]( object. See Package for more information on how AttrDict works.

Please refer to the API docs []( for better understanding of how the Forecast Request is structured and what parameters can be set.

####To Do:
* Actually test this API
* Fix,
* Improve the docstrings

* [requests](
* [AttrDict](

API Overview

**Setting API Key**
The required API key can be passed as a kwarg or stored on in your system's environmental variables.
$ export DARKSKY_API_KEY=<api key="">


**Initialize the DarkSky class**
The location should be provided as a list of [latitude,longitude]. Coordinates can be easily obtained from a Geocoding API such as [geocoder]( Optional Parameters are passed as kwargs following the API doc.
import darkskypy
import geocoder

g ='Washington, DC')

ds = darkskypy.DarkSky(g.latlng, exclude='minutely,hourly', units='si')
# g.latlng >>> [38.9071923, -77.0368707]
# excludes minutely and hourly data blocks and reports in si units.

**Get Currently weather data for the requested location**
if ds.forecast.currently is True:
for element in ds.forecast.currently:
print(element + ' : ' + str(ds.forecast.currently[element]))
# Or access attributes directly
print('No Currently data')
**Get Daily weather data for the requested location**
The data blocks for Minutely, hourly, and daily data are dictionary sequences that represent each time unit. (i.e. hourly: hours in day, Daily: days in week)

if ds.forecast.daily is True:
print('Summary:', ds.forecast.daily.summary)
print('Icon:', ds.forecast.daily.icon)
# these would relate to the whole Daily block i.e. "the week"

for day in
print('Day summary: '+ day.summary)
# prints the 'summary' for each day

#accessed directly
print('No Daily data')

**Alerts and Flags weather data** should work just like Flags and the other ones, but at the time I am writing this, I could not find a location with alerts to test on.

**A note on time**
The API returns time in unix time. Although this is a good computer format, it is not particulary _human-readable_. The datatime module can be used to get a more useful format.
import datetime

time = datetime.datetime.fromtimestamp(int(currently.time).strftime('%Y-%m-%d %H:%M:%S')
print('unix time:', currently.time)
print('time:', time)


Output should be like:
unix time: 1448234556
time: 2015-11-22 23:22:36

Please report any issues at [Github](
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
darkskypy-0.2-py2-none-any.whl (3.4 kB) Copy SHA256 Checksum SHA256 py2 Wheel Oct 12, 2016
darkskypy-0.2-py3-none-any.whl (3.4 kB) Copy SHA256 Checksum SHA256 py3 Wheel Oct 12, 2016
darkskypy-0.2.tar.gz (4.3 kB) Copy SHA256 Checksum SHA256 Source Oct 12, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting