Skip to main content

Python url shortner library for, and

Project description

A python library to shorten urls using one of three url shortening services

Supports the following services:,, (must use login and apikey)


To install Python-ShortUrl:

pip install python-shorturl



7z x ( if you don’t have 7z : sudo apt-get install p7zip-full )

cd python-shorturl-master/

python install


Command line:

Usage: [-u] [-d] [-l] [-a]



Full URL


Any, tinyurl,, bitly


bitly Login


bitly apikey


default: -u

tinyurl: -u -d tinyurl -u -d

bitly: -u -d bitly -l xyz_login -a zyx_key

Note: replace xyz_login and zyx_key with your own bitly account details

Within your application:

import shorturlpy

loadurl = shorturlpy.ShortUrlPy()

print loadurl.ShortenUrl(’’)

print loadurl.ShortenUrl(’’, ‘tinyurl’)

print loadurl.ShortenUrl(’’, ‘’)

print loadurl.ShortenUrl(’’, ‘bitly’, ‘xyz_login’, ‘zyx_key’)

Note: replace xyz_login and zyx_key with your own bitly account details

Tested on Python 2.7

Developed by Abdul Hamid

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

python-shorturl-0.0.3.tar.gz (3.7 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page