Skip to content

Commit

Permalink
Merge pull request #101 from PurplShip/purplship-sdk-2021.3
Browse files Browse the repository at this point in the history
[release] Purplship SDK 2021.3
  • Loading branch information
danh91 authored Apr 18, 2021
2 parents a3d3129 + 4bd2702 commit ed57739
Show file tree
Hide file tree
Showing 143 changed files with 4,754 additions and 2,017 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ShipmentDetails,
ChargeDetails,
)
from purplship.providers.carrier.utils import Settings, reformat_time
from purplship.providers.carrier.utils import Settings
from purplship.providers.carrier.error import parse_error_response


Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<p align="center">
<a href="https://purplship.com" target="_blank">
<img src="https://github.com/PurplShip/purplship-server/raw/main/src/purpleserver/purpleserver/static/purpleserver/img/icon.png" alt="Purplship" height="100">
<img src="https://github.com/PurplShip/purplship-server/raw/main/src/purpleserver/purpleserver/static/extra/branding/icon.png" alt="Purplship" height="100">
</a>
</p>
<h2 align="center">
Expand Down Expand Up @@ -31,7 +31,7 @@ The key features are:

## Requirements

Python 3.6+
Python 3.7+

## Installation

Expand All @@ -55,12 +55,12 @@ Additional extensions:
- `purplship.dhl-express`
- `purplship.dhl-universal`
- `purplship.dicom`
- `purplship.fedex-express`
- `purplship.fedex`
- `purplship.purolator-courier`
- `purplship.royalmail`
- `purplship.sendle`
- `purplship.sf-express`
- `purplship.ups-package`
- `purplship.ups`
- `purplship.usps`
- `purplship.yanwen`
- `purplship.yunexpress`
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The key features are:

## Requirements

Python 3.6+
Python 3.7+

## Installation

Expand All @@ -49,12 +49,12 @@ pip install purplship.canadapost
- `purplship.dhl-express`
- `purplship.dhl-universal`
- `purplship.dicom`
- `purplship.fedex-express`
- `purplship.fedex`
- `purplship.purolator-courier`
- `purplship.royalmail`
- `purplship.sendle`
- `purplship.sf-express`
- `purplship.ups-package`
- `purplship.ups`
- `purplship.usps`
- `purplship.yanwen`
- `purplship.yunexpress`
Expand Down
20 changes: 10 additions & 10 deletions docs/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
| `carrier_id` | `str` |


#### UPS Package Settings
#### UPS Settings

| Name | Type | Description
| --- | --- | --- |
Expand All @@ -66,7 +66,7 @@
| `carrier_id` | `str` |


#### FedEx Express Settings
#### FedEx Settings

| Name | Type | Description
| --- | --- | --- |
Expand Down Expand Up @@ -446,7 +446,7 @@ All models can be imported at `from purplship.core.models import [ModelName]`
| `your_packaging` | Your Packaging


#### UPS Package
#### UPS

| Code | Identifier
--- | ---
Expand Down Expand Up @@ -474,7 +474,7 @@ All models can be imported at `from purplship.core.models import [ModelName]`
| `purolator_customer_packaging` | Customer Packaging


#### FedEx Express
#### FedEx

| Code | Identifier
--- | ---
Expand Down Expand Up @@ -504,7 +504,7 @@ All models can be imported at `from purplship.core.models import [ModelName]`
## Package Presets


#### UPS Package
#### UPS

| Code | Dimensions | Note
--- | --- | ---
Expand All @@ -525,7 +525,7 @@ All models can be imported at `from purplship.core.models import [ModelName]`
| `purolator_express_box` | 3.5 x 7.0 | length x weight


#### FedEx Express
#### FedEx
| Code | Dimensions | Note
--- | --- | ---
| `fedex_envelope_legal_size` | 15.5 x 1.0 x 9.5 | height x weight x width
Expand Down Expand Up @@ -582,7 +582,7 @@ All models can be imported at `from purplship.core.models import [ModelName]`
## Shipping Services


