Metadata-Version: 2.1
Name: cpdb-api
Version: 1.0.6
Summary: An API to access the NewClimate Institute's Climate Policy Database
Author-email: NewClimate Institute <info@newclimate.org>
Project-URL: Homepage, https://climatepolicydatabase.org
Project-URL: Source Code, https://github.com/KevinDackow/CPDB-API
Keywords: nci,cpdb,climatepolicydatabase,newclimateinstitute
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

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/*
```
