NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2607 most downloaded on PyPI
Python interface for cairo
Last release today
04 Oct 2026
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 45 of 46 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
46 releases · first in 2017
Nothing published for this version
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-29-1
Update dependencies (libpng, zlib) for the Windows wheels 442
Fix documentation build with Python 3.15 441
Build wheels for Python 3.15 (except for 32bit Windows) 444
Fix a memory leak in ScaledFont.text_to_glyphs 446
Fix some minor reference leaks 447
One column per quarter.
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-29-0
ImageSurface.get_data: Return empty memoryview for empty image 418
ImageSurface.create_for_data: support empty images 419
Drop support for Python 3.9 428
Drop support for PyPy 3.10
Support multi-phase init 413
Experimental support for free-threaded Python 430 429
Update dependencies (libpng, pixman) for the Windows wheels 431
build: add "no-x11" option to disable X11 surface support 432 420
dev: support uv for development 433
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-28-0
Remove hypothesis test dependency 398
Updated cairo in Windows wheels from 1.18.2 to 1.18.4 393
Provide arm64 Windows wheels again
Release the input buffer passed to ImageSurface.create_for_data when calling Surface.finish already, not just when the underlying surface is destroyed 405 392
Return a PathDataType (int subtype) instead of int with Path.__iter__ 410. This was missed in the 1.13.0 enum change.
Emit a DeprecationWarning in case ImageSurface.get_data is called on an already finished surface 400 412. In a future version this will raise an exception instead.
Emit a DeprecationWarning for the undocumented num_glyphs parameter in Context.glyph_extents, Context.glyph_path, Context.show_glyphs, ScaledFont.glyph_extents 409
Remove the executable bit from cairo/__init__.py 383
Remove usage of removed typing.ByteString to fix compatibility with Python 3.14.0a1 389
docs: Fix pygame integration example using the wrong format 411
Include os.PathLike for parameters accepting file paths 401
For ImageSurface.create_for_data include all writable buffer types and not just memoryview 402
Add missing Optional for Surface.set_mime_data, SVGSurface.__init__ PDFSurface.__init__, PSSurface.__init__, RecordingSurface.__init__ 404
Add various missing Path dunder methods like __iter__, __eq__, __lt__, etc. 408
Add missing __getitem__ and __mul__ for Matrix 408
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-27-0
This release only contains build related changes/fixes and no API changes.
Drop support for Python 3.8
Add Windows wheels for Python 3.13
Updated cairo in Windows wheels from 1.18.0 to 1.18.2
Port PEP517/wheel build from setuptools to meson-python. This means setup.py is gone. System packagers should not switch to wheel builds and continue using meson directly.
meson: install the package metadata to .dist-info/METADATA instead of .egg-info
Drop arm64 Windows wheels again. pypa/cibuildwheel does not support cross compiling with meson-python. They might be added back in the future if GitHub Actions gains a native Windows runner with arm64 support.
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-26-1
Fix Surface.set_mime_data() with Python 3.13 366 This also fixes the test suite with Python 3.13b2.
Update vendored Windows wheel dependencies 370
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-26-0
This release only contains build related changes/fixes and no API changes.
Bump minimum required meson version from 0.56.0 to 0.64.0 346
Various meson related cleanups 350
Fix header file being installed to the wrong location with meson on some systems 350
Adds a new wheel meson build option as preparation for meson-python support 350 345
Update dependencies (libpng, pixman, zlib) of the Windows wheels 358
Various maintenance related updates 360 359 361 362
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-25-1
Fix a crash with pypy3.10 344
Fix the build with CPython 3.13.0a1 343
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-25-0
Update to cairo 1.18.0 for the Windows wheel
Provide a Windows arm64 wheel
New APIs:
Status.SVG_FONT_ERROR 334
FontOptions.get_color_mode, FontOptions.set_color_mode, ColorMode 336
FontOptions.set_color_palette, FontOptions.get_color_palette, COLOR_PALETTE_DEFAULT 338
FontOptions.set_custom_palette_color, FontOptions.get_custom_palette_color 339
TAG_CONTENT, TAG_CONTENT_REF 340
Pattern.get_dither, Pattern.set_dither, Dither 341
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-24-0
Dropped Python 3.7 support
Bumped meson version requirement from 0.53.0 to 0.56.0
Various cairo dependency updates for the Windows wheel build
examples: update to GTK4 307
examples: add a clip_image example 316
docs: fix the build with Sphinx 6 318
Various code cleanups 306
Added Python 3.12 Windows wheels
https://pycairo.readthedocs.io/en/latest/changelog.html#v1-23-0
Reminder to distro packagers: Building/installing pycairo using setup.py is deprecated, please use meson instead.
git: changed default branch from "master" to "main"
Windows: Update the cairo version included in the wheels from 1.17.2 to 1.17.6 243
docs: Document how to look up pycairo headers without loading the module 300
tests: don't error out if cairo wasn't built with all features 293
New APIs:
Status.DWRITE_ERROR 294
Format.RGB96F, Format.RGBA128F 295
PDFVersion.VERSION_1_6, PDFVersion.VERSION_1_7 296
HAS_DWRITE_FONT 297
Context.set_hairline, Context.get_hairline 298
PDFSurface.set_custom_metadata 299
Officially support Python 3.11 285
Officially support Python 3.11 285
PDFSurface.version_to_string(): Fix crash with negative versions 279
typing: ImageSurface.get_stride() returns an int 282
typing: Fix incorrect interface for Matrix constructor 271
typing: Use Generic for Context 274
docs: some cairo.Context fixes 276
docs: try to make create_from_png/write_to_png more clear 261
docs: add an example for how to convert a surface to pillow 281
docs: cairo.Format.RGB24: document that unused bytes may be overwritten 289
tests: don't depend on specific ref counts 291
tests: compatibility fixes for cairo 1.17.6 264
Using setup.py directly to build/install pycairo is deprecated. Use meson instead.
Require Python 3.7+ 250
Require meson 0.53+
Using setup.py directly to build/install pycairo is deprecated. Use meson instead.
setup.py now requires setuptools. Previously it was optional.
The complete API reference is now included in the typing stubs, so it can be consumed/shown by IDEs. 236 252
setup.py: Respect the PKG_CONFIG environment variable 235
Use poetry for development 232
setup.py: Respect the PKG_CONFIG environment variable 235
Make import_cairo inline in addition to static 224
docs: Fix example in Pattern.set_filter() docs 221
docs: Fix build with newer sphinx 222
docs: Fix NumPy width, height-conventions in examples 231
docs: Last parameter of rel_curve_to should be dy3, not dy4 230
mypy: Fixes for mypy 0.800+ 233
mypy: Don't run mypy via pytest 234
meson: add 'tests' option to skip tests 188
Require Python 3.6+ 201
Require cairo 1.15.10+ 204
docs: support Sphinx 3.0 207
meson: add 'tests' option to skip tests 188
Windows: build wheels 197
Add support for Python 3.9 and 3.10 198 202
examples: add a Jupyter Notebook example 181
Raise an error early when being passed a file object not opened in binary mode 205
Add a pyproject.toml file 206
docs: Add moderngl in the integration section. 174 (Einar Forselv )
docs: Add moderngl in the integration section. 174 (Einar Forselv)
Support os.PathLike with PyPy3 >= 7.3.0
Python 2 is no longer supported 172
Python 2 is no longer supported 172
Add machine-readable license statement 158 (Maxim Ivanov)
travis-ci: Manually set sysroot so correct SDK is used (Stuart Axon)
Support Python 3.8 on Windows (because of DLL lookup changes)
Fix wrong type for set_dash() offset parameter in the docs/types.
Fix a minor compatibility issue with Python 3.8 (fixes the test suite)
Fix a minor compatibility issue with Python 3.8 (fixes the test suite)
meson: install .egg-info to platlib
meson: install .egg-info to platlib
meson: fix configure error with meson 0.50 re absolute paths 145
PyPy: don't use PyOS_FSPath() with PyPy3.6, it's missing: https://github.com/pypy/pypy/issues/2961
Docs fixes 134 (Matteo Italia)
meson build requires meson >=0.47 (was >=0.46)
Dropped Python 3.3 support
meson build requires meson >=0.47 (was >=0.46)
Fix various build warnings with GCC8
meson: Don't link against libpython on non-Windows systems 120
meson: Improve support for Visual Studio builds 121 (Chun-wei Fan)
setup.py: Support specifying custom --pkgconfigdir 127 (Michał Górny)
docs: Remove a broken link 124 (Nik Nyby)
typing: Add missing annotations for __enter__/__exit__ 126
Some are only available when building with newer cairo versions, see the linked API docs for details.
CAIRO_VERSION, CAIRO_VERSION_STRING, CAIRO_VERSION_MAJOR, CAIRO_VERSION_MINOR, CAIRO_VERSION_MICRO
Status.TAG_ERROR, Status.FREETYPE_ERROR, Status.PNG_ERROR, Status.WIN32_GDI_ERROR
SVGUnit, PDFMetadata, PDFOutlineFlags
FontOptions.set_variations, FontOptions.get_variations
Context.tag_begin, Context.tag_end, TAG_DEST, TAG_LINK
PDFSurface.set_page_label, PDFSurface.set_metadata, PDFSurface.set_thumbnail_size, PDFSurface.add_outline, PDF_OUTLINE_ROOT
SVGSurface.set_document_unit, SVGSurface.get_document_unit
MIME_TYPE_CCITT_FAX, MIME_TYPE_CCITT_FAX_PARAMS, MIME_TYPE_EPS, MIME_TYPE_EPS_PARAMS, MIME_TYPE_JBIG2, MIME_TYPE_JBIG2_GLOBAL, MIME_TYPE_JBIG2_GLOBAL_ID
* Meson __ support (>=0.46). 114 .. _v1.17.0:
Meson support (>=0.46). 114
cairo.Surface and cairo.Device can now be used as context managers. 103
cairo.Surface and cairo.Device can now be used as context managers. 103
Fix a leak when a cairo error was raised.
Fix a leak when a mapped surface was GCed instead of unmapped.
Make it possible to use the C API with Python 3 outside of the compilation unit doing the import by defining PYCAIRO_NO_IMPORT. 110
Implement PEP 561 (added a py.typed marker)
Ship Python type annotation stubs. They are currently supported by mypy and PyCharm. 99 101
Ship Python type annotation stubs. They are currently supported by mypy and PyCharm. 99 101
setup.py: Some fixes for Debian pybuild quirks. 98
setup.py: Some fixes for Debian pybuild quirks. 98
setup.py: correctly install pkgconfig into /usr/lib* again. To make JHBuild on Fedora work the following patch is needed: https://bugzilla.gnome.org/s
setup.py: correctly install pkgconfig into /usr/lib* again. To make JHBuild on Fedora work the following patch is needed: https://bugzilla.gnome.org/show_bug.cgi?id=793216
Add a get_include function which returns the compiler include path needed for interfacing with the Pycairo C API 92
Add a get_include function which returns the compiler include path needed for interfacing with the Pycairo C API 92
Note for packagers: The default header installation path has changed, but a compat header is installed to the old location to prevent breakage in case anyone has hardcoded the old path instead of using pkg-config. Just in case anyone is wondering why there are two header files now.
Experimental PyPy and PyPy3 support 90
Experimental PyPy and PyPy3 support 90
Support Unicode paths under Windows with cairo 1.15.10+ 87
Support Unicode paths under Windows with cairo 1.15.10+ 87
Don't include the pkg-config file when building a wheel 83
Fix some enum conversation errors with (unused) large and negative values. 81
Fix some enum conversation errors with (unused) large and negative values. 81
Fix a rare test error 80 (Sergei Trofimovich)
setup.py: Install pkgconfig file into /usr/share/pkgconfig to work around JHBuild on Fedora not picking it up.
setup.py: Install pkgconfig file into /usr/share/pkgconfig to work around JHBuild on Fedora not picking it up.
Fix tests on big endian machines. 75
Support building with MSVC 72 (Chun-wei Fan)
Test MSVC builds on appveyor
setup.py: Install pkgconfig file to the same library prefix that Python uses. (/usr/lib64 instead of /usr/lib under Fedora for example) 70 71 (Sander
setup.py: Install pkgconfig file to the same library prefix that Python uses. (/usr/lib64 instead of /usr/lib under Fedora for example) 70 71 (Sander Sweers)
Improved support for Python filesystem paths including os.PathLike. See _PathLike for details.
Improved support for Python filesystem paths including os.PathLike. See _PathLike for details.
Various minor fixes
Expose cairo.Path
Improved test coverage from ~70% to ~90%
Add Surface.map_to_image and Surface.unmap_image 51
Add Surface.map_to_image and Surface.unmap_image 51
Add RasterSourcePattern 48
Add Glyph 53
Add Rectangle 54
Add TextCluster 61
Add ScaledFont.text_to_glyphs and ScaledFont.glyph_extents
Add Context.show_text_glyphs
Add TextExtents 62
Pycairo instances wrapping the same underlying cairo object now hash and compare equally e.g. context.get_target() == context.get_target()
Functions which returned a cairo error with Status.NO_MEMORY no longer raise python3:MemoryError, but a subclass of Error and python3:MemoryError. Similarly errors with Status.READ_ERROR and Status.WRITE_ERROR no longer raise python3:IOError, but a subclass of Error and python3:IOError. 55
Some functions which previously returned a tuple now return a tuple subclass like Rectangle, Glyph, TextCluster and TextExtents
Fix a crash with Surface.get_device 57
Fix a crash with Surface.get_device 57
Requires at least cairo 1.13.1 (The snapshop in Ubuntu 14.04)
Requires at least cairo 1.13.1 (The snapshop in Ubuntu 14.04)
Optional Hypothesis tests.
Add Surface.set_device_scale and Surface.get_device_scale. 44 (Sander Sweers)
Add Device 45
Add Surface.get_device 45
Add ScriptDevice and ScriptMode 46
Add ScriptSurface 17
Add Status.JBIG2_GLOBAL_MISSING
Add Format.stride_for_width
Add TextClusterFlags and SurfaceObserverMode
Add Gradient.get_color_stops_rgba
Add TeeSurface
Add MeshPattern
Fix a rare crash with get_data() under Python 3 (1.13.3 regression).
Fix a rare crash with get_data() under Python 3 (1.13.3 regression).
Fix ImageSurface leaking in case get_data() is used under Python 3. 41
Fix ImageSurface leaking in case get_data() is used under Python 3. 41
Add Pillow to ImageSurface example. 40 (Stuart Axon)
Describe Freetype-py intergration. 25 43 (Hin-Tak Leung)
Fix pip failing to install pycairo in some cases. 39
Fix pip failing to install pycairo in some cases. 39
Added continuous testing for Windows using MSYS2 and appveyor. 19
setup.py install: Fix generated pkg-config file if --home or --user is specified. 34
setup.py install: Fix generated pkg-config file if --home or --user is specified. 34
Fix a build error on macOS Sierra. 36 (Nicolas P. Rougier)
examples: Fix snippet examples when .pyc files are present. 35
Add Pyglet integration example. 33 (Stuart Axon)
The buffer returned by ImageSurface.get_data under Python 2 now implements the character buffer interface to make it work with pygame.image.frombuffer
The buffer returned by ImageSurface.get_data under Python 2 now implements the character buffer interface to make it work with pygame.image.frombuffer(). 29
All C enum types now have their own corresponding Python enum type: Antialias, Content, Extend, FillRule, Filter, FontSlant, FontWeight, Format, HintMetrics, HintStyle, LineCap, LineJoin, Operator, PDFVersion, PSLevel, PathDataType, RegionOverlap, SVGVersion, Status, SubpixelOrder. 26
All relevant constants are now an alias to attributes of those types e.g. ANTIALIAS_DEFAULT is the same as Antialias.DEFAULT.
All functions returning enum values now return instances of the new types e.g. Context.get_antialias returns a Antialias.
Error.status is now a Status.
All included examples now work with Python 2 & 3
All included examples using GTK+ have been ported to GTK+ 3/PyGObject 3
Fix the signature of the ImageSurface buffer interface for Python 2 (int -> Py_ssize_t)
setup.py: Ensure "-fno-strict-aliasing" is used with Python 2.
Added travis-ci tests for flake8 and sphinx. 30, 32
The test suite now has optional tests for numpy and pygame integration.
Use C90 and enforce it on travis-ci. 5, 22940
Require cairo 1.12.0
Use C90 and enforce it on travis-ci. 5, 22940
Add various new cairo.OPERATOR_*, cairo.ANTIALIAS_* and cairo.FORMAT_* constants. 1
Add HAS_MIME_SURFACE and cairo.MIME_TYPE_*. 7, 58771
Add cairo.PDF_VERSION_*. 16
Add cairo.SVG_VERSION_*
Add a Error.status attribute exposing cairo.STATUS_*
Add CairoError alias for Error for cairocffi compatibility
Expose matrix components as read/write properties. e.g. Matrix.xx
Fix type checking of the multiplication operator under Python 3. 8, 89162 (Lawrence D'Oliveiro)
Add Surface.set_mime_data. 7, 58771
Add Surface.get_mime_data. 7, 58771
Add Surface.supports_mime_type. 7, 58771
Add Surface.create_for_rectangle. 13
Add Surface.create_similar_image. 15
Add Surface.has_show_text_glyphs
Fix crash when the surface wrapper gets deallocated before the surface object. 11
Add Context.in_clip. 14
Add PDFSurface.restrict_to_version. 16
Add PDFSurface.get_versions. 16
Add PDFSurface.version_to_string. 16
Add SVGSurface.restrict_to_version
Add SVGSurface.get_versions
Add SVGSurface.version_to_string
Add XCBSurface.set_size
Add PSSurface.get_levels
Add PSSurface.level_to_string
Add Pattern.set_filter
Add Pattern.get_filter
Add RecordingSurface.get_extents
Implement __eq__ and __ne__
Add FontOptions.copy
Add FontOptions.hash
Add FontOptions.equal
Add FontOptions.merge
Add ScaledFont.get_ctm
Add ScaledFont.get_font_matrix
Add ScaledFont.get_font_options
This release fixes an ABI breakage. I missed that the original pycairo master had already broken ABI compared to 1.10.0.
This release fixes an ABI breakage. I missed that the original pycairo master had already broken ABI compared to 1.10.0.
This version is based on the Python 2 version of pycairo 1.10.0 and is API/ABI compatible with both py2cairo 1.10.0 and py3cairo 1.10.0.
This version is based on the Python 2 version of pycairo 1.10.0 and is API/ABI compatible with both py2cairo 1.10.0 and py3cairo 1.10.0.
Requires cairo 1.10.2+
Switch to semantic versioning
Switch build system to distutils/setup.py (xpyb integration can be enabled with passing --enable-xpyb to setup.py build)
Moved to GitHub: https://github.com/pygobject/pycairo
Python 3 support (API/ABI compatible with py3cairo 1.10.0) including support for cairo.Error, cairo.ImageSurface.get_data and cairo.ImageSurface.create_for_data, which were missing in py3cairo.
cairo.RecordingSurface (36854, Torsten Landschoff)
cairo.Region, cairo.RectangleInt and cairo.REGION_OVERLAP_* (44336, Bug Fly)
Fix crash when read()/write() methods of file objects passed to pycairo raise exceptions.
Fix possible value truncation of handles passed to Win32Surface and Win32PrintingSurface on 64bit Windows. 57493
General Changes: py2cairo 1.10.0 requires cairo 1.10.0 (or later).
py2cairo 1.10.0 requires cairo 1.10.0 (or later).
cairo.FORMAT_RGB16_565
context.get_source().get_surface() fails 33013
Add support for './waf configure --libdir=XXX' 30230
Upgrade to using Sphinx 1.0.7.
Include html documentation in the pycairo archive file.
Update waf to 1.6.3
Remove setup.py
Improve/simplify unicode filename support.
Improve/simplify unicode text support.
General Changes: Pycairo 1.8.10 requires cairo 1.8.10 (or later).
Pycairo 1.8.10 requires cairo 1.8.10 (or later).
Win32PrintingSurface
XCBSurface - add XCB support using xpyb
Fix for libtool 2.2 (27974).
Mingw32 and pypy fixes (25203).
Tests updated.
The Win32PrintingSurface and XCBSurface changes mean that pycairo 1.8.10 is not binary compatible with pycairo 1.8.8. So modules that use the pycairo C API (like pygtk) will need to be recompiled to use pycairo 1.8.10.
Pycairo 1.8.8 requires cairo 1.8.8 (or later).
Pycairo 1.8.8 requires cairo 1.8.8 (or later).
Move from CVS to git.
Add support for the waf build tool.
The PDF/PS/SVGSurface constructors now accept None as a filename.
Your coding agent can read these notes before it upgrades. Set up the MCP server →