Skip to main content

Python interface for cairo

Project description

https://raw.githubusercontent.com/pygobject/pycairo/main/docs/images/pycairo.svg

Pycairo is a Python module providing bindings for the cairo graphics library. It depends on cairo >= 1.15.10 and works with Python 3.10+ and PyPy3. Pycairo, including this documentation, is licensed under the LGPL-2.1-only OR MPL-1.1.

The Pycairo bindings are designed to match the cairo C API as closely as possible, and to deviate only in cases which are clearly better implemented in a more ‘Pythonic’ way.

pip install pycairo

Installing Pycairo requires cairo including its headers. For more info see “Getting Started”.


import cairo

with cairo.SVGSurface("example.svg", 200, 200) as surface:
    context = cairo.Context(surface)
    x, y, x1, y1 = 0.1, 0.5, 0.4, 0.9
    x2, y2, x3, y3 = 0.6, 0.1, 0.9, 0.5
    context.scale(200, 200)
    context.set_line_width(0.04)
    context.move_to(x, y)
    context.curve_to(x1, y1, x2, y2, x3, y3)
    context.stroke()
    context.set_source_rgba(1, 0.2, 0.2, 0.6)
    context.set_line_width(0.02)
    context.move_to(x, y)
    context.line_to(x1, y1)
    context.move_to(x2, y2)
    context.line_to(x3, y3)
    context.stroke()
https://raw.githubusercontent.com/pygobject/pycairo/main/docs/images/example.svg

Features of the Pycairo bindings:

  • Provides an object oriented interface to cairo.

  • Queries the error status of objects and translates them to exceptions.

  • Provides a C API that can be used by other Python extensions.

  • Fully typed and documented API.

