Skip to main content

A Python library for interacting with a QR code generation API (https://qrcode.ness.su)

Project description

QRCodeAPI

PyPI License Python Version

QRCodeAPI is a Python library designed to seamlessly interact with the QR code generation API from qrcode.ness.su. Leveraging FastAPI and aiohttp, it provides a convenient and asynchronous experience for generating QR codes.

Features

  • Simplicity: Generate QR codes with a simple and intuitive interface.
  • Customization: Fine-tune QR code parameters, including data encoding, border size, box size, and optional image inclusion.

Installation

pip install qrcodeapi

Usage

import asyncio
from qrcodeapi import QRCodeAPI


async def main():
    # Create an instance of QRCodeAPI
    qrcode_api = QRCodeAPI()

    # Example: Generate a basic QR code and save it to a file
    data = "Hello, QR Code!"
    filename = "qrcode.png"
    qr_code_image = await qrcode_api.create(data)
    with open(filename, "wb") as f:
        f.write(qr_code_image)

    # Example: Generate a QR code with an image and save it to a file
    data_with_image = "Example Data"
    image_url = "https://example.com/logo.png"
    filename_with_image = "qrcode_with_image.png"
    qr_code_image_with_image = await qrcode_api.create(
        data_with_image,
        border=5,
        box_size=40,
        image_url=image_url,
        image_round=20,
        image_padding=5,
    )
    with open(filename_with_image, "wb") as f:
        f.write(qr_code_image_with_image)


if __name__ == '__main__':
    asyncio.run(main())

Licensing

QRCodeAPI is licensed under the MIT License. See the LICENSE file for details.

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

qrcodeapi-0.0.1.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

qrcodeapi-0.0.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page