Giter Club home page Giter Club logo

qrcode-fastapi's Introduction

QR Code Generator API

Overview

FastAPI-based API for generating QR codes with optional image inclusion. It supports both base64-encoded data and plain text. The API is designed to be fast, efficient, and easy to use, making it suitable for a variety of applications.

Features

  • Generate QR codes with optional image inclusion.
  • Support for both base64-encoded data and plain text.
  • Dockerized for easy deployment.
  • Asynchronous HTTP requests with aiohttp.
  • Utilizes caching for improved performance.

Live API Site

Access the QR Code API live at qrcode.ness.su.

Requirements

Ensure you have the following dependencies installed:

Installation

  1. Clone the repository:

    git clone https://github.com/nessshon/qrcode-fastapi.git
  2. Change into the project directory:

    cd qrcode-fastapi
  3. Build the Docker image:

    docker build -t qrcode-fastapi .
  4. Run the Docker container:

    docker run -p 8000:8000 qrcode-fastapi
  5. Access the API at http://localhost:8000

Usage

Endpoint: /create

  • Method: GET
  • Parameters:
    • data: Data or base64 encoded data to be encoded in QR code.
    • image_url: URL or base64 encoded URL of the image to be included in the QR code (optional).
    • border: QR code border size (0 to 50).
    • box_size: QR code box size (20 to 100).
  • Response: Generated QR code image in PNG format.

Example Generated QR Code Images

Here are some example QR code images generated using the Ness API. Feel free to scan these codes or use the provided URLs to see the results.

Text Only and Base64-Encoded Text

Image URL and Base64-Encoded Image URL

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This project utilizes the following dependencies:

  • aiohttp - Asynchronous HTTP client/server framework.
  • cachetools - Extensible memoizing collections and decorators.
  • fastapi - Modern, fast (high-performance), web framework for building APIs with Python 3.7+.
  • lxml - XML and HTML processing library.
  • pillow - The Python Imaging Library adds image processing capabilities to your Python interpreter.
  • qrcode-styled - A QR Code generator with styles.
  • starlette - ASGI framework/toolkit for building high-performance asyncio services.
  • uvicorn - ASGI server implementation, using uvloop and httptools.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.