Metadata-Version: 2.1
Name: nass
Version: 0.1.1
Summary: USDA National Agricultural Statistics Service API wrapper
Home-page: https://github.com/nickfrostatx/nass
Author: Nick Frost
Author-email: nickfrostatx@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
License-File: LICENSE
Requires-Dist: requests
Provides-Extra: testing
Requires-Dist: pytest (>=2.0.0) ; extra == 'testing'

``nass``
========

.. image:: https://img.shields.io/travis/nickfrostatx/nass.svg
        :target: https://travis-ci.org/nickfrostatx/nass

.. image:: https://img.shields.io/pypi/v/nass.svg
    :target: https://pypi.python.org/pypi/nass

``nass`` is a wrapper around the public API for the USDA National Agricultural
Statistics Service.

Installation
------------

::

    $ pip install nass

Usage
-----

::

    >>> import nass
    >>> api = nass.NassApi('your api key')
    >>> api.param_values('source_desc')
    ['CENSUS', 'SURVEY']
    >>> q = api.query()
    >>> q.filter('commodity_desc', 'CORN').filter('year', 1990)
    >>> q.count()
    25259
    >>> q.execute()
    [{'sector_desc': 'CROPS', ...}, ...]

See http://quickstats.nass.usda.gov/ for the full list of fields.

Exceptions
----------

If something goes wrong communicating with NASS, an exception will be raised.
This includes connection problems (e.g. timeout, DNS failure), as well as
specific error messages.

All exceptions subclass :class:`nass.exceptions.NassException`, so you can use
it to catch all exceptions.

Documentation
-------------

You can find full documentation of the ``nass`` package at
https://nass.readthedocs.org.


.. :changelog:

History
-------

0.1.1 (2015-10-14)
++++++++++++++++++

- Python 3.5 support
- Mark as stable

0.1.0 (2015-07-18)
++++++++++++++++++

- Initial release


