Skip to main content

A Python library for URL shortening and QR code generation.

Project description

urllink

urllink is a simple Python library that allows you to shorten URLs and generate QR codes using online APIs.

Features

  • 🔗 URL Shortener via shrtco.de API
  • 📷 QR Code Generator via goqr.me API
  • 🌐 Internet connectivity check before making API calls

Installation

pip install urllink

Example Usage

from urllink import shorten_url, generate_qrcode

# Shorten a URL
short_url = shorten_url("https://example.com")
print("Shortened URL:", short_url)

# Generate a QR code
qr_path = generate_qrcode("https://example.com", save_path="output/qrcode.png", size=300)
print("QR Code saved to:", qr_path)

Generates a QR code from the provided text or URL.
Function Reference
Parameters:

data (str, required): The content to encode into the QR code.

save_path (str, optional): Full path (including filename) to save the image.
Default: "qrcode.png" saved in the current directory.

size (int, optional): The size of the QR code image in pixels.
Default: 500

Returns:

The file path where the QR code image was saved.

An error message string if generation fails.

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

urllink-1.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

urllink-1.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

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