Skip to main content

URL Shortener using s.lain.la API.

Project description

lain.la-link-shortener

URL Shortener using s.lain.la API.

Installation

Via PyPI (Recommended)

# Basic installation
pip install lain-shorten

# With clipboard support (recommended for desktop)
pip install lain-shorten[default]

From Source (Development)

git clone git@github.com:NecRaul/lain.la-link-shortener.git
cd lain-la-link-shortener
pip install -e .[dev]

Usage

Simply provide a URL. The tool automatically handles protocol validation and formatting.

# Standard usage
lain-shorten https://kuroneko.dev

# Protocol-less (automatically prepends https://)
lain-shorten kuroneko.dev

Dependencies

  • requests: send the API request for shortening.
    • urllib3: check validity of the URL provided.

Optional

  • pyperclip - copy the shortened URL to the clipboard. (optional)

How it works

The s.lain.la service allows shortening URLs via a POST request. This tool automates the process to avoid typing long curl strings:

The Manual Way

curl -X POST -d 'url=https://kuroneko.dev' https://s.lain.la

The lain-shorten way

  • Validation: Uses urllib3 to ensure the URL is formatted correctly.
  • Normalization: Automatically adds https:// if missing.
  • API Request: Sends the POST request via requests.
  • Clipboard (Optional): If pyperclip is installed, the result is instantly copied to your clipboard.

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

lain_shorten-1.14.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

lain_shorten-1.14-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file lain_shorten-1.14.tar.gz.

File metadata

  • Download URL: lain_shorten-1.14.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lain_shorten-1.14.tar.gz
Algorithm Hash digest
SHA256 04b52df4b0add9ca7df862b9614c78afdcf5cc33fa3b7cec1417ca68aba857b2
MD5 8b93384e577fc00261fa3bb933f69a92
BLAKE2b-256 887d93bf57c2388522911cf4b30cc1c952dee44489a08559c19a8390e6f1448f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lain_shorten-1.14.tar.gz:

Publisher: publish.yml on NecRaul/lain.la-link-shortener

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lain_shorten-1.14-py3-none-any.whl.

File metadata

  • Download URL: lain_shorten-1.14-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lain_shorten-1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 279d1cf830c7f0152925591dbccd0a19cc30a126afe37b41bb0e18af4eb9fedf
MD5 bf3c81a2feaf3f5544e0d70dec6ee41c
BLAKE2b-256 b189a862fd8ac7b096299f356a46aecaebd20faa8440add9788d86f6869144a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for lain_shorten-1.14-py3-none-any.whl:

Publisher: publish.yml on NecRaul/lain.la-link-shortener

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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