PyShortIO is a Pythonic client library for the Short.io URL shortening service that provides a clean, well-documented API with comprehensive error handling and pagination support.
Project description
Welcome to pyshortio Documentation
PyShortIO provides a clean, well-documented API client for the Short.io URL shortening service with comprehensive error handling and pagination support. It follows Pythonic design principles to make URL shortening operations intuitive and efficient.
Quick Start
from pyshortio.api import Client
# Initialize client with your API token
client = Client(token="your_api_token")
# Get your domain
response, domain = client.get_domain_by_hostname("your-domain.short.gy")
domain_id = domain.id
# Create a shortened link
response, link = client.create_link(
hostname="your-domain.short.gy",
original_url="https://example.com/very-long-url-path",
title="Example Link"
)
print(f"Shortened URL: {link.short_url}")
# List all your links
response, links = client.list_links(domain_id=domain_id)
for link in links:
print(f"{link.title}: {link.short_url} -> {link.original_url}")
🚀 Bulk URL Management with Sync TSV
Managing multiple Short.io links doesn’t have to be tedious! PyShortIO includes a powerful Sync TSV feature that lets you create, update, and delete hundreds of shortened URLs in a single operation using spreadsheet files. Maintain your links in Google Sheets, export as TSV, and sync them to Short.io with just a few lines of code. Perfect for marketing campaigns, documentation management, or any scenario requiring bulk URL operations.
# Install with sync dependencies
# pip install pyshortio[sync]
with open("links.tsv", "r") as file:
client.sync_tsv(hostname="yourdomain.short.gy", file=file)
Install
pyshortio is released on PyPI, so all you need is to:
$ pip install pyshortio
To upgrade to latest version:
$ pip install --upgrade pyshortio
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyshortio-0.2.1.tar.gz.
File metadata
- Download URL: pyshortio-0.2.1.tar.gz
- Upload date:
- Size: 32.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a89323e5ebf539e0012482c3425e8c0d5f53974774a25e2ffc2e661a29e8681
|
|
| MD5 |
95ffa1fc3aa9dcd66a77172116e7cc38
|
|
| BLAKE2b-256 |
fcbf95977de173926f9f81c48c0cc41985f659b831af32489b2eb29bbb7f8c62
|
File details
Details for the file pyshortio-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pyshortio-0.2.1-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2d545ce8f770d7c89271564a4c05eba3c223b35192778f54cf24ba18a43758a
|
|
| MD5 |
92c38cd8d6f2398294fe30d24fcb43a4
|
|
| BLAKE2b-256 |
f0c660e8e83656ffcc767bab6904566a4af5b472d691d03370c6ad303a382e1b
|