From 828b6a1c396f022f24d8e8c4f6871208d6fa8a95 Mon Sep 17 00:00:00 2001 From: Dan Kobina Date: Sat, 6 Apr 2019 14:35:52 -0400 Subject: [PATCH] Release version 2019.4.0 --- README.md | 22 ++++++++++++--------- purplship/domain/mapper.py | 24 +++++++++++------------ purplship/mappers/fedex/fedex_client.py | 2 +- purplship/mappers/sendle/sendle_client.py | 2 +- setup.py | 2 +- 5 files changed, 28 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index a166fb1d08..a0ba220de5 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,24 @@ # PurplShip -[![Build Status](https://travis-ci.org/PurplShip/purplship.svg?branch=master)](https://travis-ci.org/PurplShip/purplship) [![codecov](https://codecov.io/gh/PurplShip/purplship/branch/master/graph/badge.svg)](https://codecov.io/gh/PurplShip/purplship) +[![Build Status](https://travis-ci.org/PurplShip/purplship.svg?branch=master)](https://travis-ci.org/PurplShip/purplship) [![codecov](https://codecov.io/gh/PurplShip/purplship/branch/master/graph/badge.svg)](https://codecov.io/gh/PurplShip/purplship) [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) -Shipping carriers API integrations Library +## Overview + +PurplShip is an open source library that makes shipping carrier API integration +easy. +PurplShip proposes an intuitive unified API, to make multi-carrier integration seamless. - Integrate multiple carriers: DHL, FedEx, UPS, Canada Post and more with ease - Use an intuitive, unified API across multiple carriers -- Use your developer credentials with negotiated rates +- Use your developer credentials and your negotiated rates -PurplSHip prevents you from reinventing the wheel and is easy to use: +PurplShip helps quickly getting started with shipping services as it is easy to use: -```shell +```python import purplship -usps = purplship.gateway['usps'].create({ - "username": "username", +dhl = purplship.gateway['dhl'].create({ + "site_id": "username", "password": "password" }) @@ -23,10 +27,10 @@ response = purplship.rating.fetch({ "recipient": {"city": "Lome", "country_code": "TG"}, "shipment": { "items": [ - {"id": "1", "height": 3, "length": 10, "width": 3, "weight": 4.0} + {"height": 3, "length": 10, "width": 3, "weight": 4.0} ] } -}).from_(usps) +}).from_(dhl) rates = response.parse() ``` diff --git a/purplship/domain/mapper.py b/purplship/domain/mapper.py index 2aea6cf710..21f84ff7ad 100644 --- a/purplship/domain/mapper.py +++ b/purplship/domain/mapper.py @@ -13,59 +13,59 @@ class Mapper(ABC): Attributes ---------- client : Client - a carrier client (holding connection settings) + a carrier client (holding connection settings) """ def create_quote_request(self, payload: T.RateRequest): - """ Create a carrier specific quote request xml data from payload """ + """ Create a carrier specific quote request data from payload """ raise Exception("Not Supported") def parse_quote_response( self, response ) -> Tuple[List[T.QuoteDetails], List[T.Error]]: - """ Create a united API quote result list from carrier xml response """ + """ Create a united API quote result list from carrier response """ raise Exception("Not Supported") def create_tracking_request(self, payload: T.TrackingRequest): - """ Create a carrier specific tracking request xml data from payload """ + """ Create a carrier specific tracking request data from payload """ raise Exception("Not Supported") def parse_tracking_response( self, response ) -> Tuple[List[T.TrackingDetails], List[T.Error]]: - """ Create a united API tracking result list from carrier xml response """ + """ Create a united API tracking result list from carrier response """ raise Exception("Not Supported") def create_shipment_request(self, payload: T.ShipmentRequest): - """ Create a carrier specific shipment creation request xml data from payload """ + """ Create a carrier specific shipment creation request data from payload """ raise Exception("Not Supported") def parse_shipment_response( self, response ) -> Tuple[T.ShipmentDetails, List[T.Error]]: - """ Create a united API shipment creation result from carrier xml response """ + """ Create a united API shipment creation result from carrier response """ raise Exception("Not Supported") def create_pickup_request(self, payload: T.PickupRequest): """ Create a carrier specific pickup request xml data from payload """ raise Exception("Not Supported") - def modify_PickupRequest(self, payload: T.PickupRequest): - """ Create a carrier specific pickup modification request xml data from payload """ + def modify_pickup_request(self, payload: T.PickupRequest): + """ Create a carrier specific pickup modification request data from payload """ raise Exception("Not Supported") def parse_pickup_response(self, response) -> Tuple[T.PickupDetails, List[T.Error]]: - """ Create a united API pickup result from carrier xml response """ + """ Create a united API pickup result from carrier response """ raise Exception("Not Supported") def create_pickup_cancellation_request( self, payload: T.PickupCancellationRequest ): - """ Create a carrier specific pickup cancellation request xml data from payload """ + """ Create a carrier specific pickup cancellation request data from payload """ raise Exception("Not Supported") def parse_pickup_cancellation_response( self, response ) -> Tuple[dict, List[T.Error]]: - """ Create a united API pickup cancellation result from carrier xml response """ + """ Create a united API pickup cancellation result from carrier response """ raise Exception("Not Supported") diff --git a/purplship/mappers/fedex/fedex_client.py b/purplship/mappers/fedex/fedex_client.py index 13339f5694..f2e2c56433 100644 --- a/purplship/mappers/fedex/fedex_client.py +++ b/purplship/mappers/fedex/fedex_client.py @@ -12,5 +12,5 @@ class FedexClient(Client): password: str meter_number: str account_number: str - carrier_name: str = "Fedex" + carrier_name: str = "FedEx" server_url: str = "https://ws.fedex.com:443/web-services" diff --git a/purplship/mappers/sendle/sendle_client.py b/purplship/mappers/sendle/sendle_client.py index ffbda4c212..84cd1ec04e 100644 --- a/purplship/mappers/sendle/sendle_client.py +++ b/purplship/mappers/sendle/sendle_client.py @@ -11,4 +11,4 @@ class SendleClient(Client): sendle_id: str api_key: str carrier_name: str = "Sendle" - server_url: str = "https://api.sendle.com/api" + server_url: str = "https://api.sendle.com" diff --git a/setup.py b/setup.py index 0175d9369e..db2f215f73 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ long_description = fh.read() setup(name='purplship', - version='1.0.2', + version='2019.4.0', description='Multi-carrier shipping API integration with python', long_description=long_description, long_description_content_type="text/markdown",