# QRCodeAPI
[![PyPI](https://img.shields.io/pypi/v/qrcodeapi.svg)](https://pypi.python.org/pypi/qrcodeapi)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Python Version](https://img.shields.io/badge/Python-3.7%2B-blue)](https://www.python.org/downloads/release)
QRCodeAPI is a Python library designed to seamlessly interact with the QR code generation API
from [qrcode.ness.su](https://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
```bash
pip install qrcodeapi
```
## Usage
```python
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](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/nessshon/qrcode-fastapi/tree/main/pypi",
"name": "qrcodeapi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7, <3.12",
"maintainer_email": "",
"keywords": "",
"author": "nessshon",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/40/76/bb88c8ec3c5ecaa4d404667807648f45319618f4176524161dd9905391f4/qrcodeapi-0.0.1.tar.gz",
"platform": null,
"description": "# QRCodeAPI\n\n[![PyPI](https://img.shields.io/pypi/v/qrcodeapi.svg)](https://pypi.python.org/pypi/qrcodeapi)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Python Version](https://img.shields.io/badge/Python-3.7%2B-blue)](https://www.python.org/downloads/release)\n\nQRCodeAPI is a Python library designed to seamlessly interact with the QR code generation API\nfrom [qrcode.ness.su](https://qrcode.ness.su). Leveraging FastAPI and aiohttp, it provides a convenient and asynchronous\nexperience for generating QR codes.\n\n## Features\n\n* **Simplicity**: Generate QR codes with a simple and intuitive interface.\n* **Customization**: Fine-tune QR code parameters, including data encoding, border size, box size, and optional image\n inclusion.\n\n## Installation\n\n```bash\npip install qrcodeapi\n```\n\n## Usage\n\n```python\nimport asyncio\nfrom qrcodeapi import QRCodeAPI\n\n\nasync def main():\n # Create an instance of QRCodeAPI\n qrcode_api = QRCodeAPI()\n\n # Example: Generate a basic QR code and save it to a file\n data = \"Hello, QR Code!\"\n filename = \"qrcode.png\"\n qr_code_image = await qrcode_api.create(data)\n with open(filename, \"wb\") as f:\n f.write(qr_code_image)\n\n # Example: Generate a QR code with an image and save it to a file\n data_with_image = \"Example Data\"\n image_url = \"https://example.com/logo.png\"\n filename_with_image = \"qrcode_with_image.png\"\n qr_code_image_with_image = await qrcode_api.create(\n data_with_image,\n border=5,\n box_size=40,\n image_url=image_url,\n image_round=20,\n image_padding=5,\n )\n with open(filename_with_image, \"wb\") as f:\n f.write(qr_code_image_with_image)\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n```\n\n## Licensing\n\nQRCodeAPI is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": "",
"summary": "A Python library for interacting with a QR code generation API (https://qrcode.ness.su)",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/nessshon/qrcode-fastapi/tree/main/pypi"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "04d4f36a380e434b882ae9d054d755fa81071360cf6cbed08a7c99ed3361d26a",
"md5": "af6057c06701f813037a8f9796b6a342",
"sha256": "e317331edeeca921e29fee3822c66e593bef3fc017d34e32a2e1fcbbdd43e12d"
},
"downloads": -1,
"filename": "qrcodeapi-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "af6057c06701f813037a8f9796b6a342",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7, <3.12",
"size": 4227,
"upload_time": "2023-11-17T20:47:48",
"upload_time_iso_8601": "2023-11-17T20:47:48.188048Z",
"url": "https://files.pythonhosted.org/packages/04/d4/f36a380e434b882ae9d054d755fa81071360cf6cbed08a7c99ed3361d26a/qrcodeapi-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4076bb88c8ec3c5ecaa4d404667807648f45319618f4176524161dd9905391f4",
"md5": "36e9908b05d3bb72ea036e0a725e68dd",
"sha256": "b59644a73d644574f16030803bb266adf122bc2d4f43ac044233398319d0e62b"
},
"downloads": -1,
"filename": "qrcodeapi-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "36e9908b05d3bb72ea036e0a725e68dd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7, <3.12",
"size": 3833,
"upload_time": "2023-11-17T20:47:50",
"upload_time_iso_8601": "2023-11-17T20:47:50.013658Z",
"url": "https://files.pythonhosted.org/packages/40/76/bb88c8ec3c5ecaa4d404667807648f45319618f4176524161dd9905391f4/qrcodeapi-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-17 20:47:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nessshon",
"github_project": "qrcode-fastapi",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "aiohttp",
"specs": [
[
"==",
"3.8.6"
]
]
},
{
"name": "cachetools",
"specs": [
[
"==",
"5.3.2"
]
]
},
{
"name": "fastapi",
"specs": [
[
"==",
"0.104.1"
]
]
},
{
"name": "lxml",
"specs": [
[
"==",
"4.9.3"
]
]
},
{
"name": "pillow",
"specs": [
[
"==",
"10.1.0"
]
]
},
{
"name": "qrcode-styled",
"specs": [
[
"==",
"0.2.2"
]
]
},
{
"name": "starlette",
"specs": [
[
"==",
"0.27.0"
]
]
},
{
"name": "uvicorn",
"specs": [
[
"==",
"0.24.0"
]
]
}
],
"lcname": "qrcodeapi"
}