For more information visit https://pycairo.readthedocs.io

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycairo-1.29.0.tar.gz (665.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pycairo-1.29.0-cp314-cp314t-win_arm64.whl (721.4 kB view details)

Uploaded CPython 3.14tWindows ARM64

pycairo-1.29.0-cp314-cp314t-win_amd64.whl (874.0 kB view details)

Uploaded CPython 3.14tWindows x86-64

pycairo-1.29.0-cp314-cp314-win_arm64.whl (719.5 kB view details)

Uploaded CPython 3.14Windows ARM64

pycairo-1.29.0-cp314-cp314-win_amd64.whl (871.6 kB view details)

Uploaded CPython 3.14Windows x86-64

pycairo-1.29.0-cp314-cp314-win32.whl (767.2 kB view details)

Uploaded CPython 3.14Windows x86

pycairo-1.29.0-cp313-cp313-win_arm64.whl (693.6 kB view details)

Uploaded CPython 3.13Windows ARM64

pycairo-1.29.0-cp313-cp313-win_amd64.whl (844.1 kB view details)

Uploaded CPython 3.13Windows x86-64

pycairo-1.29.0-cp313-cp313-win32.whl (750.9 kB view details)

Uploaded CPython 3.13Windows x86

pycairo-1.29.0-cp312-cp312-win_arm64.whl (694.5 kB view details)

Uploaded CPython 3.12Windows ARM64

pycairo-1.29.0-cp312-cp312-win_amd64.whl (845.4 kB view details)

Uploaded CPython 3.12Windows x86-64

pycairo-1.29.0-cp312-cp312-win32.whl (751.5 kB view details)

Uploaded CPython 3.12Windows x86

pycairo-1.29.0-cp311-cp311-win_arm64.whl (694.6 kB view details)

Uploaded CPython 3.11Windows ARM64

pycairo-1.29.0-cp311-cp311-win_amd64.whl (845.0 kB view details)

Uploaded CPython 3.11Windows x86-64

pycairo-1.29.0-cp311-cp311-win32.whl (751.3 kB view details)

Uploaded CPython 3.11Windows x86

pycairo-1.29.0-cp310-cp310-win_arm64.whl (694.8 kB view details)

Uploaded CPython 3.10Windows ARM64

pycairo-1.29.0-cp310-cp310-win_amd64.whl (845.1 kB view details)

Uploaded CPython 3.10Windows x86-64

pycairo-1.29.0-cp310-cp310-win32.whl (751.3 kB view details)

Uploaded CPython 3.10Windows x86

File details

Details for the file pycairo-1.29.0.tar.gz.

File metadata

  • Download URL: pycairo-1.29.0.tar.gz
  • Upload date:
  • Size: 665.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0.tar.gz
Algorithm Hash digest
SHA256 f3f7fde97325cae80224c09f12564ef58d0d0f655da0e3b040f5807bd5bd3142
MD5 8202d252ea754e2a17852b9031e01b32
BLAKE2b-256 22d91728840a22a4ef8a8f479b9156aa2943cd98c3907accd3849fb0d5f82bfd

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp314-cp314t-win_arm64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp314-cp314t-win_arm64.whl
  • Upload date:
  • Size: 721.4 kB
  • Tags: CPython 3.14t, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp314-cp314t-win_arm64.whl
Algorithm Hash digest
SHA256 caba0837a4b40d47c8dfb0f24cccc12c7831e3dd450837f2a356c75f21ce5a15
MD5 3bb23a6a02f0045c934866af5b5747d5
BLAKE2b-256 d754123f6239685f5f3f2edc123f1e38d2eefacebee18cf3c532d2f4bd51d0ef

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 874.0 kB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 5e45fce6185f553e79e4ef1722b8e98e6cde9900dbc48cb2637a9ccba86f627a
MD5 3636cbf36f4ddef2efae406059a46bcf
BLAKE2b-256 932337053c039f8d3b9b5017af9bc64d27b680c48a898d48b72e6d6583cf0155

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp314-cp314-win_arm64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp314-cp314-win_arm64.whl
  • Upload date:
  • Size: 719.5 kB
  • Tags: CPython 3.14, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp314-cp314-win_arm64.whl
Algorithm Hash digest
SHA256 b72200ea0e5f73ae4c788cd2028a750062221385eb0e6d8f1ecc714d0b4fdf82
MD5 5db011559269652164a4ca94de47530a
BLAKE2b-256 5e9193632b6ba12ad69c61991e3208bde88486fdfc152be8cfdd13444e9bc650

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 871.6 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e91243437a21cc4c67c401eff4433eadc45745275fa3ade1a0d877e50ffb90da
MD5 fa4676f4a6dc9589870fed926af5c22c
BLAKE2b-256 3c903564d0f64d0a00926ab863dc3c4a129b1065133128e96900772e1c4421f8

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp314-cp314-win32.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp314-cp314-win32.whl
  • Upload date:
  • Size: 767.2 kB
  • Tags: CPython 3.14, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 69e2a7968a3fbb839736257bae153f547bca787113cc8d21e9e08ca4526e0b6b
MD5 88f21cb4f1b3ed6ccf96da84aaab5428
BLAKE2b-256 2dfa87eaeeb9d53344c769839d7b2854db7ff2cd596211e00dd1b702eeb1838f

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp313-cp313-win_arm64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp313-cp313-win_arm64.whl
  • Upload date:
  • Size: 693.6 kB
  • Tags: CPython 3.13, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp313-cp313-win_arm64.whl
Algorithm Hash digest
SHA256 09b7f69a5ff6881e151354ea092137b97b0b1f0b2ab4eb81c92a02cc4a08e335
MD5 02b72c96ab5c96ebe766c05fd4fc6ac9
BLAKE2b-256 1543e782131e23df69e5c8e631a016ed84f94bbc4981bf6411079f57af730a23

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 844.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 91114e4b3fbf4287c2b0788f83e1f566ce031bda49cf1c3c3c19c3e986e95c38
MD5 4f9f60f4863798bd335527beb24caaf5
BLAKE2b-256 43347d27a333c558d6ac16dbc12a35061d389735e99e494ee4effa4ec6d99bed

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp313-cp313-win32.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 750.9 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 3eb382a4141591807073274522f7aecab9e8fa2f14feafd11ac03a13a58141d7
MD5 55d076d68d864cd6a7e3613c2430cd05
BLAKE2b-256 f0213f477dc318dd4e84a5ae6301e67284199d7e5a2384f3063714041086b65d

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp312-cp312-win_arm64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp312-cp312-win_arm64.whl
  • Upload date:
  • Size: 694.5 kB
  • Tags: CPython 3.12, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp312-cp312-win_arm64.whl
Algorithm Hash digest
SHA256 eafe3d2076f3533535ad4a361fa0754e0ee66b90e548a3a0f558fed00b1248f2
MD5 0cc4efaddc9496a0ac78e22549771fa1
BLAKE2b-256 01166e6f33bb79ec4a527c9e633915c16dc55a60be26b31118dbd0d5859e8c51

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 845.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3f01c3b5e49ef9411fff6bc7db1e765f542dc1c9cfed4542958a5afa3a8b8e76
MD5 496059602d7e97cd0dc944fb458246b6
BLAKE2b-256 3ad2d146f1dd4ef81007686ac52231dd8f15ad54cf0aa432adaefc825475f286

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 751.5 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 91bcd7b5835764c616a615d9948a9afea29237b34d2ed013526807c3d79bb1d0
MD5 f7f976a58a3cd4aa52c5d0cf396d0ae9
BLAKE2b-256 f6286363087b9e60af031398a6ee5c248639eefc6cc742884fa2789411b1f73b

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp311-cp311-win_arm64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp311-cp311-win_arm64.whl
  • Upload date:
  • Size: 694.6 kB
  • Tags: CPython 3.11, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp311-cp311-win_arm64.whl
Algorithm Hash digest
SHA256 b69be8bb65c46b680771dc6a1a422b1cdd0cffb17be548f223e8cbbb6205567c
MD5 e8082641b0be4a90f537e6ae91d10dbf
BLAKE2b-256 3cb2bf455454bac50baef553e7356d36b9d16e482403bf132cfb12960d2dc2e7

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 845.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3391532db03f9601c1cee9ebfa15b7d1db183c6020f3e75c1348cee16825934f
MD5 7e6afd555dcb6c1e812460e9ba7878de
BLAKE2b-256 db09a0ab6a246a7ede89e817d749a941df34f27a74bedf15551da51e86ae105e

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 751.3 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 12757ebfb304b645861283c20585c9204c3430671fad925419cba04844d6dfed
MD5 012d20d24205694f67f18c36d8866aeb
BLAKE2b-256 31921b904087e831806a449502786d47d3a468e5edb8f65755f6bd88e8038e53

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp310-cp310-win_arm64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp310-cp310-win_arm64.whl
  • Upload date:
  • Size: 694.8 kB
  • Tags: CPython 3.10, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp310-cp310-win_arm64.whl
Algorithm Hash digest
SHA256 15b36aea699e2ff215cb6a21501223246032e572a3a10858366acdd69c81a1c8
MD5 b966642a2687c08d2aa1341ef1be8353
BLAKE2b-256 1bf0ee0a887d8c8a6833940263b7234aaa63d8d95a27d6130a9a053867ff057c

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 845.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 65bddd944aee9f7d7d72821b1c87e97593856617c2820a78d589d66aa8afbd08
MD5 90b31e6eaed4c56d94a0d34c8beaba3b
BLAKE2b-256 eb362a934c6fd4f32d2011c4d9cc59a32e34e06a97dd9f4b138614078d39340b

See more details on using hashes here.

File details

Details for the file pycairo-1.29.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: pycairo-1.29.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 751.3 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pycairo-1.29.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 96c67e6caba72afd285c2372806a0175b1aa2f4537aa88fb4d9802d726effcd1
MD5 615802e1f3b7c3a1f506f151d320e673
BLAKE2b-256 23e2c08847af2a103517f7785830706b6d1d55274494d76ab605eb744404c22f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page