karrio-easypost 2025.5__py3-none-any.whl
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.
- karrio/mappers/easypost/__init__.py +3 -0
- karrio/mappers/easypost/mapper.py +67 -0
- karrio/mappers/easypost/proxy.py +100 -0
- karrio/mappers/easypost/settings.py +18 -0
- karrio/plugins/easypost/__init__.py +19 -0
- karrio/providers/easypost/__init__.py +8 -0
- karrio/providers/easypost/error.py +31 -0
- karrio/providers/easypost/rate.py +194 -0
- karrio/providers/easypost/shipment/__init__.py +8 -0
- karrio/providers/easypost/shipment/cancel.py +31 -0
- karrio/providers/easypost/shipment/create.py +214 -0
- karrio/providers/easypost/tracking.py +118 -0
- karrio/providers/easypost/units.py +1038 -0
- karrio/providers/easypost/utils.py +33 -0
- karrio/schemas/easypost/__init__.py +0 -0
- karrio/schemas/easypost/error_response.py +15 -0
- karrio/schemas/easypost/shipment_purchase.py +14 -0
- karrio/schemas/easypost/shipment_request.py +79 -0
- karrio/schemas/easypost/shipments_response.py +248 -0
- karrio/schemas/easypost/trackers_response.py +79 -0
- karrio_easypost-2025.5.dist-info/METADATA +46 -0
- karrio_easypost-2025.5.dist-info/RECORD +26 -0
- karrio_easypost-2025.5.dist-info/WHEEL +5 -0
- karrio_easypost-2025.5.dist-info/entry_points.txt +2 -0
- karrio_easypost-2025.5.dist-info/licenses/LICENSE +165 -0
- karrio_easypost-2025.5.dist-info/top_level.txt +3 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from base64 import b64encode
|
|
2
|
+
import base64
|
|
3
|
+
from karrio.core import Settings as BaseSettings
|
|
4
|
+
from karrio.core.utils.helpers import request
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Settings(BaseSettings):
|
|
8
|
+
"""EasyPost connection settings."""
|
|
9
|
+
|
|
10
|
+
api_key: str
|
|
11
|
+
account_country_code: str = None
|
|
12
|
+
metadata: dict = {}
|
|
13
|
+
config: dict = {}
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def carrier_name(self):
|
|
17
|
+
return "easypost"
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def server_url(self):
|
|
21
|
+
return "https://api.easypost.com/v2"
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def authorization(self):
|
|
25
|
+
pair = "%s:%s" % (self.api_key, "")
|
|
26
|
+
return b64encode(pair.encode("utf-8")).decode("ascii")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def download_label(file_url: str) -> str:
|
|
30
|
+
return request(
|
|
31
|
+
decoder=lambda b: base64.encodebytes(b).decode("utf-8"),
|
|
32
|
+
url=file_url,
|
|
33
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import attr
|
|
2
|
+
import jstruct
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@attr.s(auto_attribs=True)
|
|
7
|
+
class Error:
|
|
8
|
+
code: typing.Optional[str] = None
|
|
9
|
+
message: typing.Optional[str] = None
|
|
10
|
+
errors: typing.Optional[typing.List[typing.Any]] = None
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@attr.s(auto_attribs=True)
|
|
14
|
+
class ErrorResponse:
|
|
15
|
+
error: typing.Optional[Error] = jstruct.JStruct[Error]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import attr
|
|
2
|
+
import jstruct
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@attr.s(auto_attribs=True)
|
|
7
|
+
class Rate:
|
|
8
|
+
id: typing.Optional[str] = None
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@attr.s(auto_attribs=True)
|
|
12
|
+
class ShipmentPurchase:
|
|
13
|
+
insurance: typing.Optional[float] = None
|
|
14
|
+
rate: typing.Optional[Rate] = jstruct.JStruct[Rate]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import attr
|
|
2
|
+
import jstruct
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@attr.s(auto_attribs=True)
|
|
7
|
+
class Address:
|
|
8
|
+
mode: typing.Optional[str] = None
|
|
9
|
+
street1: typing.Optional[str] = None
|
|
10
|
+
street2: typing.Optional[str] = None
|
|
11
|
+
city: typing.Optional[str] = None
|
|
12
|
+
state: typing.Optional[str] = None
|
|
13
|
+
zip: typing.Optional[int] = None
|
|
14
|
+
country: typing.Optional[str] = None
|
|
15
|
+
residential: typing.Optional[bool] = None
|
|
16
|
+
carrier_facility: typing.Optional[str] = None
|
|
17
|
+
name: typing.Optional[str] = None
|
|
18
|
+
company: typing.Optional[str] = None
|
|
19
|
+
phone: typing.Optional[str] = None
|
|
20
|
+
email: typing.Optional[str] = None
|
|
21
|
+
federal_tax_id: typing.Optional[str] = None
|
|
22
|
+
state_tax_id: typing.Optional[str] = None
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@attr.s(auto_attribs=True)
|
|
26
|
+
class CustomsItem:
|
|
27
|
+
description: typing.Optional[str] = None
|
|
28
|
+
hs_tariff_number: typing.Optional[int] = None
|
|
29
|
+
origin_country: typing.Optional[str] = None
|
|
30
|
+
quantity: typing.Optional[int] = None
|
|
31
|
+
value: typing.Optional[float] = None
|
|
32
|
+
weight: typing.Optional[float] = None
|
|
33
|
+
code: typing.Optional[str] = None
|
|
34
|
+
manufacturer: typing.Optional[str] = None
|
|
35
|
+
currency: typing.Optional[str] = None
|
|
36
|
+
eccn: typing.Optional[str] = None
|
|
37
|
+
printed_commodity_identifier: typing.Optional[str] = None
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@attr.s(auto_attribs=True)
|
|
41
|
+
class CustomsInfo:
|
|
42
|
+
contents_explanation: typing.Optional[str] = None
|
|
43
|
+
contents_type: typing.Optional[str] = None
|
|
44
|
+
customs_certify: typing.Optional[bool] = None
|
|
45
|
+
customs_signer: typing.Optional[str] = None
|
|
46
|
+
eel_pfc: typing.Optional[str] = None
|
|
47
|
+
non_delivery_option: typing.Optional[str] = None
|
|
48
|
+
restriction_comments: typing.Optional[str] = None
|
|
49
|
+
restriction_type: typing.Optional[str] = None
|
|
50
|
+
declaration: typing.Optional[str] = None
|
|
51
|
+
customs_items: typing.Optional[typing.List[CustomsItem]] = jstruct.JList[CustomsItem]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@attr.s(auto_attribs=True)
|
|
55
|
+
class Parcel:
|
|
56
|
+
length: typing.Optional[float] = None
|
|
57
|
+
width: typing.Optional[float] = None
|
|
58
|
+
height: typing.Optional[float] = None
|
|
59
|
+
predefined_package: typing.Optional[str] = None
|
|
60
|
+
weight: typing.Optional[float] = None
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@attr.s(auto_attribs=True)
|
|
64
|
+
class Shipment:
|
|
65
|
+
reference: typing.Optional[str] = None
|
|
66
|
+
is_return: typing.Optional[bool] = None
|
|
67
|
+
to_address: typing.Optional[Address] = jstruct.JStruct[Address]
|
|
68
|
+
from_address: typing.Optional[Address] = jstruct.JStruct[Address]
|
|
69
|
+
return_address: typing.Optional[Address] = jstruct.JStruct[Address]
|
|
70
|
+
buyer_address: typing.Optional[Address] = jstruct.JStruct[Address]
|
|
71
|
+
parcel: typing.Optional[Parcel] = jstruct.JStruct[Parcel]
|
|
72
|
+
customs_info: typing.Optional[CustomsInfo] = jstruct.JStruct[CustomsInfo]
|
|
73
|
+
options: typing.Any = None
|
|
74
|
+
carrier_accounts: typing.Optional[typing.List[str]] = None
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@attr.s(auto_attribs=True)
|
|
78
|
+
class ShipmentRequest:
|
|
79
|
+
shipment: typing.Optional[Shipment] = jstruct.JStruct[Shipment]
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import attr
|
|
2
|
+
import jstruct
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@attr.s(auto_attribs=True)
|
|
7
|
+
class Details:
|
|
8
|
+
longitude: typing.Optional[float] = None
|
|
9
|
+
latitude: typing.Optional[float] = None
|
|
10
|
+
time_zone: typing.Optional[str] = None
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@attr.s(auto_attribs=True)
|
|
14
|
+
class Error:
|
|
15
|
+
suggestion: typing.Optional[str] = None
|
|
16
|
+
code: typing.Optional[str] = None
|
|
17
|
+
field: typing.Optional[str] = None
|
|
18
|
+
message: typing.Optional[str] = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@attr.s(auto_attribs=True)
|
|
22
|
+
class Delivery:
|
|
23
|
+
success: typing.Optional[bool] = None
|
|
24
|
+
errors: typing.Optional[typing.List[Error]] = jstruct.JList[Error]
|
|
25
|
+
details: typing.Optional[Details] = jstruct.JStruct[Details]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@attr.s(auto_attribs=True)
|
|
29
|
+
class Verifications:
|
|
30
|
+
delivery: typing.Optional[Delivery] = jstruct.JStruct[Delivery]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@attr.s(auto_attribs=True)
|
|
34
|
+
class Address:
|
|
35
|
+
id: typing.Optional[str] = None
|
|
36
|
+
object: typing.Optional[str] = None
|
|
37
|
+
created_at: typing.Optional[str] = None
|
|
38
|
+
updated_at: typing.Optional[str] = None
|
|
39
|
+
name: typing.Optional[str] = None
|
|
40
|
+
company: typing.Optional[str] = None
|
|
41
|
+
street1: typing.Optional[str] = None
|
|
42
|
+
street2: typing.Optional[str] = None
|
|
43
|
+
city: typing.Optional[str] = None
|
|
44
|
+
state: typing.Optional[str] = None
|
|
45
|
+
zip: typing.Optional[int] = None
|
|
46
|
+
country: typing.Optional[str] = None
|
|
47
|
+
phone: typing.Optional[str] = None
|
|
48
|
+
email: typing.Optional[str] = None
|
|
49
|
+
mode: typing.Optional[str] = None
|
|
50
|
+
carrier_facility: typing.Optional[str] = None
|
|
51
|
+
residential: typing.Optional[bool] = None
|
|
52
|
+
federal_tax_id: typing.Optional[str] = None
|
|
53
|
+
state_tax_id: typing.Optional[str] = None
|
|
54
|
+
verifications: typing.Optional[Verifications] = jstruct.JStruct[Verifications]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@attr.s(auto_attribs=True)
|
|
58
|
+
class CustomsItem:
|
|
59
|
+
id: typing.Optional[str] = None
|
|
60
|
+
object: typing.Optional[str] = None
|
|
61
|
+
created_at: typing.Optional[str] = None
|
|
62
|
+
updated_at: typing.Optional[str] = None
|
|
63
|
+
description: typing.Optional[str] = None
|
|
64
|
+
hs_tariff_number: typing.Optional[int] = None
|
|
65
|
+
origin_country: typing.Optional[str] = None
|
|
66
|
+
quantity: typing.Optional[int] = None
|
|
67
|
+
value: typing.Optional[float] = None
|
|
68
|
+
weight: typing.Optional[float] = None
|
|
69
|
+
code: typing.Optional[str] = None
|
|
70
|
+
mode: typing.Optional[str] = None
|
|
71
|
+
manufacturer: typing.Optional[str] = None
|
|
72
|
+
currency: typing.Optional[str] = None
|
|
73
|
+
eccn: typing.Optional[str] = None
|
|
74
|
+
printed_commodity_identifier: typing.Optional[str] = None
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@attr.s(auto_attribs=True)
|
|
78
|
+
class CustomsInfo:
|
|
79
|
+
id: typing.Optional[str] = None
|
|
80
|
+
object: typing.Optional[str] = None
|
|
81
|
+
created_at: typing.Optional[str] = None
|
|
82
|
+
updated_at: typing.Optional[str] = None
|
|
83
|
+
contents_explanation: typing.Optional[str] = None
|
|
84
|
+
contents_type: typing.Optional[str] = None
|
|
85
|
+
customs_certify: typing.Optional[bool] = None
|
|
86
|
+
customs_signer: typing.Optional[str] = None
|
|
87
|
+
eel_pfc: typing.Optional[str] = None
|
|
88
|
+
non_delivery_option: typing.Optional[str] = None
|
|
89
|
+
restriction_comments: typing.Optional[str] = None
|
|
90
|
+
restriction_type: typing.Optional[str] = None
|
|
91
|
+
mode: typing.Optional[str] = None
|
|
92
|
+
declaration: typing.Optional[str] = None
|
|
93
|
+
customs_items: typing.Optional[typing.List[CustomsItem]] = jstruct.JList[CustomsItem]
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@attr.s(auto_attribs=True)
|
|
97
|
+
class Fee:
|
|
98
|
+
amount: typing.Optional[str] = None
|
|
99
|
+
charged: typing.Optional[bool] = None
|
|
100
|
+
object: typing.Optional[str] = None
|
|
101
|
+
refunded: typing.Optional[bool] = None
|
|
102
|
+
type: typing.Optional[str] = None
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@attr.s(auto_attribs=True)
|
|
106
|
+
class Form:
|
|
107
|
+
object: typing.Optional[str] = None
|
|
108
|
+
id: typing.Optional[str] = None
|
|
109
|
+
created_at: typing.Optional[str] = None
|
|
110
|
+
updated_at: typing.Optional[str] = None
|
|
111
|
+
mode: typing.Optional[str] = None
|
|
112
|
+
form_type: typing.Optional[str] = None
|
|
113
|
+
form_url: typing.Optional[str] = None
|
|
114
|
+
submitted_electronically: typing.Optional[bool] = None
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@attr.s(auto_attribs=True)
|
|
118
|
+
class Parcel:
|
|
119
|
+
id: typing.Optional[str] = None
|
|
120
|
+
object: typing.Optional[str] = None
|
|
121
|
+
length: typing.Optional[float] = None
|
|
122
|
+
width: typing.Optional[float] = None
|
|
123
|
+
height: typing.Optional[float] = None
|
|
124
|
+
predefined_package: typing.Optional[str] = None
|
|
125
|
+
weight: typing.Optional[float] = None
|
|
126
|
+
created_at: typing.Optional[str] = None
|
|
127
|
+
updated_at: typing.Optional[str] = None
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
@attr.s(auto_attribs=True)
|
|
131
|
+
class PostageLabel:
|
|
132
|
+
created_at: typing.Optional[str] = None
|
|
133
|
+
id: typing.Optional[str] = None
|
|
134
|
+
integrated_form: typing.Optional[str] = None
|
|
135
|
+
label_date: typing.Optional[str] = None
|
|
136
|
+
label_epl2_url: typing.Optional[str] = None
|
|
137
|
+
label_file_type: typing.Optional[str] = None
|
|
138
|
+
label_pdf_url: typing.Optional[str] = None
|
|
139
|
+
label_resolution: typing.Optional[int] = None
|
|
140
|
+
label_size: typing.Optional[str] = None
|
|
141
|
+
label_type: typing.Optional[str] = None
|
|
142
|
+
label_url: typing.Optional[str] = None
|
|
143
|
+
label_zpl_url: typing.Optional[str] = None
|
|
144
|
+
object: typing.Optional[str] = None
|
|
145
|
+
updated_at: typing.Optional[str] = None
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
@attr.s(auto_attribs=True)
|
|
149
|
+
class Rate:
|
|
150
|
+
id: typing.Optional[str] = None
|
|
151
|
+
object: typing.Optional[str] = None
|
|
152
|
+
carrier_account_id: typing.Optional[str] = None
|
|
153
|
+
currency: typing.Optional[str] = None
|
|
154
|
+
service: typing.Optional[str] = None
|
|
155
|
+
rate: typing.Optional[str] = None
|
|
156
|
+
carrier: typing.Optional[str] = None
|
|
157
|
+
shipment_id: typing.Optional[str] = None
|
|
158
|
+
delivery_days: typing.Optional[int] = None
|
|
159
|
+
delivery_date: typing.Optional[str] = None
|
|
160
|
+
delivery_date_guaranteed: typing.Optional[bool] = None
|
|
161
|
+
created_at: typing.Optional[str] = None
|
|
162
|
+
updated_at: typing.Optional[str] = None
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
@attr.s(auto_attribs=True)
|
|
166
|
+
class SelectedRate:
|
|
167
|
+
carrier: typing.Optional[str] = None
|
|
168
|
+
created_at: typing.Optional[str] = None
|
|
169
|
+
currency: typing.Optional[str] = None
|
|
170
|
+
id: typing.Optional[str] = None
|
|
171
|
+
object: typing.Optional[str] = None
|
|
172
|
+
rate: typing.Optional[str] = None
|
|
173
|
+
service: typing.Optional[str] = None
|
|
174
|
+
shipment_id: typing.Optional[str] = None
|
|
175
|
+
updated_at: typing.Optional[str] = None
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
@attr.s(auto_attribs=True)
|
|
179
|
+
class TrackingLocation:
|
|
180
|
+
object: typing.Optional[str] = None
|
|
181
|
+
city: typing.Optional[str] = None
|
|
182
|
+
state: typing.Optional[str] = None
|
|
183
|
+
country: typing.Optional[str] = None
|
|
184
|
+
zip: typing.Optional[int] = None
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
@attr.s(auto_attribs=True)
|
|
188
|
+
class TrackingDetail:
|
|
189
|
+
object: typing.Optional[str] = None
|
|
190
|
+
message: typing.Optional[str] = None
|
|
191
|
+
status: typing.Optional[str] = None
|
|
192
|
+
tracking_detail_datetime: typing.Optional[str] = None
|
|
193
|
+
source: typing.Optional[str] = None
|
|
194
|
+
tracking_location: typing.Optional[TrackingLocation] = jstruct.JStruct[TrackingLocation]
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
@attr.s(auto_attribs=True)
|
|
198
|
+
class Tracker:
|
|
199
|
+
created_at: typing.Optional[str] = None
|
|
200
|
+
id: typing.Optional[str] = None
|
|
201
|
+
mode: typing.Optional[str] = None
|
|
202
|
+
object: typing.Optional[str] = None
|
|
203
|
+
shipment_id: typing.Optional[str] = None
|
|
204
|
+
status: typing.Optional[str] = None
|
|
205
|
+
tracking_code: typing.Optional[str] = None
|
|
206
|
+
tracking_details: typing.Optional[typing.List[TrackingDetail]] = jstruct.JList[TrackingDetail]
|
|
207
|
+
updated_at: typing.Optional[str] = None
|
|
208
|
+
public_url: typing.Optional[str] = None
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
@attr.s(auto_attribs=True)
|
|
212
|
+
class Shipment:
|
|
213
|
+
id: typing.Optional[str] = None
|
|
214
|
+
object: typing.Optional[str] = None
|
|
215
|
+
mode: typing.Optional[str] = None
|
|
216
|
+
is_return: typing.Optional[bool] = None
|
|
217
|
+
batch_id: typing.Optional[str] = None
|
|
218
|
+
batch_message: typing.Optional[str] = None
|
|
219
|
+
batch_status: typing.Optional[str] = None
|
|
220
|
+
to_address: typing.Optional[Address] = jstruct.JStruct[Address]
|
|
221
|
+
from_address: typing.Optional[Address] = jstruct.JStruct[Address]
|
|
222
|
+
return_address: typing.Optional[Address] = jstruct.JStruct[Address]
|
|
223
|
+
buyer_address: typing.Optional[Address] = jstruct.JStruct[Address]
|
|
224
|
+
parcel: typing.Optional[Parcel] = jstruct.JStruct[Parcel]
|
|
225
|
+
customs_info: typing.Optional[CustomsInfo] = jstruct.JStruct[CustomsInfo]
|
|
226
|
+
fees: typing.Optional[typing.List[Fee]] = jstruct.JList[Fee]
|
|
227
|
+
forms: typing.Optional[typing.List[Form]] = jstruct.JList[Form]
|
|
228
|
+
options: typing.Any = None
|
|
229
|
+
rates: typing.Optional[typing.List[Rate]] = jstruct.JList[Rate]
|
|
230
|
+
reference: typing.Optional[str] = None
|
|
231
|
+
scan_form: typing.Optional[str] = None
|
|
232
|
+
refund_status: typing.Optional[str] = None
|
|
233
|
+
selected_rate: typing.Optional[SelectedRate] = jstruct.JStruct[SelectedRate]
|
|
234
|
+
status: typing.Optional[str] = None
|
|
235
|
+
postage_label: typing.Optional[PostageLabel] = jstruct.JStruct[PostageLabel]
|
|
236
|
+
tracking_code: typing.Optional[str] = None
|
|
237
|
+
usps_zone: typing.Optional[int] = None
|
|
238
|
+
tracker: typing.Optional[Tracker] = jstruct.JStruct[Tracker]
|
|
239
|
+
messages: typing.Optional[typing.List[typing.Any]] = None
|
|
240
|
+
insurance: typing.Optional[float] = None
|
|
241
|
+
created_at: typing.Optional[str] = None
|
|
242
|
+
updated_at: typing.Optional[str] = None
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
@attr.s(auto_attribs=True)
|
|
246
|
+
class ShipmentsResponse:
|
|
247
|
+
has_more: typing.Optional[bool] = None
|
|
248
|
+
shipments: typing.Optional[typing.List[Shipment]] = jstruct.JList[Shipment]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import attr
|
|
2
|
+
import jstruct
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@attr.s(auto_attribs=True)
|
|
7
|
+
class TrackingLocation:
|
|
8
|
+
object: typing.Optional[str] = None
|
|
9
|
+
city: typing.Optional[str] = None
|
|
10
|
+
state: typing.Optional[str] = None
|
|
11
|
+
country: typing.Optional[str] = None
|
|
12
|
+
zip: typing.Optional[str] = None
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@attr.s(auto_attribs=True)
|
|
16
|
+
class CarrierDetail:
|
|
17
|
+
object: typing.Optional[str] = None
|
|
18
|
+
service: typing.Optional[str] = None
|
|
19
|
+
container_type: typing.Optional[str] = None
|
|
20
|
+
est_delivery_date_local: typing.Optional[str] = None
|
|
21
|
+
est_delivery_time_local: typing.Optional[str] = None
|
|
22
|
+
origin_location: typing.Optional[str] = None
|
|
23
|
+
origin_tracking_location: typing.Optional[TrackingLocation] = jstruct.JStruct[TrackingLocation]
|
|
24
|
+
destination_location: typing.Optional[str] = None
|
|
25
|
+
destination_tracking_location: typing.Optional[str] = None
|
|
26
|
+
guaranteed_delivery_date: typing.Optional[str] = None
|
|
27
|
+
alternate_identifier: typing.Optional[str] = None
|
|
28
|
+
initial_delivery_attempt: typing.Optional[str] = None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@attr.s(auto_attribs=True)
|
|
32
|
+
class Fee:
|
|
33
|
+
object: typing.Optional[str] = None
|
|
34
|
+
type: typing.Optional[str] = None
|
|
35
|
+
amount: typing.Optional[str] = None
|
|
36
|
+
charged: typing.Optional[bool] = None
|
|
37
|
+
refunded: typing.Optional[bool] = None
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@attr.s(auto_attribs=True)
|
|
41
|
+
class TrackingDetail:
|
|
42
|
+
object: typing.Optional[str] = None
|
|
43
|
+
message: typing.Optional[str] = None
|
|
44
|
+
description: typing.Optional[str] = None
|
|
45
|
+
status: typing.Optional[str] = None
|
|
46
|
+
status_detail: typing.Optional[str] = None
|
|
47
|
+
tracking_detail_datetime: typing.Optional[str] = None
|
|
48
|
+
source: typing.Optional[str] = None
|
|
49
|
+
carrier_code: typing.Optional[str] = None
|
|
50
|
+
tracking_location: typing.Optional[TrackingLocation] = jstruct.JStruct[TrackingLocation]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@attr.s(auto_attribs=True)
|
|
54
|
+
class Tracker:
|
|
55
|
+
id: typing.Optional[str] = None
|
|
56
|
+
object: typing.Optional[str] = None
|
|
57
|
+
mode: typing.Optional[str] = None
|
|
58
|
+
tracking_code: typing.Optional[str] = None
|
|
59
|
+
status: typing.Optional[str] = None
|
|
60
|
+
status_detail: typing.Optional[str] = None
|
|
61
|
+
created_at: typing.Optional[str] = None
|
|
62
|
+
updated_at: typing.Optional[str] = None
|
|
63
|
+
signed_by: typing.Optional[str] = None
|
|
64
|
+
weight: typing.Optional[str] = None
|
|
65
|
+
est_delivery_date: typing.Optional[str] = None
|
|
66
|
+
shipment_id: typing.Optional[str] = None
|
|
67
|
+
carrier: typing.Optional[str] = None
|
|
68
|
+
tracking_details: typing.Optional[typing.List[TrackingDetail]] = jstruct.JList[TrackingDetail]
|
|
69
|
+
carrier_detail: typing.Optional[CarrierDetail] = jstruct.JStruct[CarrierDetail]
|
|
70
|
+
finalized: typing.Optional[bool] = None
|
|
71
|
+
is_return: typing.Optional[bool] = None
|
|
72
|
+
public_url: typing.Optional[str] = None
|
|
73
|
+
fees: typing.Optional[typing.List[Fee]] = jstruct.JList[Fee]
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@attr.s(auto_attribs=True)
|
|
77
|
+
class TrackersResponse:
|
|
78
|
+
trackers: typing.Optional[typing.List[Tracker]] = jstruct.JList[Tracker]
|
|
79
|
+
has_more: typing.Optional[bool] = None
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: karrio_easypost
|
|
3
|
+
Version: 2025.5
|
|
4
|
+
Summary: Karrio - EasyPost Shipping extension
|
|
5
|
+
Author-email: karrio <hello@karrio.io>
|
|
6
|
+
License-Expression: LGPL-3.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/karrioapi/karrio
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Requires-Python: >=3.7
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: karrio
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# karrio.easypost
|
|
18
|
+
|
|
19
|
+
This package is a easypost extension of the [karrio](https://pypi.org/project/karrio) multi carrier shipping SDK.
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
22
|
+
|
|
23
|
+
`Python 3.7+`
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install karrio.easypost
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
import karrio.sdk as karrio
|
|
35
|
+
from karrio.mappers.easypost.settings import Settings
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# Initialize a carrier gateway
|
|
39
|
+
easypost = karrio.gateway["easypost"].create(
|
|
40
|
+
Settings(
|
|
41
|
+
...
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Check the [karrio Mutli-carrier SDK docs](https://docs.karrio.io) for Shipping API requests
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
karrio/mappers/easypost/__init__.py,sha256=Z1hMDSA21PYGRE8sDcOFzffKeR3_PUprlQL_oWaNOUY,151
|
|
2
|
+
karrio/mappers/easypost/mapper.py,sha256=1p2kff10Za5-QlFR4Gz6Kcnnwi2HSmr3DEke6CMkR7k,2108
|
|
3
|
+
karrio/mappers/easypost/proxy.py,sha256=NhFQbDOlSausNDxzNbPfbV1mdXk5T2qcPimNXsfFWus,3425
|
|
4
|
+
karrio/mappers/easypost/settings.py,sha256=tVxN6QXlpYgjslfMRzc-6uvI1E-vp6H6f_NsDpF65AA,406
|
|
5
|
+
karrio/plugins/easypost/__init__.py,sha256=UwD6JC4LkF47ZodzuHvaq8l__713e_aCLTej3SkEhH4,484
|
|
6
|
+
karrio/providers/easypost/__init__.py,sha256=v89eaMBV-Kn7Za7WzrXpSkKfFG2HSRB0SXByoI2hOec,333
|
|
7
|
+
karrio/providers/easypost/error.py,sha256=GrONkEpEi8ujKNvd4I9Z9xGfqFrc4QE2wOkoMJOFEjk,953
|
|
8
|
+
karrio/providers/easypost/rate.py,sha256=_uJ_9PgB5AM_oMDjAsY_wFd_DUz-zm_zu4qPkSyZHTY,7710
|
|
9
|
+
karrio/providers/easypost/tracking.py,sha256=hWjYA7rKBQgqLcXB2X1gOjRLLrBXk-VateE5UpjbFWg,4245
|
|
10
|
+
karrio/providers/easypost/units.py,sha256=Cw_yhRnBDWejKmQ3qWxq3Jo-RcLYw7kAbsZHRuOkt30,52724
|
|
11
|
+
karrio/providers/easypost/utils.py,sha256=rJ1uxvaOXcwCAbPmiklk0UoJwhbix0sjVc6jV1BWbtQ,774
|
|
12
|
+
karrio/providers/easypost/shipment/__init__.py,sha256=oEO3ToyRIVyE5mcc_exdZRpM6WMu6PMD2UpdkUJrKqI,232
|
|
13
|
+
karrio/providers/easypost/shipment/cancel.py,sha256=QEIkm4aPwzOyFMV4fvx_7b8VErwIhcBGl9ZszQM5nsM,1010
|
|
14
|
+
karrio/providers/easypost/shipment/create.py,sha256=9_gcDFfQwx_LIUsYhk2-1Om_VOGh4ZiHbll5D66-p8k,9338
|
|
15
|
+
karrio/schemas/easypost/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
karrio/schemas/easypost/error_response.py,sha256=LavBjNFcliCXjGYaPFtWKhMLL7wNSWmhzlsh_quWVN8,331
|
|
17
|
+
karrio/schemas/easypost/shipment_purchase.py,sha256=xNQWUKV6aYFFdTn7xLCjjtya0h-oZDyLdvqr8B7ifNk,272
|
|
18
|
+
karrio/schemas/easypost/shipment_request.py,sha256=7HirvgDktcppvHlEeMz49ryK6sPWIBP-c1_1xE3y8ow,2858
|
|
19
|
+
karrio/schemas/easypost/shipments_response.py,sha256=KgWbIoPvI1NoQOGoV30-K3Dl6JFkKdAS3B3yHQfb6R4,8957
|
|
20
|
+
karrio/schemas/easypost/trackers_response.py,sha256=Q0Z74hKZYLDmfKh7lzxM7cfe3x-z-LXve94d7s3r9Kw,2915
|
|
21
|
+
karrio_easypost-2025.5.dist-info/licenses/LICENSE,sha256=qvVLDB3Y1leH0p_1m30RxZrOGOx8F9O5eZIwdyVzcuQ,7651
|
|
22
|
+
karrio_easypost-2025.5.dist-info/METADATA,sha256=E-sOLF9RYBxo9_aBXu1kt8GYhOi3O6lbjrPJj0s9kyQ,1038
|
|
23
|
+
karrio_easypost-2025.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
+
karrio_easypost-2025.5.dist-info/entry_points.txt,sha256=mArG7sxxZUl07ycYJn7BGzz1uv-hZPVROniK64EbUz4,61
|
|
25
|
+
karrio_easypost-2025.5.dist-info/top_level.txt,sha256=FZCY8Nwft8oEGHdl--xku8P3TrnOxu5dETEU_fWpRSM,20
|
|
26
|
+
karrio_easypost-2025.5.dist-info/RECORD,,
|