Skip to main content

A CLI tool to shorten URLs using TinyURL

Project description

🚀 URL Shortener CLI Tool 🌐

⚙️ Setup and Installation

Prerequisites

Ensure you have the following installed:

  • 🐍 Python 3.7+
  • 📦 requests (installed automatically)

Installation Steps

  1. 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
  2. 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
  3. Install the CLI tool:

    • Run: pip install .
  4. Run the CLI:

    • Type shr in the terminal to start using the tool.

    Now, your CLI tool is ready to use! 🎉

🛠️ 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
shr shorten <url> Shorten a URL with detailed output
shr validate <url> Validate a URL
shr history Display history of shortened URLs
shr batch <file> Shorten URLs from a text file
shr info Display tool information
shr version Show tool version

Run shr --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 shr 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urlzap-1.0.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urlzap-1.0.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file urlzap-1.0.0.tar.gz.

File metadata

  • Download URL: urlzap-1.0.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for urlzap-1.0.0.tar.gz
Algorithm Hash digest
SHA256 816b35607a4cece6ad6e449c7cf79a654d63db21258c09a745b4516faf3ed31a
MD5 e98dcc7fb8644baf3d2c51c686f8e8a3
BLAKE2b-256 6f6caa53139eba749098e3938dc93f0a7190c05b7fdb1ab5d7cf55061e4bdf6e

See more details on using hashes here.

File details

Details for the file urlzap-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: urlzap-1.0.0-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.10.11

File hashes

Hashes for urlzap-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a27b49688b066737720c6e89819ba53590b3f96656aec753583bcd724fdcbee8
MD5 0e4e04837e61d6402c0b9d1145798e7b
BLAKE2b-256 fbbb6d915ea14940648de7469c47fbb44737b610a4172e18ab8cd959eecbaf55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page