ditchcarbon-python-0.1.2
توضیحات
Official Python wrapper for the DitchCarbon API
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | ditchcarbon-python-0.1.2 |
| نام | ditchcarbon-python |
| نسخه کتابخانه | 0.1.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | DitchCarbon <enquiries@ditchcarbon.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/ditchcarbon-python/ |
| مجوز | Copyright 2023 DitchCarbon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
<div align="center">
<img src="https://ditchcarbon.com/wp-content/uploads/2021/05/Group-119.svg"><br>
</div>
-----------------
# ditchcarbon-python





[](https://github.com/psf/black)
## 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](https://pypi.org/project/ditchcarbon-python)):
```sh
pip3 install ditchcarbon-python
```
The source code is currently hosted on GitHub, [here](https://github.com/ditchthis/ditchcarbon-python).
## How to use it?
First, import and initialise the library with your API token:
```python
from ditchcarbon_python import Client
ditchcarbon = Client(token="YOUR_TOKEN")
```
Then, use it:
```python
# 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](https://docs.ditchcarbon.com/reference). For usage questions, feel free to contact us [here](mailto:enquiries@ditchcarbon.com).
نیازمندی
| مقدار | نام |
|---|---|
| - | requests |
| - | pytest |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl ditchcarbon-python-0.1.2:
pip install ditchcarbon-python-0.1.2.whl
نصب پکیج tar.gz ditchcarbon-python-0.1.2:
pip install ditchcarbon-python-0.1.2.tar.gz