Back to GSoC 2025
GSoC 2025

Port pyCUPS to CUPS 3.x API + apply the new pyCUPS to system-config-printer

Work Summary

Ported pyCUPS to the CUPS 3.x API and implemented it in system-config-printer, creating safe Python bindings with method overloading via functools singledispatch and C structure representations.

Callahan, without your continuous support, I could've never been able to complete this project. All those brainstorming sessions, all those Eureka moments, all those jokes on hilarious APIs during the weekly calls, I'll surely miss them.

Soumyadeep Ghosh

2 minute read

Introduction

1 contributor full-size (350 hours), Level of difficulty: Intermediate

Most software with print functionality or print administration functionality uses the CUPS library (libcups, 2.x, 3.x) to communicate with CUPS. This is easy when the software is written in C or C++ as the library is written in C.

If the software is written in other languages, we need some connection between the library and the client code, the so-called bindings. For Python we have bindings for libcups, pyCUPS. This works well with libcups 2.x already for years. system-config-printer is principal user of pyCUPS.

What we need now is to extend pyCUPS for the use with libcups 3.x of the new CUPS 3.x, so that pyCUPS will live on and continue to allow writing software which interacts with CUPS in Python.

The contributor's task is to go through the APIs of libcups3 and compare them with libcups2 to see what has to be added. If there is a way to automate the creation of Python bindings, it can be used and old (libcups2) and new (libcups3) has to be merged, so that pyCUPS can be used for any version of libcups.

It should be also taken into account that libcups2 of CUPS 2.5.x got some functions of libcups3 backported.

system-config-printer was already updated for CUPS 3.x in last year's GSoC. Here we want system-config-printer use the new pyCUPS now, for optimization and minimization of code duplication.

Mentors

Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Zdenek Dohnal, Printing Maintainer at Red Hat (zdohnal at redhat dot com), TBD

Desired knowledge

Python, C, CUPS

Code License

GPL-2+ (GPL 2 or any later version)