Skip to main content

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

Documentation Status https://github.com/MacHu-GWU/pyshortio-project/actions/workflows/main.yml/badge.svg https://img.shields.io/pypi/v/pyshortio.svg https://img.shields.io/pypi/l/pyshortio.svg https://img.shields.io/pypi/pyversions/pyshortio.svg https://img.shields.io/badge/✍️_Release_History!--None.svg?style=social&logo=github https://img.shields.io/badge/⭐_Star_me_on_GitHub!--None.svg?style=social&logo=github
https://img.shields.io/badge/Link-API-blue.svg https://img.shields.io/badge/Link-Install-blue.svg https://img.shields.io/badge/Link-GitHub-blue.svg https://img.shields.io/badge/Link-Submit_Issue-blue.svg https://img.shields.io/badge/Link-Request_Feature-blue.svg https://img.shields.io/badge/Link-Download-blue.svg

Welcome to pyshortio Documentation

https://pyshortio.readthedocs.io/en/latest/_static/pyshortio-logo.png

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.

📖 Complete Documentation

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


Download files

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

Source Distribution

pyshortio-0.2.1.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

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

pyshortio-0.2.1-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

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

Hashes for pyshortio-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4a89323e5ebf539e0012482c3425e8c0d5f53974774a25e2ffc2e661a29e8681
MD5 95ffa1fc3aa9dcd66a77172116e7cc38
BLAKE2b-256 fcbf95977de173926f9f81c48c0cc41985f659b831af32489b2eb29bbb7f8c62

See more details on using hashes here.

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

Hashes for pyshortio-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2d545ce8f770d7c89271564a4c05eba3c223b35192778f54cf24ba18a43758a
MD5 92c38cd8d6f2398294fe30d24fcb43a4
BLAKE2b-256 f0c660e8e83656ffcc767bab6904566a4af5b472d691d03370c6ad303a382e1b

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