A Python library for interacting with a QR code generation API (https://qrcode.ness.su)
Project description
QRCodeAPI
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
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
qrcodeapi-0.0.1.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for qrcodeapi-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e317331edeeca921e29fee3822c66e593bef3fc017d34e32a2e1fcbbdd43e12d |
|
MD5 | af6057c06701f813037a8f9796b6a342 |
|
BLAKE2b-256 | 04d4f36a380e434b882ae9d054d755fa81071360cf6cbed08a7c99ed3361d26a |