Skip to content

Commit fe67028

Browse files
committed
1.1.24
0 parents  commit fe67028

File tree

140 files changed

+19429
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+19429
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Additional context**
27+
Add any other context about the problem here.

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Create release
15+
uses: ncipollo/release-action@v1
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
tag: "${{ github.event.head_commit.message }}"
20+
name: "KlimAPI Release ${{ github.event.head_commit.message }} 🚀"
21+
body: "### This release has been automatically generated due to API changes or bug fixes. \n\n**All changes are 100% backwards compatible**, unless it's a new major version (X.0.0). \n\nFor the complete API changelog, please visit our [Changelog](https://klimapi.com/resources/docs#tag/Changelog)."
22+
draft: false
23+
prerelease: false

.gitignore

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# custom
34+
.github/workflows/python.yml
35+
.gitlab-ci.yml
36+
.openapi-generator-ignore
37+
.openapi-generator
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.coverage
47+
.coverage.*
48+
.cache
49+
nosetests.xml
50+
coverage.xml
51+
*,cover
52+
.hypothesis/
53+
venv/
54+
.venv/
55+
.python-version
56+
.pytest_cache
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
65+
# Sphinx documentation
66+
docs/_build/
67+
68+
# PyBuilder
69+
target/
70+
71+
#Ipython Notebook
72+
.ipynb_checkpoints

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
python:
4+
- "3.7"
5+
- "3.8"
6+
- "3.9"
7+
- "3.10"
8+
- "3.11"
9+
# uncomment the following if needed
10+
#- "3.11-dev" # 3.11 development branch
11+
#- "nightly" # nightly build
12+
# command to install dependencies
13+
install:
14+
- "pip install -r requirements.txt"
15+
- "pip install -r test-requirements.txt"
16+
# command to run tests
17+
script: pytest --cov=klimapi_python

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Klimahelden GmbH (KlimAPI)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# klimapi-python
2+
This API offers you the possibility to calculate and offset emissions, create checkout links, get statistics and much more.
3+
4+
- API version: v2
5+
- Package version: 1.1.24
6+
7+
For more information, please visit [https://klimapi.com/resources/docs](https://klimapi.com/resources/docs)
8+
9+
## Requirements
10+
11+
Python 3.7+
12+
13+
## Installation
14+
15+
### pip install
16+
17+
If the python package is hosted on a repository, you can install directly using:
18+
19+
```sh
20+
pip install git+https://github.com/KlimAPI/klimapi-python.git
21+
```
22+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/KlimAPI/klimapi-python.git`)
23+
24+
Then import the package:
25+
```python
26+
import klimapi_python
27+
```
28+
29+
## Setup new API Instance
30+
31+
```python
32+
import klimapi_python
33+
34+
klimapi = klimapi_python.KlimApi('your-private-api-key')
35+
```
36+
37+
## Methods
38+
39+
Method | HTTP request | Description
40+
------------- | ------------- | -------------
41+
[**add_webhook**](docs/KlimApi.md#add_webhook) | **POST** /webhooks/add | Add Webhook
42+
[**calculate**](docs/KlimApi.md#calculate) | **POST** /calculate | Calculate
43+
[**calculate_cart**](docs/KlimApi.md#calculate_cart) | **POST** /stores/{store_ident}/cart | Calculate
44+
[**get_categories**](docs/KlimApi.md#get_categories) | **GET** /categories | Get all Categories
45+
[**get_certification_authorities**](docs/KlimApi.md#get_certification_authorities) | **GET** /certification_authorities | Get all Certification Authorities
46+
[**get_metrics**](docs/KlimApi.md#get_metrics) | **POST** /metrics | Order Metrics
47+
[**get_order**](docs/KlimApi.md#get_order) | **GET** /orders/{order_id} | Get Order
48+
[**get_orders**](docs/KlimApi.md#get_orders) | **POST** /orders | Get Orders
49+
[**get_payment_link**](docs/KlimApi.md#get_payment_link) | **GET** /orders/link/{payment_link_id} | Get Checkout Link
50+
[**get_project**](docs/KlimApi.md#get_project) | **GET** /projects/{project_id} | Get Project
51+
[**get_projects**](docs/KlimApi.md#get_projects) | **GET** /projects | Get all supported Projects
52+
[**link_by_calculation**](docs/KlimApi.md#link_by_calculation) | **POST** /orders/link/calculate | By calculation
53+
[**link_by_carbon**](docs/KlimApi.md#link_by_carbon) | **POST** /orders/link/carbon | By carbon
54+
[**link_by_price**](docs/KlimApi.md#link_by_price) | **POST** /orders/link/price | By price
55+
[**me**](docs/KlimApi.md#me) | **GET** /me | Get Authenticated User
56+
[**order_by_calculation**](docs/KlimApi.md#order_by_calculation) | **POST** /orders/process/calculate | By calculation
57+
[**order_by_carbon**](docs/KlimApi.md#order_by_carbon) | **POST** /orders/process/carbon | By carbon
58+
[**order_by_price**](docs/KlimApi.md#order_by_price) | **POST** /orders/process/price | By price
59+
[**pending_by_calculation**](docs/KlimApi.md#pending_by_calculation) | **POST** /orders/pending/calculate | By calculation
60+
[**pending_by_carbon**](docs/KlimApi.md#pending_by_carbon) | **POST** /orders/pending/carbon | By carbon
61+
[**pending_by_price**](docs/KlimApi.md#pending_by_price) | **POST** /orders/pending/price | By price
62+
[**process**](docs/KlimApi.md#process) | **POST** /orders/{order_id}/process | Process pending Order
63+
[**process_cart**](docs/KlimApi.md#process_cart) | **POST** /stores/{store_ident}/cart/{order_id}/process | Process cart
64+
[**refund**](docs/KlimApi.md#refund) | **DELETE** /orders/{order_id}/refund | Refund Order
65+
[**remove_webhook**](docs/KlimApi.md#remove_webhook) | **DELETE** /webhooks/remove | Remove Webhook
66+
[**sync_bulk_store**](docs/KlimApi.md#sync_bulk_store) | **POST** /stores/{store_ident}/sync/bulk | Sync multiple Products
67+
[**sync_store**](docs/KlimApi.md#sync_store) | **POST** /stores/{store_ident}/sync | Sync a single Product
68+
69+
70+
## Models
71+
72+
- [AddWebhookRequest](docs/AddWebhookRequest.md)
73+
- [BuyAmount](docs/BuyAmount.md)
74+
- [BuyPrice](docs/BuyPrice.md)
75+
- [CalculateRequest](docs/CalculateRequest.md)
76+
- [CalculationResult](docs/CalculationResult.md)
77+
- [CalculationResults](docs/CalculationResults.md)
78+
- [CartItem](docs/CartItem.md)
79+
- [CartResult](docs/CartResult.md)
80+
- [CartResultCalculationResultsInner](docs/CartResultCalculationResultsInner.md)
81+
- [CartResultSettings](docs/CartResultSettings.md)
82+
- [Category](docs/Category.md)
83+
- [CertificationAuthority](docs/CertificationAuthority.md)
84+
- [CheckoutLink](docs/CheckoutLink.md)
85+
- [CheckoutLinkCalculated](docs/CheckoutLinkCalculated.md)
86+
- [CheckoutLinks](docs/CheckoutLinks.md)
87+
- [CheckoutLinksCalculated](docs/CheckoutLinksCalculated.md)
88+
- [GetMetricsRequest](docs/GetMetricsRequest.md)
89+
- [GetOrdersRequest](docs/GetOrdersRequest.md)
90+
- [GetOrdersRequestFilters](docs/GetOrdersRequestFilters.md)
91+
- [LinkByCalculationRequest](docs/LinkByCalculationRequest.md)
92+
- [LinkByCarbonRequest](docs/LinkByCarbonRequest.md)
93+
- [LinkByPriceRequest](docs/LinkByPriceRequest.md)
94+
- [MetadataOrders](docs/MetadataOrders.md)
95+
- [Order](docs/Order.md)
96+
- [OrderByCalculationRequest](docs/OrderByCalculationRequest.md)
97+
- [OrderCalculated](docs/OrderCalculated.md)
98+
- [OrderMetrics](docs/OrderMetrics.md)
99+
- [OrderRecipient](docs/OrderRecipient.md)
100+
- [PendingByCalculationRequest](docs/PendingByCalculationRequest.md)
101+
- [PendingByCarbonRequest](docs/PendingByCarbonRequest.md)
102+
- [PendingByPriceRequest](docs/PendingByPriceRequest.md)
103+
- [PendingOrder](docs/PendingOrder.md)
104+
- [PendingOrderCalculated](docs/PendingOrderCalculated.md)
105+
- [PendingOrders](docs/PendingOrders.md)
106+
- [PendingOrdersCalculated](docs/PendingOrdersCalculated.md)
107+
- [ProcessOrder](docs/ProcessOrder.md)
108+
- [Product](docs/Product.md)
109+
- [Project](docs/Project.md)
110+
111+

docs/AddWebhookRequest.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# AddWebhookRequest
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**hook_url** | **str** | The endpoint the POST request will be sent to |
9+
**trigger** | **str** | The trigger which will cause the webhook to be sent |
10+
11+
## Example
12+
13+
```python
14+
from klimapi_python.models.add_webhook_request import AddWebhookRequest
15+
16+
# TODO update the JSON string below
17+
json = "{}"
18+
# create an instance of AddWebhookRequest from a JSON string
19+
add_webhook_request_instance = AddWebhookRequest.from_json(json)
20+
# print the JSON string representation of the object
21+
print(AddWebhookRequest.to_json())
22+
23+
# convert the object into a dict
24+
add_webhook_request_dict = add_webhook_request_instance.to_dict()
25+
# create an instance of AddWebhookRequest from a dict
26+
add_webhook_request_from_dict = AddWebhookRequest.from_dict(add_webhook_request_dict)
27+
```
28+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
29+
30+

docs/BuyAmount.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# BuyAmount
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**kg_co2e** | **int** | The amount of kg CO<sub>2</sub>e the compensation should provide |
9+
**recipient_name** | **str** | The name which should be associated with the compensation |
10+
**recipient_email** | **str** | If a valid e-mail address is provided, we will send the certificate to this address | [optional]
11+
**send_at** | **datetime** | Timestamp of when the certificate should be send to the customer in ISO 8601 format (UTC). Defaults to the current timestamp. | [optional]
12+
**price_limit** | **float** | Set an optional price limit. if the order would exceed the limit a error will be thrown. Set the limit in the given currency. | [optional]
13+
**metadata** | **Dict[str, str]** | Add additional queryable information to the order as key-value pairs | [optional]
14+
15+
## Example
16+
17+
```python
18+
from klimapi_python.models.buy_amount import BuyAmount
19+
20+
# TODO update the JSON string below
21+
json = "{}"
22+
# create an instance of BuyAmount from a JSON string
23+
buy_amount_instance = BuyAmount.from_json(json)
24+
# print the JSON string representation of the object
25+
print(BuyAmount.to_json())
26+
27+
# convert the object into a dict
28+
buy_amount_dict = buy_amount_instance.to_dict()
29+
# create an instance of BuyAmount from a dict
30+
buy_amount_from_dict = BuyAmount.from_dict(buy_amount_dict)
31+
```
32+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
33+
34+

docs/BuyPrice.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# BuyPrice
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**price_amount** | **float** | The total of the compensation in your given currency **excl. VAT**. Minimum order is 0.5 in your given currency. |
9+
**recipient_name** | **str** | The name which should be associated with the compensation |
10+
**recipient_email** | **str** | If a valid e-mail address is provided, we will send the certificate to this address | [optional]
11+
**send_at** | **datetime** | Timestamp of when the certificate should be send to the customer in ISO 8601 format (UTC). Defaults to the current timestamp. | [optional]
12+
**metadata** | **Dict[str, str]** | Add additional queryable information to the order as key-value pairs | [optional]
13+
14+
## Example
15+
16+
```python
17+
from klimapi_python.models.buy_price import BuyPrice
18+
19+
# TODO update the JSON string below
20+
json = "{}"
21+
# create an instance of BuyPrice from a JSON string
22+
buy_price_instance = BuyPrice.from_json(json)
23+
# print the JSON string representation of the object
24+
print(BuyPrice.to_json())
25+
26+
# convert the object into a dict
27+
buy_price_dict = buy_price_instance.to_dict()
28+
# create an instance of BuyPrice from a dict
29+
buy_price_from_dict = BuyPrice.from_dict(buy_price_dict)
30+
```
31+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
32+
33+

0 commit comments

Comments
 (0)