Skip to content

milliytech/printer-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Printer Service πŸ–¨οΈ

Python Version License Build Status

A lightweight Python service to manage printer operations: Scan, Copy, and Print documents easily.


πŸš€ Features

  • Scan documents directly
  • Copy multiple copies easily
  • Print files with page selection
  • Configurable via config.json
  • Detailed logging for debugging

πŸ“‹ Requirements

  • Python 3.12+
  • Windows OS (with printer properly installed and accessible)
  • A config.json file with your printer configuration

βš™οΈ Installation

Clone the repository:

git clone https://github.com/JahongirHakimjonov/printer-service.git
cd printer-service

Install dependencies:

pip install -r requirements.txt

πŸ› οΈ Configuration

Create a config.json file in the project root:

{
  "printer_name": "Canon iR2006/2206 UFRII LT"
}

Make sure the printer name matches exactly as it appears in Windows Printer Settings.


πŸƒ Usage

Run the service:

python main.py

You will be prompted to select an operation:

Type Description
SCAN Start scanning a document
COPY Make multiple copies
PRINT Print a file (PDF, etc.)

Example flow:

$ python main.py
Type input (SCAN, COPY, PRINT): PRINT
How many pages to print?: 1-3
Enter the file path: D:\files\example.pdf

πŸ”₯ Advanced Usage

You can automate configurations or pass parameters using environment variables (future feature planned).

Planned CLI support:

python main.py --type PRINT --file_path "D:\docs\test.pdf" --pages "1-2"

For more information use this command:

python main.py --help

(Not available yet β€” currently interactive mode only.)


πŸ“‚ Project Structure

β”œβ”€β”€ config/                # Configuration files (e.g., config.json)
β”œβ”€β”€ resources/
β”‚   └── output/            # Scanned/copied/printed file outputs
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ controller/        # Handles user inputs and flow control
β”‚   β”œβ”€β”€ exceptions/        # Custom exception classes
β”‚   β”œβ”€β”€ services/          # Core printer services
β”‚   β”‚   β”œβ”€β”€ copy/          # Copy service logic
β”‚   β”‚   β”œβ”€β”€ print_file/    # Print service logic
β”‚   β”‚   └── scan/          # Scan service logic
β”‚   β”œβ”€β”€ utils/             # Utilities (logger, enums, etc.)
β”‚   └── __pycache__/       # Python cache files (ignored)
β”œβ”€β”€ main.py                # Application entry point
β”œβ”€β”€ requirements.txt       # Python dependencies
└── README.md              # Project documentation

⚑ Error Handling

  • Invalid operation type β†’ error logged, program exits.
  • Missing file or incorrect printer β†’ critical error logged.
  • Bad config format β†’ immediate crash with readable error.

πŸ‘¨β€πŸ’» Author

Jahongir Hakimjonov β€” Backend Developer

Contact

Please contact Jahongir Hakimjonov with any questions or concerns regarding this project.

Donate

pypi

πŸ“„ License

This project is licensed under the MIT License.


βœ… Summary of Improvements

  • Added badges (Python version, License, Build Status)
  • Added Features section
  • Cleaned Usage into a table
  • Advanced Usage preview (for future CLI expansion)
  • Clear Error Handling expectations
  • Project Structure tree
  • Professional formatting β€” easy to scan

About

πŸ”΅Python-based service to scan, copy, and print documents with configurable printer settings.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Languages