python3 flask based python-url-shortener microservice.

Overview

python-url-shortener

This repository is for managing all public/private entity specific api endpoints for an organisation. In this case we have entity as URL shortener

Project Structure

The basic project structure is as follows:

root/
 |-- app
 |   |-- controllers/
 |   |   |-- __init__.py
 |   |   |-- url_shortener_controller.py
 |   |-- services/
 |   |   |-- __init__.py
 |   |   |-- url_shortener_service.py
 |   |-- schemas/
 |   |   |-- __init__.py
 |   |   |-- url_shortener_schema.py
 |   |-- utilities/
 |   |   |-- __init__.py
 |   |   |-- url_shortener_utility.py
 |   |-- tests/
 |   |   |-- __init__.py
 |   |   |-- test_url_shortener_controller.py
 |   |   |-- test_url_shortener_utility.py
 |   |-- config.py
 |   |-- errors.py
 |   |-- routes.py
 |   |-- __init__.py
 |   build.sh
 |   logging.yaml
 |   setup.py
 |   README.md

Synopsis

There are two API endpoints exposed as part of this app
1. /url/encode
2. /url/decode

/url/encode:  Will shorten a valid URL and returns a shorten URL(JSON) also 
put origianl, shorten url in cache(We are using flask_caching for storage).

/url/decode:  Will return a valid URL original URL(JSON) for a given shorten 
url from cache(We are using flask_caching for storage).

For request/response structure please reffer 
Swagger URl after successful buld & run step.

Requirements

python 3.9
Flask 2.0.2
marshmallow 3.12.2
flask_caching
Werkzeug 2.0.2

for detiled requirement please reffer setup.py

Quick Start Setup

Run Setup.

This will create virtualenv and install all required packages and will allow you to run the app from anywhere on your machine.

$> cd the-shortest-url-1-uvpyns
$> ./build.sh

Run the tests

$> cd the-shortest-url-1-uvpyns
$> pytest

Running Locally

API can be executed as follows:

$> cd the-shortest-url-1-uvpyns
$> python api_gateway.py

Navigate to the posted URL in your terminal to be greeted with Swagger, where you can run the API endpoints.

You might also like...
🌐 URL parsing and manipulation made easy.

furl is a small Python library that makes parsing and manipulating URLs easy. Python's standard urllib and urlparse modules provide a number of URL re

A simple, immutable URL class with a clean API for interrogation and manipulation.

purl - A simple Python URL class A simple, immutable URL class with a clean API for interrogation and manipulation. Supports Pythons 2.7, 3.3, 3.4, 3.

Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL.
Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL.

Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL. It allows you to see the complete path a redirected URL goes through. It will show you the full redirection path of URLs, shortened links, or tiny URLs.

A URL builder for genius :D

genius-url A URL builder for genius :D Usage from gurl import genius_url

declutters url lists for crawling/pentesting
declutters url lists for crawling/pentesting

uro Using a URL list for security testing can be painful as there are a lot of URLs that have uninteresting/duplicate content; uro aims to solve that.

find all the URL of a site with a specific Regex
find all the URL of a site with a specific Regex

href this program will find all the link with a spesfic Regex pattern from a site. what it will do in any site there are a lots of url that may you ne

This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

Use this module to detect if a URL is on discord's phishing list.

PhishDetector This module was made so you can check a URL and see if it's in discord's official list of phishing and suspicious URLs. Installation pip

Ukiyo - A simple, minimalist and efficient discord vanity URL sniper
Ukiyo - A simple, minimalist and efficient discord vanity URL sniper

Ukiyo - a simple, minimalist and efficient discord vanity URL sniper. Ukiyo is easy to use, has a very visually pleasing interface, and has great spee

Owner
Asutosh Parida
Love to work on Data.
Asutosh Parida
Customizable URL shortener written in Python3 for sniffing and spoofing

Customizable URL shortener written in Python3 for sniffing and spoofing

null 3 Nov 22, 2022
A simple URL shortener built with Flask

A simple URL shortener built with Flask and MongoDB.

Mike Lowe 2 Feb 5, 2022
A simple URL shortener app using Python AWS Chalice, AWS Lambda and AWS Dynamodb.

url-shortener-chalice A simple URL shortener app using AWS Chalice. Please make sure you configure your AWS credentials using AWS CLI before starting

Ranadeep Ghosh 2 Dec 9, 2022
Qysqa - URL shortener website with python

Qysqa - shorten your URL. ~ A simple URL-shortening website. how do you pronounc

Dastan Ozgeldi 0 Nov 18, 2022
🔗 FusiShort is a URL shortener built with Python, Redis, Docker and Kubernetes

This is a playground application created with goal of applying full cycle software development using popular technologies like Python, Redis, Docker and Kubernetes.

Lucas Fusinato Zanis 7 Nov 10, 2022
a url shortener project from semicolonworld

Url Shortener With Django Written by Semicolon World

null 3 Aug 24, 2021
A url shortner written in Flask.

url-shortener-elitmus This is a simple flask app which takes an URL and shortens it. This shortened verion of the URL redirects to the user to the lon

null 2 Nov 23, 2021
A python code for url redirect check

A python code for url redirect check

Fayas Noushad 1 Oct 24, 2021
A url redirect status check module for python

A url redirect status check module for python

Fayas Noushad 2 Oct 24, 2021
A tool to manage the base URL of the Python package index.

chpip A tool to manage the base URL of the Python package index. Installation $ pip install chpip Usage Set pip index URL Set the base URL of the Pyth

Prodesire 4 Dec 20, 2022