Skip to content

Commit 6345855

Browse files
committed
Remove remaining estimates
1 parent a646d8d commit 6345855

22 files changed

+18
-5823
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.6.0] - 2025-11-07
9+
10+
### Removed
11+
12+
- Removes `create_mass_estimate` and `create_bitcoin_estimate` method
13+
- Retires all remaining estimates functionalities
14+
815
## [2.4.0] - 2025-05-16
916

1017
### Removed

README.md

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ orders = patch.orders.retrieve_orders()
4949

5050
### Orders
5151

52-
In Patch, orders represent a purchase of carbon offsets or negative emissions by mass.
53-
Place orders directly if you know the amount of carbon dioxide you would like to sequester.
54-
If you do not know how much to purchase, use an estimate.
55-
You can also create an order with a maximum desired price, and we'll allocate enough mass to
56-
fulfill the order for you.
57-
5852
[API Reference](https://docs.patch.io/#/orders)
5953

6054
#### Examples
@@ -114,61 +108,6 @@ page = 1 # Pass in which page of orders you'd like
114108
patch.orders.retrieve_orders(page=page)
115109
```
116110

117-
### Estimates
118-
119-
Estimates allow API users to get a quote for the cost of compensating a certain amount of CO2. When creating an estimate, an order in the `draft` state will also be created, reserving the allocation of a project for 5 minutes. If you don't place your draft order within those 5 minutes, the order will automatically be cancelled.
120-
121-
[API Reference](https://docs.patch.io/#/estimates)
122-
123-
#### Examples
124-
125-
```python
126-
import patch_api
127-
128-
patch = patch_api.ApiClient(api_key=os.environ.get('SANDBOX_API_KEY'))
129-
130-
# Create an estimate
131-
mass_g = 1_000_000 # Pass in the mass in grams (i.e. 1 metric tonne)
132-
patch.estimates.create_mass_estimate(mass_g=mass_g)
133-
134-
## You can also specify a project-id field (optional) to be used instead of the preferred one
135-
project_id = 'pro_test_1234' # Pass in the project's ID
136-
patch.estimates.create_mass_estimate(mass_g=mass_g, project_id=project_id)
137-
138-
# Create a flight estimate
139-
distance_m = 1_000_000 # Pass in the distance traveled in meters
140-
patch.estimates.create_flight_estimate(distance_m=distance_m)
141-
142-
# Create an ecommerce estimate
143-
distance_m = 1_000_000 # Pass in the distance traveled in meters
144-
transportation_method = "rail"
145-
package_mass_g = 5000
146-
patch.estimates.create_ecommerce_estimate(
147-
distance_m=distance_m,
148-
transportation_method=transportation_method,
149-
package_mass_g=package_mass_g
150-
)
151-
152-
# Create a vehicle estimate
153-
distance_m = 1_000_000 # Pass in the distance traveled in meters
154-
make = "Toyota"
155-
model = "Corolla"
156-
year = 1995
157-
patch.estimates.create_vehicle_estimate(distance_m=distance_m, make=make, model=model, year=year)
158-
159-
# Create a bitcoin estimate
160-
transaction_value_btc_sats = 1000 # [Optional] Pass in the transaction value in satoshis
161-
patch.estimates.create_bitcoin_estimate(transaction_value_btc_sats=transaction_value_btc_sats)
162-
163-
# Retrieve an estimate
164-
estimate_id = 'est_test_1234'
165-
patch.estimates.retrieve_estimate(id=estimate_id)
166-
167-
# Retrieve a list of estimates
168-
page = 1 # Pass in which page of estimates you'd like
169-
patch.estimates.retrieve_estimates(page=page)
170-
```
171-
172111
### Projects
173112

174113
Projects are the ways Patch takes CO2 out of the air. They can represent reforestation, enhanced weathering, direct air carbon capture, etc. When you place an order via Patch, it is allocated to a project.

patch_api/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# coding: utf-8
22

3+
# flake8: noqa
4+
35
"""
46
Patch API V2
57
@@ -13,7 +15,7 @@
1315

1416
from __future__ import absolute_import
1517

16-
__version__ = "2.4.0"
18+
__version__ = "2.6.0"
1719

1820
# import ApiClient
1921
from patch_api.api_client import ApiClient

patch_api/api/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from __future__ import absolute_import
22

3+
# flake8: noqa
4+
35
# import apis into api package
4-
from patch_api.api.estimates_api import EstimatesApi
56
from patch_api.api.order_line_items_api import OrderLineItemsApi
67
from patch_api.api.orders_api import OrdersApi
78
from patch_api.api.projects_api import ProjectsApi

0 commit comments

Comments
 (0)