parcelbright package¶
Module contents¶
-
class
parcelbright.Address(raw_data=None, deserialize_mapping=None, strict=True)[source]¶ Bases:
schematics.models.Model-
company= <schematics.types.base.StringType object>¶
-
country_code= <schematics.types.base.StringType object>¶
-
line1= <schematics.types.base.StringType object>¶
-
line2= <schematics.types.base.StringType object>¶
-
name= <schematics.types.base.StringType object>¶
-
phone= <schematics.types.base.StringType object>¶
-
postcode= <schematics.types.base.StringType object>¶
-
town= <schematics.types.base.StringType object>¶
-
-
exception
parcelbright.BadRequest(message, response=None)[source]¶ Bases:
parcelbright.ParcelBrightAPIExceptionRaised when server response is 400
-
class
parcelbright.Client(api_key, sandbox=False, **kwargs)[source]¶ Bases:
objectClient to send configurated requests
-
class
parcelbright.DateTimeType(formats=None, serialized_format=None, **kwargs)[source]¶ Bases:
schematics.types.base.DateTimeType-
MESSAGES= {'parse': u'Could not parse {0}. Should be ISO8601.', 'required': u'This field is required.', 'parse_formats': u'Could not parse {0}. Valid formats: {1}', 'choices': u'Value must be one of {0}.'}¶
-
-
exception
parcelbright.NotFound(message, response=None)[source]¶ Bases:
parcelbright.ParcelBrightAPIExceptionRaised when server response is 404
-
class
parcelbright.Parcel(raw_data=None, deserialize_mapping=None, strict=True)[source]¶ Bases:
schematics.models.ModelParcel container
-
height= <schematics.types.base.DecimalType object>¶
-
length= <schematics.types.base.DecimalType object>¶
-
weight= <schematics.types.base.DecimalType object>¶
-
width= <schematics.types.base.DecimalType object>¶
-
-
exception
parcelbright.ParcelBrightAPIException(message, response=None)[source]¶ Bases:
parcelbright.ParcelBrightExceptionParcelBright errors Base
- Args:
- message: error message response: requests.response instance
-
class
parcelbright.Shipment(raw_data=None, deserialize_mapping=None, strict=True)[source]¶ Bases:
schematics.models.Model-
consignment= <schematics.types.base.StringType object>¶
-
contents= <schematics.types.base.StringType object>¶
-
customer_reference= <schematics.types.base.StringType object>¶
-
customs= <schematics.types.base.StringType object>¶
-
customs_url= <schematics.types.base.URLType object>¶
-
estimated_value= <schematics.types.base.DecimalType object>¶
-
from_address= <schematics.types.compound.ModelType object at 0x7fc64536f210 for <class 'parcelbright.Address'>>¶
-
id= <schematics.types.base.StringType object>¶
-
label_url= <schematics.types.base.URLType object>¶
-
liability_amount= <schematics.types.base.DecimalType object>¶
-
parcel= <schematics.types.compound.ModelType object at 0x7fc64536f090 for <class 'parcelbright.Parcel'>>¶
-
pickup_confirmation= <schematics.types.base.StringType object>¶
-
pickup_date= <schematics.types.base.DateType object>¶
-
rates= <schematics.types.compound.ListType object>¶
-
service= <schematics.types.compound.ModelType object at 0x7fc64536f510 for <class 'parcelbright.ShipmentService'>>¶
-
state= <schematics.types.base.StringType object>¶
-
to_address= <schematics.types.compound.ModelType object at 0x7fc64536f150 for <class 'parcelbright.Address'>>¶
-
-
exception
parcelbright.ShipmentNotCompletedException[source]¶ Bases:
parcelbright.ParcelBrightExceptionRaised when Shipment.state is different than completed
-
class
parcelbright.ShipmentRate(raw_data=None, deserialize_mapping=None, strict=True)[source]¶ Bases:
schematics.models.Model-
carrier= <schematics.types.base.StringType object>¶
-
code= <schematics.types.base.StringType object>¶
-
cutoff= <parcelbright.DateTimeType object>¶
-
delivery_estimate= <parcelbright.DateTimeType object>¶
-
name= <schematics.types.base.StringType object>¶
-
pickup_date= <schematics.types.base.DateType object>¶
-
price= <schematics.types.base.DecimalType object>¶
-
service_type= <schematics.types.base.StringType object>¶
-
transit_days= <schematics.types.base.IntType object>¶
-
vat= <schematics.types.base.DecimalType object>¶
-
-
class
parcelbright.ShipmentService(raw_data=None, deserialize_mapping=None, strict=True)[source]¶ Bases:
schematics.models.Model-
carrier= <schematics.types.base.StringType object>¶
-
code= <schematics.types.base.StringType object>¶
-
name= <schematics.types.base.StringType object>¶
-
price= <schematics.types.base.DecimalType object>¶
-
service_type= <schematics.types.base.StringType object>¶
-
vat= <schematics.types.base.DecimalType object>¶
-
-
class
parcelbright.ShipmentTrack(raw_data=None, deserialize_mapping=None, strict=True)[source]¶ Bases:
schematics.models.Model-
description= <schematics.types.base.StringType object>¶
-
detail= <schematics.types.base.StringType object>¶
-
location= <schematics.types.base.StringType object>¶
-
timestamp= <schematics.types.base.DateType object>¶
-
-
exception
parcelbright.TrackingError(message, response=None)[source]¶ Bases:
parcelbright.BadRequestRaised when Shipment.track() responses with 400
-
exception
parcelbright.ValidationError[source]¶ Bases:
parcelbright.ParcelBrightExceptionRaised when parcelbright entity like Address, Parcel or Shipment is invalid
-
parcelbright.api_key= None¶ api_key used to authorize with API
-
parcelbright.base_url= 'https://api.parcelbright.com/'¶ Base url for production version
-
parcelbright.sandbox= False¶ Whether use sandbox API version not
-
parcelbright.sandbox_base_url= 'https://api.sandbox.parcelbright.com/'¶ Base url for sandbox version