Official Python SDK for Redirox URL shortener
Project description
Redirox
🚀 Smart Links. Clean Routes.
Modern Python SDK for the Redirox URL Shortener
🌌 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:
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 |
| 📦 PyPI | https://pypi.org/project/redirox/ |
| 💻 GitHub | https://github.com/MKishoreDev/redirox-pypi |
📄 License
MIT License © Kishore
❤️ Made with passion by Kishore
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 redirox-0.1.0.tar.gz.
File metadata
- Download URL: redirox-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5edebb715b4595c30c9466de1b500a056aa1b36851a32e4fb933df3001f4c44
|
|
| MD5 |
3b455b437f3e858ee9e9431ff57783f4
|
|
| BLAKE2b-256 |
43918e5dba3ab298a334a5afbb8389fd4f7cb7e57faf211df1c9382d93cb2a3f
|
File details
Details for the file redirox-0.1.0-py3-none-any.whl.
File metadata
- Download URL: redirox-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebf64897834b8a35354aec307ce96f81e62a3fa732fe8ad29b6a1c9d2ae887fe
|
|
| MD5 |
ae7d173678ed5333fe92bb4fbf513cb3
|
|
| BLAKE2b-256 |
a8d3b03cd0496696cfead52071c8efc04cc1efa220594b0483301385ea47b7ac
|