A Python client and CLI for the PaperCut printing service (FollowMe).
This project uses uv for dependency management.
- Clone the repository.
- Install dependencies:
uv sync
Create a .env file in the root directory with your credentials:
IMPRIMERIE_USER=your_username
IMPRIMERIE_PASS=your_passwordYou can use the tool via the Command Line Interface (CLI) or as a Python library.
Run commands using uv run:
Check Login:
uv run main.py loginList Web Print Printers (Check for Color):
uv run main.py list-webprint
# Output example:
# [0] Black & White
# [1] ColorUpload a File:
# Default (usually Black & White)
uv run main.py upload my_document.pdf --copies 2
# Select specific printer (e.g., Color) using index from list-webprint
uv run main.py upload my_document.pdf --printer-index 1List Pending Jobs:
uv run main.py jobsList Physical Printers (Release Stations): Note: This command requires at least one pending job to work.
uv run main.py list-printersRelease a Job:
uv run main.py release --job-name "my_document.pdf"
# Optionally specify a printer filter
uv run main.py release --job-name "my_document.pdf" --printer "MFP"Automated Flow (Upload & Release):
uv run main.py auto my_document.pdf --printer-index 0You can import TSPrintClient in your own scripts:
from tsprint.client import TSPrintClient
from tsprint.exceptions import TSPrintError
client = TSPrintClient("username", "password")
try:
client.login()
# List available printers
printers = client.get_webprint_printers()
print(printers)
# Upload to specific printer (index 1 = Color, usually)
client.upload_file("test.pdf", printer_index=1)
jobs = client.get_pending_jobs()
print(jobs)
except TSPrintError as e:
print(f"An error occurred: {e}")- Session Management: Automatically handles cookies and JSESSIONID.
- Web Print: Helper for uploading PDFs with printer selection (Color/B&W).
- Physical Printers: List actual machines available for releasing jobs (requires pending job).
- Job Release: Check pending jobs and release them to available printers.
- Error Handling: Custom exceptions for clear debugging.