https://github.com/vncsmyrnk/python-cups-example
An example of a web server with a cups integration for printing files
https://github.com/vncsmyrnk/python-cups-example
cups flask python
Last synced: about 1 month ago
JSON representation
An example of a web server with a cups integration for printing files
- Host: GitHub
- URL: https://github.com/vncsmyrnk/python-cups-example
- Owner: vncsmyrnk
- License: gpl-3.0
- Created: 2024-05-27T18:09:25.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-27T22:13:59.000Z (about 2 years ago)
- Last Synced: 2025-02-14T22:44:04.614Z (over 1 year ago)
- Topics: cups, flask, python
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Python Cups Example
This example uses flask and pycups for creating a web server that prints files.
## Run with Docker
```bash
docker build -t example-cups-api
docker run --rm -it -p 5000:5000 example-cups-api
```
## Examples
```bash
curl -X GET localhost:5000/printers-info
```
```json
{
"hp-casa":{
"device-uri":"ipp://192.168.X.Y/ipp/print",
"printer-info":"hp-casa",
"printer-is-shared":true,
"printer-location":"",
"printer-make-and-model":"HP LaserJet Professional - IPP Everywhere",
"printer-state":3,
"printer-state-message":"",
"printer-state-reasons":[
"cups-ipp-conformance-failure-report",
"cups-ipp-missing-send-document"
],
"printer-type":4100,
"printer-uri-supported":"ipp://localhost/printers/hp-casa"
}
}
```
---
```bash
curl -X GET 192.168.100.7:5000/print-file
```
Output:
```json
{
"job_id":2
}
```