Skip to content

Commit

Permalink
Merge pull request #13 from dhhagan/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dhhagan authored Dec 23, 2016
2 parents c24025e + f4d9acb commit 11959b4
Show file tree
Hide file tree
Showing 8 changed files with 520 additions and 74 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/dhhagan/py-openaq.svg?branch=master)](https://travis-ci.org/dhhagan/py-openaq)
[![PyPI version](https://badge.fury.io/py/py-openaq.svg)](https://badge.fury.io/py/py-openaq)
[![Coverage Status](https://coveralls.io/repos/dhhagan/py-openaq/badge.svg?branch=master&service=github)](https://coveralls.io/github/dhhagan/py-openaq?branch=master)

# py-openaq
Expand Down
29 changes: 16 additions & 13 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ You can install this package in the usual way using ``pip``::

pip install py-openaq

You can upgrade with:
You can upgrade this package using ``pip`` as well::

pip install py-openaq --upgrade


Requirements
------------

The only requirement for this package is ``requests``. In the future (v1),
``pandas`` will be recommended and significant features will depend on it.

**UPDATE**: As of v0.3.0, `pandas` support has been added, but is not a requirement.
The only requirement for this package is ``requests``. If you are not limited
by memory or space, I would highly recommend installing ``pandas`` and ``seaborn``
which will enable you to use the new visualization helpers that were released with
version 1.

Current Limitations
-------------------
Expand Down Expand Up @@ -72,20 +72,17 @@ The json response will look something like the following with both ``meta`` and

Coupling with Pandas DataFrame
------------------------------
Pandas is awesome. If you are working with data, you should be using DataFrames. To
easily dump your json response into a DataFrame::

from pandas.io.json import json_normalize
The `pandasize` decorator was added to easily allow you to read in data directly
to a DataFrame. To do so, simply add the argument `df = True` to your request.

df = json_normalize(resp)

As of v0.3.0, an optional keyword argument (`df`) has been added to the following API methods:
The following API methods allow you to return your data as a DataFrame:

* cities
* countries
* latest
* locations
* measurements
* sources

By using this keyword argument, the results of the API call will return a pandas DataFrame rather than a json response.

Expand All @@ -101,4 +98,10 @@ API Reference

.. module:: openaq
.. autoclass:: OpenAQ
:members: cities, countries, latest, locations, measurements, fetches
:members: cities, countries, latest, locations, measurements, fetches,
parameters, sources

Visualization Reference
=======================
.. module:: openaq.viz
.. autofunction:: tsplot
Loading

0 comments on commit 11959b4

Please sign in to comment.