A professional command-line URL Shortener built with Python featuring URL validation, custom short codes, duplicate detection, JSON storage, statistics, and modular architecture.
A professional command-line URL Shortener built with Python. This application allows users to shorten long URLs, generate unique short codes, retrieve original URLs, manage stored links, and maintain persistent data using a JSON database.
- ✅ Shorten long URLs
- ✅ Generate unique random short codes
- ✅ Create custom short codes
- ✅ URL validation
- ✅ Automatic
https://support - ✅ Duplicate URL detection
- ✅ Retrieve original URL
- ✅ View all stored URLs
- ✅ Delete URLs
- ✅ Statistics Dashboard
- ✅ JSON-based database
- ✅ Modular project structure
- ✅ Exception handling
- ✅ Beginner-friendly and scalable architecture
Professional-URL-Shortener/
│
├── main.py
├── url_manager.py
├── file_handler.py
├── validator.py
├── utils.py
├── config.py
├── urls.json
├── requirements.txt
├── .gitignore
├── LICENSE
└── README.md
git clone https://github.com/humma2730-collab/Professional-URL-Shortener-Python.gitcd Professional-URL-Shortener-Pythonpip install -r requirements.txtpython main.py==================================================
PROFESSIONAL URL SHORTENER
==================================================
1. Shorten New URL
2. Open Original URL
3. View All URLs
4. Delete URL
5. Statistics
6. Exit
Enter Long URL:
https://github.com
Custom short code (Press Enter to skip):
[SUCCESS] Short URL Created Successfully!
Original URL : https://github.com
Short URL : http://short.ly/aB7X2K
============================================================
1.
Short Code : aB7X2K
Short URL : http://short.ly/aB7X2K
Original : https://github.com
Created At : 2026-07-30 18:30:45
============================================================
========== STATISTICS ==========
Total URLs : 12
Oldest Code : aB7X2K
Newest Code : xY91Lm
===============================
{
"aB7X2K": {
"url": "https://github.com",
"created_at": "2026-07-30 18:30:45"
}
}- Python 3
- JSON
- Validators Library
- File Handling
- Modular Programming
validators==0.35.0
Install using:
pip install -r requirements.txt- Functions
- Modules
- Dictionaries
- Nested Dictionaries
- JSON
- File Handling
- Exception Handling
- Random Code Generation
- Date & Time
- Loops
- Conditional Statements
- Input Validation
- 🌐 Flask Web Version
- 🗄 SQLite Database Support
- 📊 URL Analytics
- 📈 Click Counter
- 🔐 Password-Protected URLs
- ⏳ Link Expiration
- 📱 REST API
- 📱 QR Code Generator
- ☁ MongoDB Integration
- 👤 User Authentication
Huma Fatima
BS Computer Science Student
GitHub: https://github.com/humma2730-collab
Contributions, suggestions, and improvements are welcome.
- Fork the repository
- Create a new branch
- Commit your changes
- Push your branch
- Create a Pull Request
This project is licensed under the MIT License.
If you found this project useful, don't forget to Star ⭐ the repository.
Happy Coding! 🚀