Skip to content

Python client for the ProPublica NonProfit Explorer API.

License

Notifications You must be signed in to change notification settings

robrem/propublica-nonprofit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Propublica Nonprofit Explorer Client

Python client for the ProPublica NonProfit Explorer API.

Query data on over 1.6 million nonprofit organizations. No API key is required, but please refer to ProPublica's terms of use.

Usage

>>> from nonprofit import Nonprofit
>>> np = Nonprofit()

# get organization by employer identification number (EIN)
>>> org = np.orgs.get('521275227')
>>> org['name']
'CENTER FOR RESPONSIVE POLITICS'

# get organizations by keyword
>>> orgs = np.search.get(q='responsive')
>>> orgs[0]['name']
'RESPONSIVE EDUCATION SOLUTIONS'

# get organizations by state
>>> orgs = np.search.get(state='WA')
>>> orgs[0]['name']
'101 CLUB'

# query by multiple parameters (q, state, c_code, ntee)
>>> orgs = np.search.get(c_code=2, ntee=7)
>>> orgs[0]['name']
'1800 MASSACHUSETTS AVENUE CORP'

# use fetch to access endpoints directly
>>> orgs = np.fetch('search.json?q=delta')
>>> orgs['total_results']
2543

# optionally use a custom lambda to parse results
>>> orgs = np.fetch('search.json?q=delta', lambda orgs: orgs['organizations'][5])
>>> orgs['name']
'DELTA DELTA DELTA CORP'

About

Python client for the ProPublica NonProfit Explorer API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages