Skip to main content

Django wrapper around UPS Time In Transit JSON API

Project description

# Django UPS Time In Transit

django-ups-tnt is a wrapper around UPS's Time In Transit (TNT) API.

This wrapper is necessary because UPS's API is not public and requires Authentication details that cannot be shared
in javascript.

It provides some defaults to make the api easier to work with.
It also provides some form validation before hitting the UPS API and cache

# Installation

Requires djangorestframework>=3.3.0. Tested on Django 1.8 and 1.9.

1. Add `django-ups-tnt` to requirements.txt or pip install.
2. Add `url(r'^api/', include('ups_tnt.urls')),` to urls.py
3. Set required settings in settings.py

## Settings

### Required

UPS_USERNAME

UPS_PASSWORD

UPS_ACCESS_LICENSE_NUMBER

### Override defaults

UPS_DEFAULT_SHIP_FROM
UPS_DEFAULT_SHIP_TO

Default shipping addresses

Example syntax:

```
{
"Address": {
"CountryCode": "US",
}
}
```

UPS_BUFFER_DAYS - add buffer to when the item is shipped. Defaults to 0. Set to a int or callable.

UPS_DEFAULT_SHIPMENT_WEIGHT - Set shipment weight. Example

```
UPS_DEFAULT_SHIPMENT_WEIGHT = {
"UnitOfMeasurement": {
"Code": "LBS",
"Description": "Pounds"
},
"Weight": "90"
}
```

UPS_DEFAULT_INVOICE - Set value of shipment

```
UPS_DEFAULT_INVOICE = {
"CurrencyCode": "USD",
"MonetaryValue": "800"
}
```

UPS_TEST_LIVE - Set to `True` to make unit tests access actual API instead of mocks

UPS_CACHE_NAME - Set to the name of the cache to use. Defaults to `default`

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-ups-tnt-1.0.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

django_ups_tnt-1.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file django-ups-tnt-1.0.0.tar.gz.

File metadata

File hashes

Hashes for django-ups-tnt-1.0.0.tar.gz
Algorithm Hash digest
SHA256 be7f39bfd88098a69d15075492dd4d38b416bc79f8273531e3470df71c53e6ef
MD5 09496a7b0d71430c3c5a675b5ec1fa77
BLAKE2b-256 72224419439a6165360217a22bcefae2c59c03b34f5bd0e4164667d19f3a7883

See more details on using hashes here.

Provenance

File details

Details for the file django_ups_tnt-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_ups_tnt-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e9bd25d3a6fda26eb52b73ebcaa8fb8497ef66f057591803e3a034287253008
MD5 c921bc4fe6518226a5f3e899f8c45696
BLAKE2b-256 92cad6790d5310d5fe4c20f5397ce9afc7b0652628eed3c63df6e8ad64ff114d

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page