django-ok-17track 
django-17track is an unofficial 17track.com API wrapper for Django.
Installation
Install with pip:
$ pip install django-ok-17track
Update INSTALLED_APPS:
INSTALLED_APPS = [
...
'track17',
...
]
Make migrations
$ python manage.py migrate
Available settings
TRACK17_API_KEY - API key for service.
TRACK17_API_KEY_FUNCTION - Custom function to return API key, if you want to store it outside the Django settings.
TRACK17_COUNTRIES_URL - Url to grab countries. Uses https://www.17track.net/en/apicountry.
TRACK17_CARRIERS_URL - Url to grab carriers. Uses https://www.17track.net/en/apicarrier.
Basic example to use:
How to get all countries and carriers:
python managet.py populate_carriers
How to register tracking number and get it’s info:
from rest_framework import serializers from track17.services import register_track, get_track_info, get_track_info_as_packages from apps.track17.exceptions import DateProcessingError # try to register tracking number at 17track API try: register_track('tracking_number') except DateProcessingError as exc: raise serializers.ValidationError(str(exc)) # try to fetch an actual info about a tracking number try: response: Dict = get_track_info('tracking_number') except DateProcessingError as exc: raise serializers.ValidationError(str(exc)) accepted_packages = response.get('accepted', []) # return packages info as a list of `PackageEntity` (dataclass instance) objects # in a readable way with a represantion of carriers and countries as Django model instances packages = get_track_info_as_packages(accepted)
Or can use 17track adapter directly:
from track17.track17 import Track17Adapter track17 = Track17Adapter() response = track17.register('number1', 'number2') response = track17.get_track_info('number1', 'number2')
Metadata
Release files for django-ok-17track 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-ok-17track-0.0.4.tar.gz | 10.3 kB | Without provenance | Details for django-ok-17track-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_ok_17track-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for django_ok_17track-0.0.4-py3-none-any.whl |
Total release size: 24.0 kB
Release files / django-ok-17track-0.0.4.tar.gz
| Download URL | django-ok-17track-0.0.4.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
557a4b1f3484c57e9f6a7c9d37adf50f12988806fdb49344f940bb2a0b68a8c0
|
|
BLAKE2b-256 checksum How to use checksums |
fc4bbfd6d9fc25aa451a4c2a508f0642f10e9d142561768ea714f2fe3fb91667
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0
|
Release files / django_ok_17track-0.0.4-py3-none-any.whl
| Download URL | django_ok_17track-0.0.4-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60ffe1b018c82b745a3703d849d5ceba4dea4224dcf66efce9370899daa7e369
|
|
BLAKE2b-256 checksum How to use checksums |
af356efd51d29f11f65622268a28d261dfef7e4bb538deb5b4548da13c2e4a2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0
|
Security for django-ok-17track 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.