Skip to main content

Official Python SDK for Redirox URL shortener

Project description

Redirox Banner

Redirox

🚀 Smart Links. Clean Routes.

Modern Python SDK for the Redirox URL Shortener

PyPI Python Versions License


🌌 About

Redirox is a lightweight and modern URL shortener built for developers.

I always wondered:

“Can a URL shortener be both powerful and minimal?”

So I built Redirox with one goal:

  • ⚡ Fast
  • 🎯 Minimal
  • 🔒 Secure
  • 🧩 Developer friendly

The platform is live at:

🔗 https://redirox.vercel.app

The complete Redirox website is also fully open source.

💻 Website Repository: https://github.com/MKishoreDev/Redirox

After building the platform, I decided to create an official PyPI package so developers can integrate Redirox directly into Python applications, scripts, automation workflows, and Telegram bots.


✨ Features

  • 🔗 Smart URL shortening
  • 🔒 Password protected links
  • ⏳ Expiration support
  • 📱 QR code generation
  • ⚡ Fast redirects
  • 🪶 Lightweight SDK
  • 🐍 Pythonic API
  • 🤖 Telegram bot support using Pyrogram
  • 🌐 Clean developer experience

📦 Installation

Basic Installation

pip install redirox

Install with Telegram Bot Support

pip install pyrogram tgcrypto

⚡ Quick Start

from redirox import Redirox

client = Redirox()

result = client.shorten(
    "https://google.com"
)

print(result)

🔗 Shorten URLs

from redirox import Redirox

client = Redirox()

result = client.shorten(
    "https://example.com"
)

print("Short URL:", result["short_url"])

🔒 Password Protected Links

from redirox import Redirox

client = Redirox()

result = client.shorten(
    "https://example.com",
    password="mypassword"
)

print(result)

⏳ Expiring Links

from redirox import Redirox
from datetime import datetime, timedelta

client = Redirox()

expires_at = (
    datetime.utcnow() + timedelta(hours=1)
).isoformat()

result = client.shorten(
    "https://example.com",
    expires_at=expires_at
)

print(result["expires_at"])

📱 Generate QR Codes

from redirox import Redirox

client = Redirox()

result = client.shorten(
    "https://github.com",
    generate_qr=True
)

print(result["qr_code"])

💾 Save QR Code as PNG

import base64

qr_data = result["qr_code"].split(",")[1]

with open("qr.png", "wb") as f:
    f.write(base64.b64decode(qr_data))

print("QR Code saved!")

📊 Get Link Information

from redirox import Redirox

client = Redirox()

info = client.info("abc123")

print(info)

🤖 Telegram Bot Example (Pyrogram)

import base64

from pyrogram import Client, filters
from redirox import Redirox

app = Client(
    "redirox-bot",
    api_id=12345,
    api_hash="YOUR_API_HASH",
    bot_token="YOUR_BOT_TOKEN"
)

redirox = Redirox()


@app.on_message(filters.text & filters.private)
async def shorten_link(client, message):
    url = message.text.strip()

    try:
        result = redirox.shorten(
            url,
            generate_qr=True
        )

        short_url = result["short_url"]
        qr_code = result["qr_code"]

        # Decode QR Code
        qr_data = qr_code.split(",")[1]

        with open("qr.png", "wb") as f:
            f.write(base64.b64decode(qr_data))

        # Send QR Code Image
        await message.reply_photo(
            photo="qr.png",
            caption=(
                f"🔗 **Short URL:**\n"
                f"{short_url}"
            )
        )

    except Exception as e:
        await message.reply_text(
            f"❌ Error:\n{e}"
        )


app.run()

📩 Example Telegram Bot Response

The Telegram bot will:

  • 🔗 Shorten the URL
  • 📱 Generate a QR code
  • 🖼 Send the QR code as an image
  • ⚡ Return the shortened link instantly

Perfect for:

  • Telegram utility bots
  • Channel management tools
  • Automation workflows
  • Link sharing bots

📄 Example Response

{
    "code": "abc123",
    "short_url": "https://redirox.vercel.app/abc123",
    "url": "https://google.com",
    "qr_code": None,
    "expires_at": None,
    "has_password": False
}

🎯 Philosophy

Redirox focuses on simplicity.

No bloated dashboards.
No forced signups.
No unnecessary friction.

Just fast redirects, clean APIs, and developer-first workflows.


🌍 Open Source

Contributions are welcome!

You can help by:

  • Fixing bugs
  • Improving documentation
  • Suggesting features
  • Enhancing the SDK
  • Creating integrations

Feel free to open issues or submit pull requests.


🔗 Links

Platform Link
🌐 Website https://redirox.vercel.app
💻 Website Source https://github.com/MKishoreDev/Redirox
📦 PyPI https://pypi.org/project/redirox/
🐍 SDK Repository https://github.com/MKishoreDev/redirox-pypi

📄 License

MIT License © Kishore


❤️ Made with passion by Kishore

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

redirox-1.0.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

redirox-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file redirox-1.0.0.tar.gz.

File metadata

  • Download URL: redirox-1.0.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for redirox-1.0.0.tar.gz
Algorithm Hash digest
SHA256 19553011f38f9fa01f17f2fd5aef8a0d099b8f62d3c29acf0d7700563b7e8d36
MD5 73a377a9fa785a1d0c1d5c68396fd050
BLAKE2b-256 608d77b7426cb3fea673ab2b3f4e8c6c6c3428acb95dc68ae9785fbb203be4d5

See more details on using hashes here.

File details

Details for the file redirox-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: redirox-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for redirox-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 217a9a3ac128c486ba7bc690f11836e27ca3abb7c987f71386ebbe58537cf070
MD5 98579d6344f6f3734c5f1e211a287ada
BLAKE2b-256 e0b4c3f9e7113dcc4bb6a15a56b649bad254f59f7cbf19efc8bb0c67d5bf6546

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