Python client for OpenClimate API
Project description
OpenClimate-pyclient
OpenClimate Python Client is a Python 3.6+ package for the OpenClimate API. The goal of this package is to make emissions data and pledges more accessible.
Installation
pip install openclimate
Usage
Import and create a Client()
object
from openclimate import Client
client = Client()
Retrieving data
Emissions
Retrieve all emissions data for a single actor. Here I am retrieving emissions data for Canada
df = client.emissions(actor_id='CA')
Retrieve all emissions data for a list of actors. Here I am retrieving emission data for the United States, Canada, and Great Britain.
df = client.emissions(actor_id=['US','CA','GB'])
Return the different datasets available for a particular actor:
df = client.emissions_datasets(actor_id='US')
Only select data for a particular dataset
df = client.emissions_datasets(actor_id='US', datasource_id='GCB2022:national_fossil_emissions:v1.0')
Targets
Retrieve emissions targets for a particule actor
df = client.targets(actor_id='US')
Population
Retrieve population data.
df = client.population(actor_id=['US','CA','GB'])
GDP
Retrieve GDP data.
df = client.gdp(actor_id=['US','CA','GB'])
Searching for codes
use the following to list the actor_ids for countries:
df = client.country_codes()
search for actor codes:
df = client.search(query='Minnesota')
get all the parts of an actor. Here I am returning the actor_id for each US state.
df = client.parts(actor_id='US',part_type='adm1')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for openclimate-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df75e35ba87571352a3059d0e12abee13d32091a2bce578656112e35766c998 |
|
MD5 | 4a058e9e285f3713fcfda5059bf3532a |
|
BLAKE2b-256 | 5fba6ca7bb97a24317ba60096206aea1285151ec0eef1fbc6030ebee9e2f3988 |