Skip to main content

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

  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 urlzap
  4. Run the CLI:

    • Type zap 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
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


Download files

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

Source Distribution

urlzap-2.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

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

Hashes for urlzap-2.0.1.tar.gz
Algorithm Hash digest
SHA256 11544db9df0794cd3121df09d263d249683cc604d6c709210fc5dfe1abddfa65
MD5 4e601a5ce7c41116dc5b689605a77642
BLAKE2b-256 4ac21c3fdb4fc31a4aa950bf51dde1fe547f5b3a25a4000cb581f7967a18f734

See more details on using hashes here.

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

Hashes for urlzap-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86211f7715b158aebc437def8ccf2d02c2bc92a98a82cb29cc281d7cc2708d67
MD5 1eb56090bac1cf13901a937aa14a9a32
BLAKE2b-256 83be9c67996aba1f7b015e5642c87151d29d2ed7a7da85e84275f09d00dcc5db

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