A Python wrapper for the DitchCarbon API
Project description
ditchcarbon-python
What is it?
ditchcarbon-python is the official Python wrapper for the DitchCarbon API. DitchCarbon calculates the carbon impact of almost anything using a combination of GHG protocol approved calculations and an unparalleled database of company and product disclosures.
Where to get it?
You can install the library via PyPI (hosted here):
pip3 install ditchcarbon-python
The source code is currently hosted on GitHub, here.
How to use it?
First, import and initialise the library with your API token:
from ditchcarbon_python import Client
ditchcarbon = Client(token="YOUR_TOKEN")
Then, use it:
# Activities
ditchcarbon.activities.retrieve(1)
ditchcarbon.activities.retrieve_many(**params)
ditchcarbon.activities.retrieve_assessment(1, **params)
ditchcarbon.activities.retrieve_categories(**params)
# Categories
ditchcarbon.categories.search(**params)
# Expenses
ditchcarbon.expenses.calculate_emissions(**params)
# Products
ditchcarbon.products.calculate_emissions(**params)
# Servers
ditchcarbon.servers.find(**params)
ditchcarbon.servers.retrieve(1)
ditchcarbon.servers.calculate_emissions(1, **params)
# Suppliers
ditchcarbon.suppliers.calculate_emissions(**params)
Documentation and Help
View our API reference here. For usage questions, feel free to contact us here.
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for ditchcarbon_python-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd5d4c84609b4cf0e34d5ad76aa9ca5af423102a8d68ff2123671469141c2fff |
|
MD5 | c42833d13a11f57e7420cefaff79c7a6 |
|
BLAKE2b-256 | 74dfffc6e3ccd2954cc1db309c8669dad49e9215735910a55aa8bc96d8888bf4 |