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 Python API for Connected 2

connected API for Connected 2 api for the { connected 2 } programmer : api report api follow api check username api forget password api Search api cha

2 Jun 05, 2022
Python API for British Geological Survey magnetic field calculator

Magnetic field calculator Python API for British Geological Survey magnetic field calculator. Description This project magnetic field calculator. It u

Filip ล  3 Mar 11, 2022
send sms via grafana alert webhook

notifier fire alarm What does this project do: the aim of this project is to send alarm notification from grafana alert manager via kavenegar api. sta

Ali Soltani 4 Oct 20, 2021
Yes, it's true :purple_heart: This repository has 353 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serverless! If

510 Dec 28, 2022
A group management bot written in python3 using the python-telegram-bot library.

Chika Fujiwara A modular telegram Python bot running on python3 with an sqlalchemy database. Originally a Marie fork, Chika was created for personal u

Wahyusaputra 3 Feb 12, 2022
SongLink Discord Bot - Discord bot to share music links easily

SongLink_Discord_Bot Discord bot to share music links easily. Take a link from y

Edgar Lefevre 4 Feb 18, 2022
Minimal Python client for the Iris API, built on top of Authlib and httpx.

๐Ÿ•ธ๏ธ Iris Python Client Minimal Python client for the Iris API, built on top of Authlib and httpx. Installation pip install dioptra-iris-client Usage f

Dioptra 1 Jan 28, 2022
Collect links to profiles by username through search engines

Marple Summary Collect links to profiles by username through search engines (currently Google and DuckDuckGo). Quick Start ./marple.py soxoj Results:

125 Dec 19, 2022
Disctopia-c2 - Windows Backdoor that is controlled through Discord

Disctopia Disctopia Command and Control What is Disctopia? Disctopia is an open

Dimitris Kalopisis 218 Dec 26, 2022
Open Resource Calculator Module for Python

Calculator Module for Python By White Night Install #

White_Night_awa 4 Aug 22, 2022
Web-music-bot - A telegram bot which get a *site Url* and sends all songs contain in the Url to telegram

web music bot this is a telegram bot which get a site Url and sends all songs co

Arya Shabane 4 Apr 02, 2022
NMux is the version of the NMscript in termux

NMscript-termux-version Termux-Version NMux is the termux version of NMscript which is NMscript? NMscript is a simple script written in Python that he

cabeson sin z 5 Apr 23, 2022
โ€œ Hey there ๐Ÿ‘‹ I'm Daisy โ€ž AI based Advanced Group Management Bot Suit For All Your Needs โค๏ธ.. Source Code of @Daisyxbot

Project still under heavy development Everything will be changed in the release โ€œ Hey there ๐Ÿ‘‹ I'm Daisy โ€ž AI based Advanced telegram Group Management

TeamDaisyX 43 Nov 12, 2022
A Telegram Bot written in Python for mirroring files on the Internet to your Google Drive or Telegram

Original Repo mirror-leech-telegram-bot This is a Telegram Bot written in Python for mirroring files on the Internet to your Google Drive or Telegram.

0 Jan 03, 2022
A simple Discord Mass Dm with Scraper

Python-Mass-DM A simple Discord Mass Dm with Scraper If Member Scraper in Taliban.py doesn't work. You can DM me cuz that scraper is for tokens that g

RyanzSantos 4 Sep 02, 2022
Running Performance Calculator

Running Performance Calculator ๐Ÿ‘‰ Have you ever wondered if you ran 10km at 2000

Davide Liu 6 Oct 26, 2022
Who are we? We are the Hunters of all Torrent in this world.๐Ÿ—ก๏ธ.Fork from SlamDevs

MIRROR HUNTER This Mirror Bot is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive. Repo la

Anime Republic 130 May 28, 2022
The easiest way to deploy this Bot

How To Host The easiest way to deploy this Bot Update Channe

Isekai Reszz 1 Jan 23, 2022
A modular Telegram Python bot running on python3 with a sqlalchemy, redislab, mongo database, telethon, and pyrogram.

Zeldris Robot A modular Telegram Python bot running on python3 with a sqlalchemy, redislab, mongo database, telethon, and pyrogram. How to set up/depl

IDNCoderX 42 Dec 21, 2022