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.3.1.tar.gz (32.7 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.3.1-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file pyshortio-0.3.1.tar.gz.

File metadata

  • Download URL: pyshortio-0.3.1.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for pyshortio-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e0208c6684a8c2213622093d278b2d7607d67181dc639e27cfea82223e324089
MD5 bfb34781f9a31b5099e0a2c35eceeb91
BLAKE2b-256 b601b6b7814e019248eb4d391e39486656fc3b5110d8d94babbe0a5dd3185e87

See more details on using hashes here.

File details

Details for the file pyshortio-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pyshortio-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 39.2 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7db49d5174d81be58fc61c294d2608baa745feee64a7f731d56489ccd1409a3e
MD5 e08b06ed298c8d5129de234b3df9c355
BLAKE2b-256 00eadbcc4059c53b316834ccbad90c84a196fdf267bbb9170af5e5d3f4335502

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