Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
forked from chadwhawkins/nass

📊 USDA National Agricultural Statistics Service API wrapper.

License

Notifications You must be signed in to change notification settings

bgonzalez6/nass

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 NassException, so you can use it to catch all exceptions.

Documentation

The full documentation is at https://nass.readthedocs.io.

About

📊 USDA National Agricultural Statistics Service API wrapper.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.6%
  • Makefile 0.4%