Autogenerated API

class openclimate.ActorOverview.ActorOverview(version: str = '/api/v1', base_url: str = 'https://openclimate.openearth.dev', server: str = 'https://openclimate.openearth.dev/api/v1')[source]

ActorOveriew API class get overview information of an actor

Returns:

object

Methods

country_codes([like, case_sensitive, regex])

returns two-letter country codes

overview(actor_id[, ignore_warnings])

Retretive actor overview

parts(actor_id[, part_type])

Retreive actor parts (e.g.

country_codes(like: Optional[str] = None, case_sensitive: bool = False, regex: bool = True, *args, **kwargs) DataFrame[source]

returns two-letter country codes

Parameters:
  • like (str, optional) – filters names. Defaults to None.

  • case_sensitive (bool, optional) – make search case-senstive. Defaults to False.

  • regex (bool, optional) – use regular expression like phrases. Defaults to True.

Returns:

pd.DataFrame

overview(actor_id: Union[str, List[str], Tuple[str]], ignore_warnings: bool = False)[source]

Retretive actor overview

Parameters:
  • actor_id (Union[str, List[str], Tuple[str]]) – actor identifier. Defaults to None.

  • ignore_warnings (bool) – ignore warning messages

Returns:

dictionary with actor overview

Return type:

List[Dict]

parts(actor_id: str, part_type: Optional[str] = None, *args, **kwargs) DataFrame[source]

Retreive actor parts (e.g. subnational, cities, …)

Parameters:
  • actor_id (str) – code for actor your want to retrieve

  • part_type (str, optional) – administrative level

Returns:

data for each emissions dataset

Return type:

DataFrame

class openclimate.Base.Base(version: str = '/api/v1', base_url: str = 'https://openclimate.openearth.dev', server: str = 'https://openclimate.openearth.dev/api/v1')[source]

Base API class define HTTP access to API

Returns:

object

base_url: str = 'https://openclimate.openearth.dev'
server: str = 'https://openclimate.openearth.dev/api/v1'
version: str = '/api/v1'
class openclimate.Client.Client(version: str = '/api/v1', base_url: str = 'https://openclimate.openearth.dev', server: str = 'https://openclimate.openearth.dev/api/v1')[source]

OpenClimate API Python Client

If you are using Jupyter

either run `python client = Client() client.jupyter `

or manually add the following lines of code `python import nest_asyncio nest_asyncio.apply() `

Attributes:
jupyter

Methods

country_codes([like, case_sensitive, regex])

get country codes and filter using like regex phrases

emissions(actor_id[, datasource_id, ...])

retreive actor emissions

emissions_datasets(actor_id[, ignore_warnings])

retreive actor emissions datasets

gdp(actor_id[, ignore_warnings])

retreive actor GDP

parts(actor_id[, part_type])

retreive actor parts

population(actor_id[, ignore_warnings])

retreive actor population

search([name, identifier, query, language, ...])

search actor names and identifiers

targets(actor_id[, ignore_warnings])

retreive actor targets

country_codes(like: Optional[str] = None, case_sensitive: bool = False, regex: bool = True, *args, **kwargs) DataFrame[source]

get country codes and filter using like regex phrases

Parameters:
  • like (str) – phrase to search for in name (optional)

  • case_senstive (bool) – case senstive search [default: False] (optional)

  • regex (bool) – use regex with like [default: True] (optional)

Returns:

dataframe of country codes

Return type:

DataFrame

emissions(actor_id: str, datasource_id: Optional[str] = None, ignore_warnings: bool = False) DataFrame[source]

retreive actor emissions

Parameters:
  • actor_id (str|List[str]) – code for actor your want to retrieve

  • datasource_id (str) – code emissions dataset

  • ignore_warnings (bool) – ignore warning messages

Returns:

data for each emissions dataset

Return type:

DataFrame

emissions_datasets(actor_id: str, ignore_warnings: bool = False) DataFrame[source]

retreive actor emissions datasets

Parameters:
  • actor_id (str) – code for actor your want to retrieve

  • ignore_warnings (bool) – ignore warning messages

Returns:

data of emission datasets

Return type:

DataFrame

gdp(actor_id: str, ignore_warnings: bool = False) DataFrame[source]

retreive actor GDP

Parameters:
  • actor_id (str|List[str]) – code for actor your want to retrieve

  • ignore_warnings (bool) – ignore warning messages

Returns:

dataframe of GDP

Return type:

DataFrame

property jupyter
parts(actor_id: str, part_type: Optional[str] = None, *args, **kwargs) DataFrame[source]

retreive actor parts

returns subnational, cities, companies, etc. within an actor_id

Parameters:
  • actor_id (str|List[str]) – code for actor your want to retrieve

  • part_type (str) – retrieve actors from administrative part [‘planet’, ‘country’, ‘adm1’, ‘adm2’, ‘city’, ‘organization’, ‘site’]

Returns:

dataframe of actors parts

Return type:

DataFrame

population(actor_id: str, ignore_warnings: bool = False) DataFrame[source]

retreive actor population

Parameters:
  • actor_id (str|List[str]) – code for actor your want to retrieve

  • ignore_warnings (bool) – ignore warning messages

Returns:

dataframe of population

Return type:

DataFrame

search(name: Optional[str] = None, identifier: Optional[str] = None, query: Optional[str] = None, language: Optional[str] = None, namespace: Optional[str] = None, *args, **kwargs) DataFrame[source]

search actor names and identifiers

Parameters:
  • query (str) – full search of identifiers and names that include the search parameter

  • name (str) – searches for actors with exact name match (e.g. “Minnesota”)

  • language (str, optional) – two letter language code [requires name to be set]

  • identifier (str) – searches for actors with exact identifier code match (e.g. “US”)

  • namespace (str, optional) – actor namespace code [requires identifier to be be set]

Returns:

dataframe of search results

Return type:

DataFrame

targets(actor_id: str, ignore_warnings: bool = False) DataFrame[source]

retreive actor targets

Parameters:
  • actor_id (str|List[str]) – code for actor your want to retrieve

  • ignore_warnings (bool) – ignore warning messages

Returns:

dataframe of targets

Return type:

DataFrame

class openclimate.Emissions.Emissions(version: str = '/api/v1', base_url: str = 'https://openclimate.openearth.dev', server: str = 'https://openclimate.openearth.dev/api/v1')[source]

Methods

datasets(actor_id[, ignore_warnings])

retreive emissions datasets for an actor

emissions(actor_id[, datasource_id, ...])

retrieve actor emissions

datasets(actor_id: Union[str, List[str], Tuple[str]], ignore_warnings: bool = False, *args, **kwargs) DataFrame[source]

retreive emissions datasets for an actor

Parameters:
  • actor_id (Union[str, List[str], Tuple[str]], optional) – actor code

  • ignore_warnings (bool, optional) – ignore warnings messages

Return type:

pd.DataFrame

emissions(actor_id: Union[str, List[str], Tuple[str]], datasource_id: Optional[str] = None, ignore_warnings: bool = False, *args, **kwargs) DataFrame[source]

retrieve actor emissions

Parameters:
  • actor_id (Union[str, List[str], Tuple[str]], optional) – actor code

  • datasource_id (str, optional) – emissions datasource. Defaults to None.

  • ignore_warnings (bool, optional) – ignore warnings messages

Returns:

_description_

Return type:

pd.DataFrame

class openclimate.GDP.GDP(version: str = '/api/v1', base_url: str = 'https://openclimate.openearth.dev', server: str = 'https://openclimate.openearth.dev/api/v1')[source]

Methods

gdp(actor_id[, ignore_warnings])

retreive actor GDP

gdp(actor_id: Union[str, List[str], Tuple[str]], ignore_warnings: bool = False, *args, **kwargs) DataFrame[source]

retreive actor GDP

Parameters:
  • actor_id (Union[str, List[str], Tuple[str]], optional) – actor code

  • ignore_warnings (bool) – ignore warning messages

Return type:

pd.DataFrame

class openclimate.Population.Population(version: str = '/api/v1', base_url: str = 'https://openclimate.openearth.dev', server: str = 'https://openclimate.openearth.dev/api/v1')[source]

Methods

population(actor_id[, ignore_warnings])

retreive actor population

population(actor_id: Union[str, List[str], Tuple[str]], ignore_warnings: bool = False, *args, **kwargs) DataFrame[source]

retreive actor population

Parameters:
  • actor_id (Union[str, List[str], Tuple[str]], optional) – actor code

  • ignore_warnings (bool) – ignore warning messages

Return type:

pd.DataFrame

class openclimate.Search.Search(version: str = '/api/v1', base_url: str = 'https://openclimate.openearth.dev', server: str = 'https://openclimate.openearth.dev/api/v1')[source]

Methods

search([name, identifier, query, language, ...])

search actors

search(name: Optional[str] = None, identifier: Optional[str] = None, query: Optional[str] = None, language: Optional[str] = None, namespace: Optional[str] = None, *args, **kwargs) DataFrame[source]

search actors

Parameters:
  • query (str) – full search of identifiers and names that include the search parameter

  • name (str) – searches for actors with exact name match (e.g. “Minnesota”)

  • language (str, optional) – two letter language code [requires name to be set]

  • identifier (str) – searches for actors with exact identifier code match (e.g. “US”)

  • namespace (str, optional) – actor namespace code [requires identifier to be be set]

Returns:

dataframe with search results

Return type:

pd.DataFrame

class openclimate.Targets.Targets(version: str = '/api/v1', base_url: str = 'https://openclimate.openearth.dev', server: str = 'https://openclimate.openearth.dev/api/v1')[source]

Methods

targets(actor_id[, ignore_warnings])

retreive actor targets

targets(actor_id: Union[str, List[str], Tuple[str]], ignore_warnings: bool = False, *args, **kwargs) DataFrame[source]

retreive actor targets

Parameters:
  • actor_id (Union[str, List[str], Tuple[str]], optional) – actor code

  • ignore_warnings (bool) – ignore warning messages

Return type:

pd.DataFrame