#### UPS Package
#### UPS

| Code | Identifier
--- | ---
Expand Down Expand Up @@ -678,7 +678,7 @@ All models can be imported at `from purplship.core.models import [ModelName]`
| `purolator_express_international_box_12_00` | PurolatorExpressInternationalBox12:00


#### FedEx Express
#### FedEx

| Code | Identifier
--- | ---
Expand Down Expand Up @@ -1076,7 +1076,7 @@ All models can be imported at `from purplship.core.models import [ModelName]`
| `dhl_e_com_discount` | ZE | `bool`


#### FedEx Express
#### FedEx

| Code | Identifier | Description
| --- | --- | ---
Expand Down Expand Up @@ -1177,7 +1177,7 @@ All models can be imported at `from purplship.core.models import [ModelName]`
| `purolator_show_alternative_services` | Show Alternate Services | `bool`


#### UPS Package
#### UPS

| Code | Identifier | Description
| --- | --- | ---
Expand Down
2 changes: 1 addition & 1 deletion extensions/aramex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package is a Aramex extension of the [purplship](https://pypi.org/project/p

## Requirements

`Python 3.6+`
`Python 3.7+`

## Installation

Expand Down
2 changes: 1 addition & 1 deletion extensions/aramex/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "purplship.aramex"
version = "2021.2"
version = "2021.3"
homepage="https://sdk.purplship.com"
repository="https://github.com/PurplShip/purplship"
description = "Purplship - Aramex Shipping Extension"
Expand Down
2 changes: 1 addition & 1 deletion extensions/australiapost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package is a Australia Post extension of the [purplship](https://pypi.org/p

## Requirements

`Python 3.6+`
`Python 3.7+`

## Installation

Expand Down
2 changes: 1 addition & 1 deletion extensions/australiapost/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "purplship.australiapost"
version = "2021.2"
version = "2021.3"
homepage="https://sdk.purplship.com"
repository="https://github.com/PurplShip/purplship"
description = "Purplship - Australia Post Shipping Extension"
Expand Down
2 changes: 1 addition & 1 deletion extensions/boxknight/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package is a BoxKnight extension of the [purplship](https://pypi.org/projec

## Requirements

`Python 3.6+`
`Python 3.7+`

## Installation

Expand Down
2 changes: 1 addition & 1 deletion extensions/boxknight/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "purplship.boxknight"
version = "2021.2"
version = "2021.3"
homepage="https://sdk.purplship.com"
repository="https://github.com/PurplShip/purplship"
description = "Purplship - Boxknight Shipping Extension"
Expand Down
2 changes: 1 addition & 1 deletion extensions/canadapost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package is a Canada Post extension of the [purplship](https://pypi.org/proj

## Requirements

`Python 3.6+`
`Python 3.7+`

## Installation

Expand Down
10 changes: 8 additions & 2 deletions extensions/canadapost/purplship/mappers/canadapost/proxy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import base64
import time
from typing import List
from canadapost_lib.rating import mailing_scenario
from purplship.api.proxy import Proxy as BaseProxy
Expand All @@ -7,7 +8,7 @@
from purplship.core.utils.pipeline import Pipeline, Job
from purplship.core.utils import (
request as http,
exec_parrallel,
exec_async,
XP,
)
from purplship.mappers.canadapost.settings import Settings
Expand All @@ -34,8 +35,13 @@ def get_tracking(self, request: Serializable[List[str]]) -> Deserializable[str]:
"""
get_tracking make parallel request for each pin
"""
_throttle = 0.0

def track(tracking_pin: str) -> str:
nonlocal _throttle
time.sleep(_throttle)
_throttle += 0.025

return http(
url=f"{self.settings.server_url}/vis/track/pin/{tracking_pin}/summary",
headers={
Expand All @@ -46,7 +52,7 @@ def track(tracking_pin: str) -> str:
method="GET",
)

response: List[str] = exec_parrallel(track, request.serialize())
response: List[str] = exec_async(track, request.serialize())

return Deserializable(XP.bundle_xml(xml_strings=response), XP.to_xml)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def rate_request(
for code, option in options if code in OptionCode
]
)
if any(options) else None
if any([c in OptionCode for c, _ in options]) else None
),
parcel_characteristics=parcel_characteristicsType(
weight=package.weight.map(MeasurementOptions).KG,
Expand Down
2 changes: 1 addition & 1 deletion extensions/canadapost/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "purplship.canadapost"
version = "2021.2.1"
version = "2021.3"
homepage="https://sdk.purplship.com"
repository="https://github.com/PurplShip/purplship"
description = "Purplship - Canada Post Shipping Extension"
Expand Down
2 changes: 1 addition & 1 deletion extensions/canpar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package is a Canpar extension of the [purplship](https://pypi.org/project/p

## Requirements

`Python 3.6+`
`Python 3.7+`

## Installation

Expand Down
2 changes: 1 addition & 1 deletion extensions/canpar/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "purplship.canpar"
version = "2021.2"
version = "2021.3"
homepage="https://sdk.purplship.com"
repository="https://github.com/PurplShip/purplship"
description = "Purplship - Canpar Shipping Extension"
Expand Down
2 changes: 1 addition & 1 deletion extensions/dhl_express/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package is a DHL Express extension of the [purplship](https://pypi.org/proj

## Requirements

`Python 3.6+`
`Python 3.7+`

## Installation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time
from base64 import encodebytes
from typing import List, Tuple, Optional, cast
from typing import List, Tuple, Optional
from dhl_express_lib.ship_val_global_req_6_2 import (
ShipmentRequest as DHLShipmentRequest,
Billing,
Expand Down Expand Up @@ -149,7 +149,7 @@ def shipment_request(
AddressLine=SF.concat_str(
payload.shipper.address_line1, payload.shipper.address_line2
),
CompanyName=payload.shipper.company_name or " ",
CompanyName=payload.shipper.company_name or "N/A",
PostalCode=payload.shipper.postal_code,
CountryCode=payload.shipper.country_code,
City=payload.shipper.city,
Expand Down Expand Up @@ -182,7 +182,7 @@ def shipment_request(
Weight=package.weight.LB,
DimWeight=None,
PieceContents=(
package.parcel.content or package.parcel.description
package.parcel.content or package.parcel.description
),
)
for package in packages
Expand Down
2 changes: 1 addition & 1 deletion extensions/dhl_express/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "purplship.dhl_express"
version = "2021.2.1"
version = "2021.3"
homepage="https://sdk.purplship.com"
repository="https://github.com/PurplShip/purplship"
description = "Purplship - DHL Express Shipping Extension"
Expand Down
2 changes: 1 addition & 1 deletion extensions/dhl_universal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package is a DHL Universal Tracking extension of the [purplship](https://py

## Requirements

`Python 3.6+`
`Python 3.7+`

## Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


METADATA = Metadata(
label="DHL Universal Tracking",
label="DHL Universal",

# Integrations
Mapper=Mapper,
Expand Down
2 changes: 1 addition & 1 deletion extensions/dhl_universal/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "purplship.dhl_universal"
version = "2021.2"
version = "2021.3"
homepage="https://sdk.purplship.com"
repository="https://github.com/PurplShip/purplship"
description = "Purplship - DHL Universal Tracking Extension"
Expand Down
2 changes: 1 addition & 1 deletion extensions/dicom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package is a Dicom extension of the [purplship](https://pypi.org/project/pu

## Requirements

`Python 3.6+`
`Python 3.7+`

## Installation

Expand Down
2 changes: 1 addition & 1 deletion extensions/dicom/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "purplship.dicom"
version = "2021.2"
version = "2021.3"
homepage="https://sdk.purplship.com"
repository="https://github.com/PurplShip/purplship"
description = "Purplship - Dicom Shipping Extension"
Expand Down
Loading

0 comments on commit ed57739

Please sign in to comment.