Skip to main content

Inbox4us POS printer service

Project description

Inbox4us POS Printer Service

A FastAPI-based service for handling ESC/POS printer operations. This service allows you to send base64-encoded images to network printers using the ESC/POS protocol.

Features

  • Send images to network printers
  • Support for ESC/POS protocol
  • Simple REST API interface
  • CORS support
  • SSL/TLS support

Installation

Install using pip:

pip install inbox4us-pos-printer

Usage

Basic Usage

from pos_printer import create_app
import uvicorn

app = create_app()

if __name__ == '__main__':
    uvicorn.run(
        app, 
        host='0.0.0.0', 
        port=8100
    )

With SSL

from pos_printer import create_app
import uvicorn

app = create_app()

if __name__ == '__main__':
    uvicorn.run(
        app, 
        host='0.0.0.0', 
        port=8100, 
        ssl_certfile="./ssl/certificate.crt",
        ssl_keyfile="./ssl/private.key",
        ssl_ca_certs="./ssl/ca_bundle.crt" 
    )

API Documentation

POST /print

Send an image to a network printer.

Request Body

{
    "printer_ip": "192.168.1.100",
    "port": 9100,
    "data": "base64_encoded_image_data"
}

Parameters

  • printer_ip (string, required): IP address of the network printer
  • port (integer, optional, default: 9100): Printer port
  • data (string, required): Base64 encoded image data

Response

Success:

{
    "status": "success"
}

Error:

{
    "status": "error",
    "message": "Error message details"
}

Requirements

  • Python >= 3.8
  • FastAPI >= 0.68.0
  • python-escpos >= 3.0
  • Pillow >= 8.0.0
  • pydantic >= 1.8.0

License

MIT License

Support

For support, please create an issue on the GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inbox4us_pos_printer-0.1.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inbox4us_pos_printer-0.1.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file inbox4us_pos_printer-0.1.3.tar.gz.

File metadata

  • Download URL: inbox4us_pos_printer-0.1.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for inbox4us_pos_printer-0.1.3.tar.gz
Algorithm Hash digest
SHA256 69bd39ec759c5569b502469bacef3be37906d56eab8ecf1422f6f8f4ee0600bb
MD5 4caf4d3e2b3a6cbd5741f4136b3b58e6
BLAKE2b-256 50355aad4acdb3527387cd4d4b011fe5be128376bd21fd5c7e45861eed1848a8

See more details on using hashes here.

File details

Details for the file inbox4us_pos_printer-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for inbox4us_pos_printer-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3684e59e68bba26a79c0ad00c8b4db727e0e549dce92fc2d4f30ad247607b46e
MD5 52f0db0445c3f2058d1035e1a3d05f3d
BLAKE2b-256 2099a3723c0375ddea72d90ec2b033649c9c76defe6c0317c064f778ebab98ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page