Skip to main content

Simplifying TinyURL link creation and management with a lightweight Python SDK.

Project description

tinyurl-sdk

A lightweight Python SDK for simplifying TinyURL link creation and management.

Installation

pip install tinyurl-sdk

Usage

from tinyurl_sdk.client import TinyURLClient

client = TinyURLClient(api_key="YOUR_API_KEY")
short_url = client.shorten(
    url="https://www.example.com/my-really-long-link-that-I-need-to-shorten/84378949",
    domain="tinyurl.com",
    alias="myexamplelink",
    tags="example,link",
    expires_at="2024-10-25 10:11:12",
    description="string",
)
print(short_url)

Parameters

Constructor:

Name Required Type Notes
api_key Yes str TinyURL API key.
timeout No float Request timeout in seconds. Default: 10.0.
api_base_url No str Base API URL. Default: https://api.tinyurl.com.
user_agent No str User agent header. Default: tinyurl-sdk/0.0.0.

shorten:

Name Required Type Notes
url Yes str Long URL to shorten.
domain No str TinyURL domain.
alias No str Must be at least 5 characters if provided.
tags No str Comma-separated tags.
expires_at No str Expiration timestamp (API format).
description No str Link description.

Development

pip install -e .

License

MIT

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

tinyurl_sdk-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

tinyurl_sdk-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file tinyurl_sdk-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for tinyurl_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e7687dc99a9ce69b9d98000a646fd53f3b4122784e7939cadd4ff15a7f3db186
MD5 aecadf68c2db16169df54df47b4364dc
BLAKE2b-256 f6658fdcd79cf4fc15615bcc78f63e3b6b1a81d1ea1f621c4c75e6eea246a421

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyurl_sdk-0.1.1.tar.gz:

Publisher: publish.yml on bilalbaraz/tinyurl-sdk

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

File details

Details for the file tinyurl_sdk-0.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for tinyurl_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8865fff94e9bbfc264144532038bbea1dabca48232271204e10aa707fa294b78
MD5 73b66d675b7f3889ceecc84d0db944ec
BLAKE2b-256 0f69146afe2a76da7d48ab806165e85e0859826274b575111f8b5eece48d0ef9

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyurl_sdk-0.1.1-py3-none-any.whl:

Publisher: publish.yml on bilalbaraz/tinyurl-sdk

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