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 details)
Built Distribution
File details
Details for the file qrcodeapi-0.0.1.tar.gz
.
File metadata
- Download URL: qrcodeapi-0.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b59644a73d644574f16030803bb266adf122bc2d4f43ac044233398319d0e62b |
|
MD5 | 36e9908b05d3bb72ea036e0a725e68dd |
|
BLAKE2b-256 | 4076bb88c8ec3c5ecaa4d404667807648f45319618f4176524161dd9905391f4 |
File details
Details for the file qrcodeapi-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: qrcodeapi-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e317331edeeca921e29fee3822c66e593bef3fc017d34e32a2e1fcbbdd43e12d |
|
MD5 | af6057c06701f813037a8f9796b6a342 |
|
BLAKE2b-256 | 04d4f36a380e434b882ae9d054d755fa81071360cf6cbed08a7c99ed3361d26a |