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 printerport(integer, optional, default: 9100): Printer portdata(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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inbox4us_pos_printer-0.1.4.tar.gz.
File metadata
- Download URL: inbox4us_pos_printer-0.1.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
187a835190eaa6d4ab6547b00c23e068631c8a1084ad3f1eea85ff4050ed8b3e
|
|
| MD5 |
9b71f3b7fa3be3ddf765ca88dccebe37
|
|
| BLAKE2b-256 |
cf057b8f62de16c2a5c4e39f6e293635bbbf1de6ce1559c491c74795e2c2093c
|
File details
Details for the file inbox4us_pos_printer-0.1.4-py3-none-any.whl.
File metadata
- Download URL: inbox4us_pos_printer-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d64a986d139ee71dfe465e97a6001896c82540b6eac95dcf47d103e7cc2100d
|
|
| MD5 |
0bd65d7087c0d106bfffea6ea1ccceae
|
|
| BLAKE2b-256 |
6a4f175915a4991da6cc935affbf7482a9e1b9e76277ace71acfcaf283d85824
|