URL shortener in python

URL shortener in python

In this tutorial, we will learn how to shorten a URL using pyshorteners.

Explanation ✏

  1. First, we need to install pyshorteners command: pip install pyshorteners
  2. Then, import pyshorteners in your program
  3. Add a link which you need to shorten in my case (dx4iot.hashnode.dev)
  4. Then finally print the URL

Code 👩‍💻

import pyshorteners
def shortURL():
    link = "https://techcosto.com/author/dx4iot/"
    print(pyshorteners.Shortener().clckru.short(link))
shortURL()

Output: clck.ru/VUyLY