Pycairo is a Python module providing bindings for the cairo graphics library. It depends on cairo >= 1.15.10 and works with Python 3.8+ 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()
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
Release files for pycairo 1.24.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pycairo-1.24.0.tar.gz | 344.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pycairo-1.24.0-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| pycairo-1.24.0-cp312-cp312-win32.whl | CPython 3.12 | CPython 3.12 | Windows x86-32 | Details |
| pycairo-1.24.0-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| pycairo-1.24.0-cp311-cp311-win32.whl | CPython 3.11 | CPython 3.11 | Windows x86-32 | Details |
| pycairo-1.24.0-cp310-cp310-win_amd64.whl | CPython 3.10 | CPython 3.10 | Windows x86-64 | Details |
| pycairo-1.24.0-cp310-cp310-win32.whl | CPython 3.10 | CPython 3.10 | Windows x86-32 | Details |
| pycairo-1.24.0-cp39-cp39-win_amd64.whl | CPython 3.9 | CPython 3.9 | Windows x86-64 | Details |
| pycairo-1.24.0-cp39-cp39-win32.whl | CPython 3.9 | CPython 3.9 | Windows x86-32 | Details |
| pycairo-1.24.0-cp38-cp38-win_amd64.whl | CPython 3.8 | CPython 3.8 | Windows x86-64 | Details |
| pycairo-1.24.0-cp38-cp38-win32.whl | CPython 3.8 | CPython 3.8 | Windows x86-32 | Details |
Total release size: 11.7 MB
Release files / pycairo-1.24.0.tar.gz
| Download URL | pycairo-1.24.0.tar.gz |
|---|---|
| Size | 344.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1444d52f1bb4cc79a4a0c0fe2ccec4bd78ff885ab01ebe1c0f637d8392bcafb6
|
|
BLAKE2b-256 checksum How to use checksums |
a2ddbc2c9ee9485308a29c18b1241329e677917af25c60b127857f0fb23d0c6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp312-cp312-win_amd64.whl
| Download URL | pycairo-1.24.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3199d6a0538d6482c71efb816bd330515e98bb06f182e23572c77d92be98f536
|
|
BLAKE2b-256 checksum How to use checksums |
d942537304632ea9f37e14da0b74682c69ca7ea16128308ff2f803312729d4bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp312-cp312-win32.whl
| Download URL | pycairo-1.24.0-cp312-cp312-win32.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
220742f187d3940d695c1af1a0c1646e26dc2199d65b7bafaa527e15c3520fd3
|
|
BLAKE2b-256 checksum How to use checksums |
4605bfb2f32ae68bab736f9517f83b809f70f8fbe8e03eafc31c4a21a654c6b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp311-cp311-win_amd64.whl
| Download URL | pycairo-1.24.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ed0622a0ccffb873ffe7fee1699d60779f1260fba143390e5366d55f1d1739f5
|
|
BLAKE2b-256 checksum How to use checksums |
4d80d6a59dbc9e0c4cdc78c94e90959a0da6e461582172efcc5f79602a6d208b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp311-cp311-win32.whl
| Download URL | pycairo-1.24.0-cp311-cp311-win32.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
4631ed794a3376ec314ce47826c3e51940b54695f4ef7d5b3245b203037ae760
|
|
BLAKE2b-256 checksum How to use checksums |
d3927ba26f9511da487d7e1f2c2961f707956a59b243f00137a3f1916fd31e44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp310-cp310-win_amd64.whl
| Download URL | pycairo-1.24.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
afccac552386ab628e8ae658185fa363e8d15a5afe96d1de43f97027dd78bdd6
|
|
BLAKE2b-256 checksum How to use checksums |
eb7e90d8e3ae3e64e51716543634b84ee05c8e5fed95918b4a641afcd0ddf1e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp310-cp310-win32.whl
| Download URL | pycairo-1.24.0-cp310-cp310-win32.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
031f5ef2c80792673f2c54ee285f2a31779a44d7521a27a7f82e4a5ecfafc26e
|
|
BLAKE2b-256 checksum How to use checksums |
226939da108da3fe66516f5d5b2ee2d283079fbe4df4f4d03d6c47faaa945aae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp39-cp39-win_amd64.whl
| Download URL | pycairo-1.24.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
26fe2c32ba24caae524d855f26f3ee1a0c1ea3291da2a19604264ed29f64d834
|
|
BLAKE2b-256 checksum How to use checksums |
e2bba2c137267fbf526c121de06ca4c65aabcc29a363e2dacb7ccec3994317eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp39-cp39-win32.whl
| Download URL | pycairo-1.24.0-cp39-cp39-win32.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.9 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
c5f6efdd86fe13d36a6b004c64d8e97cde9854d599cf6cca962afb1966fe533d
|
|
BLAKE2b-256 checksum How to use checksums |
93018aec9e17bff2d39bec5a88107664863825d5241c9336e19da47f31c833ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp38-cp38-win_amd64.whl
| Download URL | pycairo-1.24.0-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6ad5c3425408ebb0dfaad2cca4a80e7524d7a309305acdb2569638b5cc988fe7
|
|
BLAKE2b-256 checksum How to use checksums |
a12ec2d361f1b35b2cdc41c16b6dab4f78ef56e7cc861d4968a47d8612d8326d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / pycairo-1.24.0-cp38-cp38-win32.whl
| Download URL | pycairo-1.24.0-cp38-cp38-win32.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
c7c79e748ec849811241d29553184c3ad93c857558dbe9954a49327680b8d356
|
|
BLAKE2b-256 checksum How to use checksums |
8ed3688dab33f7de05ef9feea640f99bb2607a4112ca134fcdb1300d1000cb32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|