Skip to main content

A simple tool to customize links.

Project description

LinkMod: The Ultimate Command-Line URL Tool

LinkMod is a powerful and flexible command-line tool that enhances your URL management workflow. It offers two primary functionalities:

  1. Bitly URL Shortening: Quickly shorten long URLs using the Bitly API.
  2. Custom Link Naming: Create memorable, custom-named links in the format custom-name@your-link.com.

When you provide a long URL and a custom name, LinkMod will first shorten the URL with Bitly (if an API key is available) and then create a custom link with the shortened URL.

Features

  • Seamless Bitly Integration: Shorten URLs with a single command.
  • Secure API Key Storage: Your Bitly API key is stored securely in your system's native credential manager using the keyring library.
  • Cross-Platform: Works on Windows, macOS, and Linux.
  • User-Friendly Prompts: The tool guides you through setting up your Bitly API key for the first time.
  • Flexible Usage: Use either the URL shortening, the custom link naming, or both combined.

Installation

You can install LinkMod using pip:

pip install .

This will install the package and all its dependencies (requests and keyring).

Usage

LinkMod's functionality changes based on the number of arguments you provide.

1. Shorten a URL with Bitly

To shorten a long URL, simply provide it as a single argument:

linkMod {long_url}

Example:

linkMod https://www.github.com/Rishi-Bhati/linkmod

Output:

Short link: https://bit.ly/xxxxxxx

2. Create a Custom Link (with optional Bitly shortening)

To create a custom-named link, provide the original URL and your desired custom name:

linkMod {long_url} {custom_name}

Example:

linkMod https://www.github.com/Rishi-Bhati/linkmod my-repo

Output:

Checking for Bitly API key...
Bitly API key found. Shortening link...
Link shortened successfully.
my-repo@bit.ly/xxxxxxx

If no Bitly API key is found, the tool will use the original link:

Checking for Bitly API key...
Bitly API key not found. Using original link.
my-repo@www.github.com/Rishi-Bhati/linkmod

Setting Up Your Bitly API Key

The first time you use a feature that requires a Bitly API key, the tool will prompt you to add one:

Bitly API key not found. Would you like to add one? (y/n):

If you select y, you will be prompted to enter your API key. It will then be securely stored for all future uses.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue on the GitHub repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

linkmod-1.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

linkmod-1.0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file linkmod-1.0.1.tar.gz.

File metadata

  • Download URL: linkmod-1.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for linkmod-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f1ad4f49ccec219e08a529526fde0373940c710cc545be818f6bcced6131ed01
MD5 e5dd8816c3208f77949242ac201672f1
BLAKE2b-256 0d8d81725783423ac1d47c32e9346a5a413e036a47cc3e48d510af9303ac024e

See more details on using hashes here.

File details

Details for the file linkmod-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: linkmod-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for linkmod-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 18e140682a64ae50a8f36428fee87fd8c42e723e448827c42d7cb68a163bafab
MD5 10739d708799c9e1ad4ad116dd5d168f
BLAKE2b-256 a5d6ce17affb434219f8c7086b235ffc678d4229a7c2b93ed11a929329b79472

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