You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

cpdb-api

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpdb-api

An API to access the NewClimate Institute's Climate Policy Database

1.0.8
pipPyPI
Maintainers
2

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:

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

Keywords

nci

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts