makeimpact 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,274 @@
1
+ Metadata-Version: 2.4
2
+ Name: makeimpact
3
+ Version: 1.0.0
4
+ Summary: Python SDK for 1ClickImpact API
5
+ Home-page: https://github.com/1ClickImpact/makeimpact-py
6
+ Author: 1ClickImpact
7
+ Author-email: info@1clickimpact.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: requests>=2.0.0
14
+ Dynamic: author
15
+ Dynamic: author-email
16
+ Dynamic: classifier
17
+ Dynamic: description
18
+ Dynamic: description-content-type
19
+ Dynamic: home-page
20
+ Dynamic: requires-dist
21
+ Dynamic: requires-python
22
+ Dynamic: summary
23
+
24
+ # 🌱 MakeImpact Python SDK
25
+
26
+ [![PyPI version](https://img.shields.io/pypi/v/makeimpact.svg)](https://pypi.org/project/makeimpact/)
27
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
28
+ [![Python](https://img.shields.io/badge/Python-3.6%2B-blue)](https://www.python.org/)
29
+
30
+ > Official Python SDK for 1ClickImpact - Easily integrate impact actions into your Python applications
31
+
32
+ ## 📦 Installation
33
+
34
+ ```bash
35
+ pip install makeimpact
36
+ # or
37
+ poetry add makeimpact
38
+ ```
39
+
40
+ ## 🚀 Getting Started
41
+
42
+ You'll need an API key to use this SDK. You can get your API key from the [1ClickImpact Account API Keys page](https://1clickimpact.com/account/api-keys).
43
+
44
+ ```python
45
+ from makeimpact import OneClickImpact, Environment
46
+
47
+ # Initialize the SDK with your API key (production environment by default)
48
+ sdk = OneClickImpact("your_api_key")
49
+
50
+ # Create environmental impact with just a few lines of code
51
+ sdk.plant_tree({"amount": 1})
52
+ sdk.clean_ocean({"amount": 5})
53
+ sdk.capture_carbon({"amount": 2})
54
+ ```
55
+
56
+ ## 🌍 Environmental Impact Actions
57
+
58
+ ### 🌳 Plant Trees
59
+
60
+ Help combat deforestation and climate change by planting trees.
61
+
62
+ ```python
63
+ from makeimpact import OneClickImpact, PlantTreeParams
64
+
65
+ sdk = OneClickImpact("your_api_key")
66
+
67
+ # Plant a single tree
68
+ sdk.plant_tree(PlantTreeParams(amount=1))
69
+
70
+ # Plant trees with a specific category
71
+ sdk.plant_tree(PlantTreeParams(amount=10, category="food"))
72
+
73
+ # Plant trees with customer tracking
74
+ sdk.plant_tree(PlantTreeParams(
75
+ amount=5,
76
+ customer_email="customer@example.com",
77
+ customer_name="John Doe"
78
+ ))
79
+ ```
80
+
81
+ ### 🌊 Clean Ocean Plastic
82
+
83
+ Remove plastic waste from our oceans to protect marine life.
84
+
85
+ ```python
86
+ from makeimpact import OneClickImpact, CleanOceanParams
87
+
88
+ sdk = OneClickImpact("your_api_key")
89
+
90
+ # Clean 5 pounds of ocean plastic
91
+ sdk.clean_ocean(CleanOceanParams(amount=5))
92
+
93
+ # Clean ocean plastic with customer tracking
94
+ sdk.clean_ocean(CleanOceanParams(
95
+ amount=10,
96
+ customer_email="customer@example.com",
97
+ customer_name="John Doe"
98
+ ))
99
+ ```
100
+
101
+ ### ♻️ Capture Carbon
102
+
103
+ Reduce greenhouse gas emissions by capturing carbon.
104
+
105
+ ```python
106
+ from makeimpact import OneClickImpact, CaptureCarbonParams
107
+
108
+ sdk = OneClickImpact("your_api_key")
109
+
110
+ # Capture 2 pounds of carbon
111
+ sdk.capture_carbon(CaptureCarbonParams(amount=2))
112
+
113
+ # Capture carbon with customer tracking
114
+ sdk.capture_carbon(CaptureCarbonParams(
115
+ amount=5,
116
+ customer_email="customer@example.com",
117
+ customer_name="John Doe"
118
+ ))
119
+ ```
120
+
121
+ ### 💰 Donate Money
122
+
123
+ Support any cause through direct monetary donations.
124
+
125
+ ```python
126
+ from makeimpact import OneClickImpact, DonateMoneyParams
127
+
128
+ sdk = OneClickImpact("your_api_key")
129
+
130
+ # Donate $1.00 (amount in cents)
131
+ sdk.donate_money(DonateMoneyParams(amount=100))
132
+
133
+ # Donate with customer tracking
134
+ sdk.donate_money(DonateMoneyParams(
135
+ amount=500, # $5.00
136
+ customer_email="customer@example.com",
137
+ customer_name="John Doe"
138
+ ))
139
+ ```
140
+
141
+ > **Note**: To set up a custom cause for donations, please contact 1ClickImpact directly.
142
+ > All causes must be vetted and approved to ensure they meet their standards for transparency and impact.
143
+
144
+ ## 📊 Data Access & Reporting
145
+
146
+ ### Get Records
147
+
148
+ Retrieve impact records with optional filtering.
149
+
150
+ ```python
151
+ from makeimpact import OneClickImpact, GetRecordsParams
152
+
153
+ sdk = OneClickImpact("your_api_key")
154
+
155
+ # Get all records
156
+ records = sdk.get_records()
157
+
158
+ # Filter records by type
159
+ tree_records = sdk.get_records(GetRecordsParams(
160
+ filter_by="tree_planted"
161
+ ))
162
+
163
+ # Filter records by date range
164
+ recent_records = sdk.get_records(GetRecordsParams(
165
+ start_date="2023-01-01",
166
+ end_date="2023-12-31"
167
+ ))
168
+
169
+ # Pagination
170
+ paginated_records = sdk.get_records(GetRecordsParams(
171
+ cursor="cursor_from_previous_response",
172
+ limit=10
173
+ ))
174
+ ```
175
+
176
+ ### Get Customer Records
177
+
178
+ Retrieve records for specific customers.
179
+
180
+ ```python
181
+ from makeimpact import OneClickImpact, GetCustomerRecordsParams
182
+
183
+ sdk = OneClickImpact("your_api_key")
184
+
185
+ # Get records for a specific customer
186
+ customer_records = sdk.get_customer_records(GetCustomerRecordsParams(
187
+ customer_email="customer@example.com"
188
+ ))
189
+
190
+ # Filter customer records by type
191
+ customer_tree_records = sdk.get_customer_records(GetCustomerRecordsParams(
192
+ customer_email="customer@example.com",
193
+ filter_by="tree_planted"
194
+ ))
195
+ ```
196
+
197
+ ### Get Customers
198
+
199
+ Retrieve customer information.
200
+
201
+ ```python
202
+ from makeimpact import OneClickImpact, GetCustomersParams
203
+
204
+ sdk = OneClickImpact("your_api_key")
205
+
206
+ # Get all customers (default limit is 10)
207
+ customers = sdk.get_customers()
208
+
209
+ # Get customers with filtering and pagination
210
+ filtered_customers = sdk.get_customers(GetCustomersParams(
211
+ customer_email="example@email.com", # Optional: Filter by email
212
+ limit=50, # Optional: Limit results (1-1000)
213
+ cursor="cursor_from_previous_response" # Optional: For pagination
214
+ ))
215
+ ```
216
+
217
+ ### Get Impact
218
+
219
+ Get aggregated impact statistics.
220
+
221
+ ```python
222
+ from makeimpact import OneClickImpact
223
+
224
+ sdk = OneClickImpact("your_api_key")
225
+
226
+ # Get overall impact statistics for your organization
227
+ impact = sdk.get_impact()
228
+
229
+ print(f"Trees planted: {impact.tree_planted}")
230
+ print(f"Ocean waste removed: {impact.waste_removed} lbs")
231
+ print(f"Carbon captured: {impact.carbon_captured} lbs")
232
+ print(f"Money donated: ${impact.money_donated / 100}")
233
+ ```
234
+
235
+ ### Who Am I
236
+
237
+ Verify your API key and get account information.
238
+
239
+ ```python
240
+ from makeimpact import OneClickImpact
241
+
242
+ sdk = OneClickImpact("your_api_key")
243
+
244
+ # Verify API key and get account information
245
+ account_info = sdk.who_am_i()
246
+ ```
247
+
248
+ ## ⚙️ Configuration
249
+
250
+ ### Environments
251
+
252
+ The SDK supports two environments:
253
+
254
+ - **Production** (default): Uses the live API at `https://api.1clickimpact.com`
255
+ - **Sandbox**: Uses the testing API at `https://sandbox.1clickimpact.com`
256
+
257
+ To use the sandbox environment for testing:
258
+
259
+ ```python
260
+ from makeimpact import OneClickImpact, Environment
261
+
262
+ # Initialize with sandbox environment
263
+ sdk = OneClickImpact("your_test_api_key", Environment.SANDBOX)
264
+ ```
265
+
266
+ ## 🔗 Additional Resources
267
+
268
+ - [1ClickImpact API Documentation](https://docs.1clickimpact.com/plant-trees)
269
+ - [1ClickImpact Website](https://www.1clickimpact.com)
270
+ - [Pricing & API Keys](https://www.1clickimpact.com/pricing)
271
+
272
+ ## 📄 License
273
+
274
+ MIT
@@ -0,0 +1,251 @@
1
+ # 🌱 MakeImpact Python SDK
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/makeimpact.svg)](https://pypi.org/project/makeimpact/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
5
+ [![Python](https://img.shields.io/badge/Python-3.6%2B-blue)](https://www.python.org/)
6
+
7
+ > Official Python SDK for 1ClickImpact - Easily integrate impact actions into your Python applications
8
+
9
+ ## 📦 Installation
10
+
11
+ ```bash
12
+ pip install makeimpact
13
+ # or
14
+ poetry add makeimpact
15
+ ```
16
+
17
+ ## 🚀 Getting Started
18
+
19
+ You'll need an API key to use this SDK. You can get your API key from the [1ClickImpact Account API Keys page](https://1clickimpact.com/account/api-keys).
20
+
21
+ ```python
22
+ from makeimpact import OneClickImpact, Environment
23
+
24
+ # Initialize the SDK with your API key (production environment by default)
25
+ sdk = OneClickImpact("your_api_key")
26
+
27
+ # Create environmental impact with just a few lines of code
28
+ sdk.plant_tree({"amount": 1})
29
+ sdk.clean_ocean({"amount": 5})
30
+ sdk.capture_carbon({"amount": 2})
31
+ ```
32
+
33
+ ## 🌍 Environmental Impact Actions
34
+
35
+ ### 🌳 Plant Trees
36
+
37
+ Help combat deforestation and climate change by planting trees.
38
+
39
+ ```python
40
+ from makeimpact import OneClickImpact, PlantTreeParams
41
+
42
+ sdk = OneClickImpact("your_api_key")
43
+
44
+ # Plant a single tree
45
+ sdk.plant_tree(PlantTreeParams(amount=1))
46
+
47
+ # Plant trees with a specific category
48
+ sdk.plant_tree(PlantTreeParams(amount=10, category="food"))
49
+
50
+ # Plant trees with customer tracking
51
+ sdk.plant_tree(PlantTreeParams(
52
+ amount=5,
53
+ customer_email="customer@example.com",
54
+ customer_name="John Doe"
55
+ ))
56
+ ```
57
+
58
+ ### 🌊 Clean Ocean Plastic
59
+
60
+ Remove plastic waste from our oceans to protect marine life.
61
+
62
+ ```python
63
+ from makeimpact import OneClickImpact, CleanOceanParams
64
+
65
+ sdk = OneClickImpact("your_api_key")
66
+
67
+ # Clean 5 pounds of ocean plastic
68
+ sdk.clean_ocean(CleanOceanParams(amount=5))
69
+
70
+ # Clean ocean plastic with customer tracking
71
+ sdk.clean_ocean(CleanOceanParams(
72
+ amount=10,
73
+ customer_email="customer@example.com",
74
+ customer_name="John Doe"
75
+ ))
76
+ ```
77
+
78
+ ### ♻️ Capture Carbon
79
+
80
+ Reduce greenhouse gas emissions by capturing carbon.
81
+
82
+ ```python
83
+ from makeimpact import OneClickImpact, CaptureCarbonParams
84
+
85
+ sdk = OneClickImpact("your_api_key")
86
+
87
+ # Capture 2 pounds of carbon
88
+ sdk.capture_carbon(CaptureCarbonParams(amount=2))
89
+
90
+ # Capture carbon with customer tracking
91
+ sdk.capture_carbon(CaptureCarbonParams(
92
+ amount=5,
93
+ customer_email="customer@example.com",
94
+ customer_name="John Doe"
95
+ ))
96
+ ```
97
+
98
+ ### 💰 Donate Money
99
+
100
+ Support any cause through direct monetary donations.
101
+
102
+ ```python
103
+ from makeimpact import OneClickImpact, DonateMoneyParams
104
+
105
+ sdk = OneClickImpact("your_api_key")
106
+
107
+ # Donate $1.00 (amount in cents)
108
+ sdk.donate_money(DonateMoneyParams(amount=100))
109
+
110
+ # Donate with customer tracking
111
+ sdk.donate_money(DonateMoneyParams(
112
+ amount=500, # $5.00
113
+ customer_email="customer@example.com",
114
+ customer_name="John Doe"
115
+ ))
116
+ ```
117
+
118
+ > **Note**: To set up a custom cause for donations, please contact 1ClickImpact directly.
119
+ > All causes must be vetted and approved to ensure they meet their standards for transparency and impact.
120
+
121
+ ## 📊 Data Access & Reporting
122
+
123
+ ### Get Records
124
+
125
+ Retrieve impact records with optional filtering.
126
+
127
+ ```python
128
+ from makeimpact import OneClickImpact, GetRecordsParams
129
+
130
+ sdk = OneClickImpact("your_api_key")
131
+
132
+ # Get all records
133
+ records = sdk.get_records()
134
+
135
+ # Filter records by type
136
+ tree_records = sdk.get_records(GetRecordsParams(
137
+ filter_by="tree_planted"
138
+ ))
139
+
140
+ # Filter records by date range
141
+ recent_records = sdk.get_records(GetRecordsParams(
142
+ start_date="2023-01-01",
143
+ end_date="2023-12-31"
144
+ ))
145
+
146
+ # Pagination
147
+ paginated_records = sdk.get_records(GetRecordsParams(
148
+ cursor="cursor_from_previous_response",
149
+ limit=10
150
+ ))
151
+ ```
152
+
153
+ ### Get Customer Records
154
+
155
+ Retrieve records for specific customers.
156
+
157
+ ```python
158
+ from makeimpact import OneClickImpact, GetCustomerRecordsParams
159
+
160
+ sdk = OneClickImpact("your_api_key")
161
+
162
+ # Get records for a specific customer
163
+ customer_records = sdk.get_customer_records(GetCustomerRecordsParams(
164
+ customer_email="customer@example.com"
165
+ ))
166
+
167
+ # Filter customer records by type
168
+ customer_tree_records = sdk.get_customer_records(GetCustomerRecordsParams(
169
+ customer_email="customer@example.com",
170
+ filter_by="tree_planted"
171
+ ))
172
+ ```
173
+
174
+ ### Get Customers
175
+
176
+ Retrieve customer information.
177
+
178
+ ```python
179
+ from makeimpact import OneClickImpact, GetCustomersParams
180
+
181
+ sdk = OneClickImpact("your_api_key")
182
+
183
+ # Get all customers (default limit is 10)
184
+ customers = sdk.get_customers()
185
+
186
+ # Get customers with filtering and pagination
187
+ filtered_customers = sdk.get_customers(GetCustomersParams(
188
+ customer_email="example@email.com", # Optional: Filter by email
189
+ limit=50, # Optional: Limit results (1-1000)
190
+ cursor="cursor_from_previous_response" # Optional: For pagination
191
+ ))
192
+ ```
193
+
194
+ ### Get Impact
195
+
196
+ Get aggregated impact statistics.
197
+
198
+ ```python
199
+ from makeimpact import OneClickImpact
200
+
201
+ sdk = OneClickImpact("your_api_key")
202
+
203
+ # Get overall impact statistics for your organization
204
+ impact = sdk.get_impact()
205
+
206
+ print(f"Trees planted: {impact.tree_planted}")
207
+ print(f"Ocean waste removed: {impact.waste_removed} lbs")
208
+ print(f"Carbon captured: {impact.carbon_captured} lbs")
209
+ print(f"Money donated: ${impact.money_donated / 100}")
210
+ ```
211
+
212
+ ### Who Am I
213
+
214
+ Verify your API key and get account information.
215
+
216
+ ```python
217
+ from makeimpact import OneClickImpact
218
+
219
+ sdk = OneClickImpact("your_api_key")
220
+
221
+ # Verify API key and get account information
222
+ account_info = sdk.who_am_i()
223
+ ```
224
+
225
+ ## ⚙️ Configuration
226
+
227
+ ### Environments
228
+
229
+ The SDK supports two environments:
230
+
231
+ - **Production** (default): Uses the live API at `https://api.1clickimpact.com`
232
+ - **Sandbox**: Uses the testing API at `https://sandbox.1clickimpact.com`
233
+
234
+ To use the sandbox environment for testing:
235
+
236
+ ```python
237
+ from makeimpact import OneClickImpact, Environment
238
+
239
+ # Initialize with sandbox environment
240
+ sdk = OneClickImpact("your_test_api_key", Environment.SANDBOX)
241
+ ```
242
+
243
+ ## 🔗 Additional Resources
244
+
245
+ - [1ClickImpact API Documentation](https://docs.1clickimpact.com/plant-trees)
246
+ - [1ClickImpact Website](https://www.1clickimpact.com)
247
+ - [Pricing & API Keys](https://www.1clickimpact.com/pricing)
248
+
249
+ ## 📄 License
250
+
251
+ MIT
@@ -0,0 +1,76 @@
1
+ from .client import OneClickImpact
2
+ from .types import (
3
+ Environment,
4
+ CustomerInfo,
5
+ Customer,
6
+ PlantTreeParams,
7
+ PlantTreeResponse,
8
+ CleanOceanParams,
9
+ CleanOceanResponse,
10
+ CaptureCarbonParams,
11
+ CaptureCarbonResponse,
12
+ DonateMoneyParams,
13
+ DonateMoneyResponse,
14
+ GetRecordsParams,
15
+ GetRecordsResponse,
16
+ GetCustomerRecordsParams,
17
+ GetCustomerRecordsResponse,
18
+ GetCustomersParams,
19
+ GetCustomersResponse,
20
+ ImpactResponse,
21
+ WhoAmIResponse,
22
+ BaseRecord,
23
+ TreePlantedRecord,
24
+ WasteRemovedRecord,
25
+ CarbonCapturedRecord,
26
+ MoneyDonatedRecord,
27
+ BaseRecordWithCustomer,
28
+ TreePlantedRecordWithCustomer,
29
+ WasteRemovedRecordWithCustomer,
30
+ CarbonCapturedRecordWithCustomer,
31
+ MoneyDonatedRecordWithCustomer,
32
+ ImpactRecord,
33
+ CustomerImpactRecord,
34
+ CustomerDetails,
35
+ ErrorResponse
36
+ )
37
+ from .exceptions import OneClickImpactError
38
+
39
+ __all__ = [
40
+ "OneClickImpact",
41
+ "Environment",
42
+ "CustomerInfo",
43
+ "Customer",
44
+ "PlantTreeParams",
45
+ "PlantTreeResponse",
46
+ "CleanOceanParams",
47
+ "CleanOceanResponse",
48
+ "CaptureCarbonParams",
49
+ "CaptureCarbonResponse",
50
+ "DonateMoneyParams",
51
+ "DonateMoneyResponse",
52
+ "GetRecordsParams",
53
+ "GetRecordsResponse",
54
+ "GetCustomerRecordsParams",
55
+ "GetCustomerRecordsResponse",
56
+ "GetCustomersParams",
57
+ "GetCustomersResponse",
58
+ "ImpactResponse",
59
+ "WhoAmIResponse",
60
+ "OneClickImpactError",
61
+ # Add missing record types to __all__ as well
62
+ "BaseRecord",
63
+ "TreePlantedRecord",
64
+ "WasteRemovedRecord",
65
+ "CarbonCapturedRecord",
66
+ "MoneyDonatedRecord",
67
+ "BaseRecordWithCustomer",
68
+ "TreePlantedRecordWithCustomer",
69
+ "WasteRemovedRecordWithCustomer",
70
+ "CarbonCapturedRecordWithCustomer",
71
+ "MoneyDonatedRecordWithCustomer",
72
+ "ImpactRecord",
73
+ "CustomerImpactRecord",
74
+ "CustomerDetails",
75
+ "ErrorResponse"
76
+ ]