All Projects â†’ Brobin â†’ usps-api

Brobin / usps-api

Licence: MIT license
Python Wrapper for the USPS API 🚚 📦

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to usps-api

php-tracking-urls
Converts package tracking numbers into URLs (UPS, FedEx, USPS, and more)
Stars: ✭ 47 (-9.62%)
Mutual labels:  shipping, usps
ShippingRates
.NET wrapper to UPS, FedEx, USPS and DHL shipping rates APIs
Stars: ✭ 23 (-55.77%)
Mutual labels:  shipping, usps
m2.TrackingLink
Magento2. Extension add Tracking Url in Shipment Email.
Stars: ✭ 35 (-32.69%)
Mutual labels:  tracking, shipping
Dcfnet pytorch
DCFNet: Discriminant Correlation Filters Network for Visual Tracking
Stars: ✭ 200 (+284.62%)
Mutual labels:  tracking
Object detection tracking
Out-of-the-box code and models for CMU's object detection and tracking system for surveillance videos. Speed optimized Faster-RCNN model. Tensorflow based. Also supports EfficientDet. WACVW'20
Stars: ✭ 221 (+325%)
Mutual labels:  tracking
Xprof
A visual tracer and profiler for Erlang and Elixir.
Stars: ✭ 246 (+373.08%)
Mutual labels:  tracking
pfs
A Particle Filtering over Sets Approach to Multi-Object Tracking
Stars: ✭ 15 (-71.15%)
Mutual labels:  tracking
Thor
thor: C++ helper library, for deep learning purpose
Stars: ✭ 197 (+278.85%)
Mutual labels:  tracking
go-track
URL monitor written in Go that integrates with Slack for notification purposes.
Stars: ✭ 17 (-67.31%)
Mutual labels:  tracking
Motionplanning
Motion planning algorithms commonly used on autonomous vehicles. (path planning + path tracking)
Stars: ✭ 228 (+338.46%)
Mutual labels:  tracking
Supercookie
💭 Inspiration
Stars: ✭ 3,630 (+6880.77%)
Mutual labels:  tracking
Opentracks
OpenTracks is a sport tracking application that completely respects your privacy.
Stars: ✭ 225 (+332.69%)
Mutual labels:  tracking
Nesicide
Integrated Development Environment for the 8-bit Nintendo Entertainment System
Stars: ✭ 244 (+369.23%)
Mutual labels:  tracking
Keen Tracking.js
A light, fast and flexible javascript tracking library
Stars: ✭ 218 (+319.23%)
Mutual labels:  tracking
UberCarAnimation
This app is for animating a car like uber from one position to another with preserving angle and smooth animation
Stars: ✭ 53 (+1.92%)
Mutual labels:  tracking
Siamfc Pytorch
SiamFC PyTorch
Stars: ✭ 197 (+278.85%)
Mutual labels:  tracking
spycss
Track user interactions without JavaScript ✨
Stars: ✭ 40 (-23.08%)
Mutual labels:  tracking
Openats
Open Auto Tracking System for satellite tracking or target tracking.
Stars: ✭ 234 (+350%)
Mutual labels:  tracking
Fracker
PHP function tracker
Stars: ✭ 234 (+350%)
Mutual labels:  tracking
Ros robotics projects
Example codes of new book ROS Robotics Projects
Stars: ✭ 240 (+361.54%)
Mutual labels:  tracking

USPS API

Python 3.5, 3.6, 3.7, 3.8 Code Coverage MIT License


This is a simple Python wrapper for the USPS API. Instead of having to deal with XML, use this library and receive nicely formatted JSON back while tracking shipments, creating shipments, and validating addresses.

Installation

To install usps-api, use pip:

pip install usps-api

Or to install from source:

python setup.py install

Configuration

Note: In order to use any of these APIs, you need to register with USPS and get a USERID https://www.usps.com/business/web-tools-apis/welcome.htm. For the create_shipment endpoint, you will also need to request further permissions by emailing [email protected] about Label API access.

Usage

Track Shipments

from usps import USPSApi

usps = USPSApi('XXXXXXXXXXXX')
track = usps.track('00000000000000000000')
print(track.result)

Create Shipment

The create_shipment function needs a to and from address, weight (in ounces), service type and label type. Service types and lable types can be found in usps/constants.py. Defaults are SERVICE_PRIORITY and LABEL_ZPL.

from usps import USPSApi, Address
from usps import SERVICE_PRIORITY, LABEL_ZPL

to_address = Address(
    name='Tobin Brown',
    address_1='1234 Test Ave.',
    city='Test',
    state='NE',
    zipcode='55555'
)

from_address = Address(
    name='Tobin Brown',
    address_1='1234 Test Ave.',
    city='Test',
    state='NE',
    zipcode='55555'
)
weight = 12  # weight in ounces

usps = USPSApi('XXXXXXXXXXXX', test=True)
label = usps.create_label(to_address, from_address, weight, SERVICE_PRIORITY, LABEL_ZPL)
print(label.result)

Validate Address

from usps import USPSApi, Address

address = Address(
    name='Tobin Brown',
    address_1='1234 Test Ave.',
    city='Test',
    state='NE',
    zipcode='55555'
)
usps = USPSApi('XXXXXXXXXXXX', test=True)
validation = usps.validate_address(address)
print(validation.result)

License

MIT. See LICENSE for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].