pycups
This page is about the Python bindings for the CUPS API, known as pycups. It was written for use with system-config-printer, but can be put to other uses as well.
Download
Download tarball releases from:
http://cyberelk.net/tim/data/pycups/
Source Code
Fetch the source like this:
git clone git://git.fedorahosted.org/git/pycups.git
or browse it using gitweb.
New releases are announced at freshmeat.
Bug Reporting
Report bugs using the trac interface.
Discussion
There is no mailing list as such, but if you use Mugshot there is a Fedora Printing group you can join.

May 18th, 2007 at 11:11 am
[...] just heard that pycups is now included in Debian unstable as python-cups. Thanks to Otavio Salvador for packaging and [...]
June 21st, 2007 at 11:45 am
Hey Tim,
trying to use pycups on RHEL5 but can’t even get it to build. I get the following;
[root@gbwtecsuv1008 pycups-1.9.24]# python setup.py install
running install
running build
running build_ext
building ‘cups’ extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.4 -c cupsmodule.c -o build/temp.linux-i686-2.4/cupsmodule.o
cupsmodule.c: In function ‘cups_require’:
cupsmodule.c:242: error: ‘VERSION’ undeclared (first use in this function)
cupsmodule.c:242: error: (Each undeclared identifier is reported only once
cupsmodule.c:242: error: for each function it appears in.)
cupsmodule.c:272: error: expected ‘)’ before ‘VERSION’
error: command ‘gcc’ failed with exit status 1
Any hints?
Also, in the setup the package is referred to as “cups” rather than “pycups” which will result in an RPM being produced called cups-1.0 which isn’t what you want (I assume).
TIA
Cheers
Dan
June 25th, 2007 at 10:56 am
Dan: run ‘make’ to build pycups — the VERSION macro comes from the environment set up by the Makefile.
For packaging, I use ‘cups’ for the name because I want to import the extension with ‘import cups’.
September 5th, 2007 at 4:18 pm
[...] about to start writing some proper API documentation for pycups, and I’ve been looking around for short-cuts. Seems like epydoc is just what I’m after, [...]
April 28th, 2008 at 12:52 pm
Now at OpenBSD:
http://www.openbsd.org/cgi-bin/cvsweb/ports/print/py-cups/
May 10th, 2008 at 4:46 pm
Now in mandriva too :
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/python-cups/
August 18th, 2008 at 4:40 am
Is there any example code for pycups / python-cups?
August 18th, 2008 at 9:22 am
Yes, it is used extensively by system-config-printer, in particular the cupshelpers.py file.
There is also documentation for it included in the pycups source tarball: try ‘make doc’.