This project provides functionality to create barcode tags for products.
The Tag Creator project allows users to generate barcode images for products. It includes endpoints to create tags and handles the generation of barcode images using the Code128 format.
- Create Tag: Endpoint
/create_tag
to create a barcode tag for a product. - Barcode Generation: Barcode images are generated using the Code128 format.
-
Clone the repository:
git clone <repository_url>
-
Install dependencies:
pip install -r requirements.txt
-
Set up the environment:
# Assuming you're using virtualenv source <virtualenv_name>/bin/activate
-
Run the application:
python app.py
- Send a POST request to
/create_tag
with the product details in the request body. - The application will generate a barcode image for the product and return the path to the image.
- Create Tag:
- URL:
/create_tag
- Method:
POST
- Request Body: JSON with product details.
- Response: JSON with the path to the generated barcode image.
- URL:
{
"product_code": "123456789"
}
{
"data": {
"type": "Tag Image",
"count": 1,
"path": "/path/to/barcode.png"
}
}
- HTTP 422 Unprocessable Entity: If there are validation errors or invalid requests, the API returns an error response with details.
- HTTP 500 Server Error: For unexpected errors, the API returns a generic server error response.
- Python
- Flask
- Barcode (Python library)
This project is licensed under the MIT License - see the LICENSE file for details.