Wrapper around the UPS API for creating shipping labels and fetching a package's tracking status.

Overview

ClassicUPS: A Useful UPS Library

ClassicUPS is an Apache2 Licensed wrapper around the UPS API for creating shipping labels and fetching a package's tracking status. This library by no means encompasses all of the UPS functionality, but it is suitable for some of the most common shipping-related common tasks.

Features

  • Track delivery status of tracking number
  • Create prepaid shipping labels in GIF or EPL (thermal printer) format

Installation

Installation is easy:

$ pip install ClassicUPS

ClassicUPS depends on libxml2 and libxslt. On Ubuntu, the packages are libxml2-dev and libxslt-dev.

Quickstart

Create a UPSConnection object, which gives you access to common UPS methods:

from ClassicUPS import UPSConnection

# Credentials obtained from the UPS website
ups = UPSConnection(license_number,
                    user_id,
                    password,
                    shipper_number,  # Optional if you are not creating a shipment
                    debug=True)      # Use the UPS sandbox API rather than prod

Check the delivery date of a package.

tracking = ups.tracking_info('1Z12345E0291980793')
print tracking.in_transit
print tracking.delivered

Create shipment and save shipping label as GIF file:

from_addr = {
    'name': 'Google',
    'address1': '1600 Amphitheatre Parkway',
    'city': 'Mountain View',
    'state': 'CA',
    'country': 'US',
    'postal_code': '94043',
    'phone': '6502530000'
}
to_addr = {
    'name': 'President',
    'address1': '1600 Pennsylvania Ave',
    'city': 'Washington',
    'state': 'DC',
    'country': 'US',
    'postal_code': '20500',
    'phone': '2024561111'
}
dimensions = {  # in inches
    'length': 1,
    'width': 4,
    'height': 9
}
weight = 10  # in lbs

# Create the shipment. Use file_format='EPL' for a thermal-printer-compatible EPL
shipment = ups.create_shipment(from_addr, to_addr, dimensions, weight,
                               file_format='GIF')

# Print information about our shipment
print shipment.cost
print shipment.tracking_number

# Save the shipping label to print, email, etc
shipment.save_label(open('label.gif', 'wb'))
Owner
Jay Goel
Jay Goel
A modular dynamical-systems model of Ethereum's validator economics.

CADLabs Ethereum Economic Model A modular dynamical-systems model of Ethereum's validator economics, based on the open-source Python library radCAD, a

CADLabs 104 Jan 03, 2023
Public API client for GETTR, a "non-bias [sic] social network," designed for data archival and analysis.

GoGettr GoGettr is an API client for GETTR, a "non-bias [sic] social network." (We will not reward their domain with a hyperlink.) GoGettr is built an

Stanford Internet Observatory 72 Dec 14, 2022
An advanced crypto trading bot written in Python

Jesse Jesse is an advanced crypto trading framework which aims to simplify researching and defining trading strategies. Why Jesse? In short, Jesse is

Jesse 4.4k Jan 09, 2023
Aplicação dos metodos de classificação em 3 diferentes banco de dados. Usando...

Machine Learning - Métodos de classificação Base de Dados utilizadas: Dados de crédito Dados do Census Métodos de classificação aplicados: Naive Bayes

1 Jan 18, 2022
Simple-nft-tutorial - A simple tutorial on making nft/memecoins on algorand

nft/memecoin Tutorial on Algorand Let's make a simple NFT/memecoin on the Algora

2 Feb 05, 2022
Bitbucket Server API Wrapper

A simple wrapper for the Atlassian's Bitbucket Server / Bitbucket Datacenter (formerly Stash) REST API, written in Python.

Schweitzer Engineering Laboratories 4 Jan 06, 2023
Retrieves GitHub Stats via `git_api` and flask.

GitHub User Search Created using Python3 and git_api, coded by JBYT27. About This is a project I decided to make for Kajam, but I decided to choose a

an aspirin 4 May 11, 2022
Currency And Gold Prices - Currency And Gold Prices For Python

Currency_And_Gold_Prices Photos from the app New Update Show range Change better

Ali HemmatNia 4 Sep 19, 2022
Free python/telegram bot for easy execution and surveillance of crypto trading plans on multiple exchanges.

EazeBot Introduction Have you ever traded cryptocurrencies and lost overview of your planned buys/sells? Have you encountered the experience that your

Marcel Beining 100 Dec 06, 2022
Python script that extract data via YouTube Api and manipulates it.

UNLIMITED README for the Unlimited game [Mining game] Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Project

Serban Chisca 1 Dec 12, 2021
A twitter multi-tool for OSINT on twitter accounts.

TwitterCheckr A twitter multi-tool for OSINT on twitter accounts. Infomation TwitterCheckr also known as TCheckr is multi-tool for OSINT on twitter a

IRIS 16 Dec 23, 2022
WhatsApp Multi Device Client

WhatsApp Multi Device Client

23 Nov 18, 2022
This is a simple bot for running Python code through Discord

Python Code Runner Discord Bot This is a simple bot for running Python code through Discord. It was originally developed for the Beginner.Codes Discor

beginner.py 1 Feb 14, 2022
Revolt.py - An async library to interact with the https://revolt.chat api.

Revolt.py An async library to interact with the https://revolt.chat api. This library will be focused on making bots and i will not implement anything

Zomatree 0 Oct 08, 2022
BingBot - A bot that will automate searches on bing

bingBot A bot that will automate searches on bing. To install this just download

Lukas 2 Jul 28, 2022
A really easy way to display your spotify listening status on spotify.

Spotify playing README A really easy way to display your spotify listening status on READMEs and Websites too! Demo Here's the embed from the site. Cu

Sunrit Jana 21 Nov 06, 2022
A python API for BSCScan (Binance Smart Chain Explorer), available on PyPI.

bscscan-python A complete Python API for BscScan.com, available on PyPI. Powered by BscScan.com APIs. This is a gently modified fork of the etherscan-

Panagiotis Kotsias 246 Dec 31, 2022
TikTok channel bulk ripper based on TikTok-Api and Youtube-dl. Some assembly may be required.

RipTok Script provided as is. Absolutely no guarantee. A TikTok ripper based on TikTokApi and YouTube-dl. Some assembly may be required. positional ar

32 Dec 24, 2022
A simple script that loads and hot-reloads cogs when you save any changes

DiscordBot-HotReload A simple script that loads and hot-reloads cogs when you save any changes Usage @bot.event async def on_ready(): from HotRelo

2 Jan 14, 2022
pylunasvg - Python bindings for lunasvg

pylunasvg - Python bindings for lunasvg Pylunasvg is a simple wrapper around lunasvg that uses pybind11 to create python bindings. All public API of t

Eren 6 Jan 05, 2023