Skip to main content

A Python API for NewClimate Institute's ClimatePolicy DataBase (CPDB). You can also view the database via the website at https://climatepolicydatabase.org/.

Installation

Installation is simple, via pip.

pip install cpdb-api

If you need to specify a version, please do this (we strongly recommend against this unless you know what you're doing):

pip install cpdb-api==<version e.g. 1.0.5>

Usage

from cpdb_api import request 

r = request.Request()

# set filters
r.set_country("IND")
r.set_decision_date(2010)
r.set_policy_status("In force")
r.add_sector("Electricity and heat")
r.add_sector("Coal")
r.add_policy_instrument("Energy and other taxes")
r.add_mitigation_area("Renewables")

# Issue the request (this returns a pandas dataframe, if you want to parse it programmatically)
r.issue()

# save the result to CSV file
r.save_csv("filtered_cpdb.csv")

Releasing

To release to PyPi (pip), do the following:

  1. Increment the version number in pyproject.toml
  2. Run the following commands:
$ python3 -m build
$ python3 -m twine upload dist/*

Metadata

Release files for cpdb-api 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cpdb-api 1.0.8
File Size Uploaded
cpdb_api-1.0.8.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cpdb-api 1.0.8
File Interpreter ABI Platform
cpdb_api-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / cpdb_api-1.0.8.tar.gz

Download URL cpdb_api-1.0.8.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
46c14b648104546da17c06e38cc8f5fe49950e3aeaee5f299f65feafea6f4e7b
BLAKE2b-256 checksum
How to use checksums
9305c6caddb52265931b4ace76c470c570fc1b833abec3b1f311e7e5775b9ee7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Release files / cpdb_api-1.0.8-py3-none-any.whl

Download URL cpdb_api-1.0.8-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f35de1738aa6b94ce797a6af7aec0c7fa42335ecd7345632a8e4161e156318b8
BLAKE2b-256 checksum
How to use checksums
3bc4daab2b88a5c81e349f245794fbe042648ad87c91a8a825097c13c9303790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page