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[clipboard]

From Source (Development)

git clone git@github.com:NecRaul/lain.la-link-shortener.git
cd lain.la-link-shortener
# You can skip the next two commands
# for installing it globally
python -m venv .venv
source .venv/bin/activate
pip install -e .[clipboard,dev,build]

Usage

Simply provide a URL, and the tool will automatically handle protocol validation and formatting.

# Shorten a URL
lain-shorten https://kuroneko.dev

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

Dependencies

  • requests: send the API request for shortening.

Optional

  • pyperclip: copy the shortened URL to the clipboard.

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 -d "url=https://kuroneko.dev" https://s.lain.la

The lain-shorten way

  • Validation: Uses urllib to ensure the URL is formatted correctly.
  • API Request: Sends the POST request via requests.
  • Normalization: Automatically adds https:// if missing.
  • 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.15.tar.gz (13.3 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.15-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lain_shorten-1.15.tar.gz
  • Upload date:
  • Size: 13.3 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.15.tar.gz
Algorithm Hash digest
SHA256 72001f1288c07958e7c1a19b8473f074081a5b684f6fd54e7d82f5f74b1d092c
MD5 91dff774b4cfc2da664d5f6ce17d4f1e
BLAKE2b-256 9519c9a7becf941eec8779385f549be3b754cda982a10ed26786f5bfbb89009a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lain_shorten-1.15.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.15-py3-none-any.whl.

File metadata

  • Download URL: lain_shorten-1.15-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.15-py3-none-any.whl
Algorithm Hash digest
SHA256 654edb75cb4e3c3dc9ab3a4090e386a510ab2b4e4fe3d32f23b70c5176217b7a
MD5 1747f6d85d9d9643bc508fe0f6ee7e9d
BLAKE2b-256 345bc53c674d8ad625ba0bbf427e0d70520236575eaea43413d6d98408bb2592

See more details on using hashes here.

Provenance

The following attestation bundles were made for lain_shorten-1.15-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