A CLI tool to shorten URLs from your terminal.
Project description
🚀 URL Shortener CLI Tool 🌐
⚙️ Setup and Installation
Prerequisites
Ensure you have the following installed:
- 🐍 Python 3.7+
- 📦
requests(installed automatically)
Installation Steps
-
Clone the repository:
- Open your terminal or command prompt.
- Run:
git clone https://github.com/yadavkapil23/url-shortener-cli.git - Navigate to the project directory:
cd url-shortener-cli
-
Set up a virtual environment (optional):
- Create a virtual environment:
python -m venv venv - Activate it:
- On Linux/Mac:
source venv/bin/activate - On Windows:
venv\Scripts\activate
- On Linux/Mac:
- Create a virtual environment:
-
Install the CLI tool:
- Run:
pip install urlzap
- Run:
-
Run the CLI:
- Type
zapin the terminal to start using the tool.
Now, your CLI tool is ready to use! 🎉
- Type
🛠️ Features
- URL Shortening: Create concise URLs with detailed output.
- Validation: Verify URLs without modifying them.
- History: Track and review past shortenings.
- Batch Mode: Process multiple URLs from a file.
- User-Friendly: Includes a comprehensive help system.
🛡️ Security
- 🔐 No sensitive data storage.
- 🔒 Operates over HTTPS for secure requests.
🚀 Usage
Basic Commands
| Command | Description |
|---|---|
zap shorten <url> |
Shorten a URL with detailed output |
zap validate <url> |
Validate a URL |
zap history |
Display history of shortened URLs |
zap batch <file> |
Shorten URLs from a text file |
zap info |
Display tool information |
zap version |
Show tool version |
Run zap --help for detailed examples and options.
🧠 How It Works
The shorten and batch commands send GET requests to the TinyURL API:
The API returns the shortened URL in plain text. History is stored in url_history.json, and batch results are saved to a timestamped text file.
🚀 Deployment
No additional deployment is required; the tool runs locally via the zap command.
🧠 Future Enhancements
- 🔄 Custom Domains: Support for custom short URL domains.
- 🤖 Advanced Validation: Enhance URL validation with regex patterns.
- 📊 Analytics: Add usage statistics for shortened URLs.
🤝 Contributing
Want to contribute? Fork this repository, submit a pull request, or open an issue. All contributions are welcome! 🛠️
📄 License
This project is licensed under the MIT License.
🎉 Thank you for checking out the URL Shortener CLI Tool! If you have questions or suggestions, feel free to reach out or open an issue. Let's build something amazing!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file urlzap-2.0.1.tar.gz.
File metadata
- Download URL: urlzap-2.0.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11544db9df0794cd3121df09d263d249683cc604d6c709210fc5dfe1abddfa65
|
|
| MD5 |
4e601a5ce7c41116dc5b689605a77642
|
|
| BLAKE2b-256 |
4ac21c3fdb4fc31a4aa950bf51dde1fe547f5b3a25a4000cb581f7967a18f734
|
File details
Details for the file urlzap-2.0.1-py3-none-any.whl.
File metadata
- Download URL: urlzap-2.0.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86211f7715b158aebc437def8ccf2d02c2bc92a98a82cb29cc281d7cc2708d67
|
|
| MD5 |
1eb56090bac1cf13901a937aa14a9a32
|
|
| BLAKE2b-256 |
83be9c67996aba1f7b015e5642c87151d29d2ed7a7da85e84275f09d00dcc5db
|