.. image:: https://raw.githubusercontent.com/pygobject/pycairo/main/docs/images/pycairo.svg
:align: center
:width: 370px
|
Pycairo is a Python module providing bindings for the `cairo graphics library
<https://cairographics.org/>`__. 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 <https://spdx.dev/ids>`__.
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.
.. code:: shell
pip install pycairo
Installing Pycairo requires cairo including its headers. For more info see
"`Getting Started
<https://pycairo.readthedocs.io/en/latest/getting_started.html>`__".
----
.. code:: python
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()
.. image:: https://raw.githubusercontent.com/pygobject/pycairo/main/docs/images/example.svg
:width: 320px
:align: center
----
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
Raw data
{
"_id": null,
"home_page": "https://pycairo.readthedocs.io",
"name": "pycairo",
"maintainer": "Christoph Reiter",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "reiter.christoph@gmail.com",
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/19/4f/0d48a017090d4527e921d6892bc550ae869902e67859fc960f8fe63a9094/pycairo-1.26.1.tar.gz",
"platform": null,
"description": ".. image:: https://raw.githubusercontent.com/pygobject/pycairo/main/docs/images/pycairo.svg\r\n :align: center\r\n :width: 370px\r\n\r\n|\r\n\r\nPycairo is a Python module providing bindings for the `cairo graphics library\r\n<https://cairographics.org/>`__. It depends on **cairo >= 1.15.10** and works\r\nwith **Python 3.8+** and **PyPy3**. Pycairo, including this documentation, is\r\nlicensed under the `LGPL-2.1-only OR MPL-1.1 <https://spdx.dev/ids>`__.\r\n\r\nThe Pycairo bindings are designed to match the cairo C API as closely as\r\npossible, and to deviate only in cases which are clearly better implemented in\r\na more \u2018Pythonic\u2019 way.\r\n\r\n.. code:: shell\r\n\r\n pip install pycairo\r\n\r\nInstalling Pycairo requires cairo including its headers. For more info see\r\n\"`Getting Started\r\n<https://pycairo.readthedocs.io/en/latest/getting_started.html>`__\".\r\n\r\n----\r\n\r\n.. code:: python\r\n\r\n import cairo\r\n\r\n with cairo.SVGSurface(\"example.svg\", 200, 200) as surface:\r\n context = cairo.Context(surface)\r\n x, y, x1, y1 = 0.1, 0.5, 0.4, 0.9\r\n x2, y2, x3, y3 = 0.6, 0.1, 0.9, 0.5\r\n context.scale(200, 200)\r\n context.set_line_width(0.04)\r\n context.move_to(x, y)\r\n context.curve_to(x1, y1, x2, y2, x3, y3)\r\n context.stroke()\r\n context.set_source_rgba(1, 0.2, 0.2, 0.6)\r\n context.set_line_width(0.02)\r\n context.move_to(x, y)\r\n context.line_to(x1, y1)\r\n context.move_to(x2, y2)\r\n context.line_to(x3, y3)\r\n context.stroke()\r\n\r\n.. image:: https://raw.githubusercontent.com/pygobject/pycairo/main/docs/images/example.svg\r\n :width: 320px\r\n :align: center\r\n\r\n----\r\n\r\nFeatures of the Pycairo bindings:\r\n\r\n* Provides an object oriented interface to cairo.\r\n* Queries the error status of objects and translates them to exceptions.\r\n* Provides a C API that can be used by other Python extensions.\r\n* Fully typed and documented API.\r\n\r\nFor more information visit https://pycairo.readthedocs.io\r\n",
"bugtrack_url": null,
"license": "LGPL-2.1-only OR MPL-1.1",
"summary": "Python interface for cairo",
"version": "1.26.1",
"project_urls": {
"Homepage": "https://pycairo.readthedocs.io",
"Source": "https://github.com/pygobject/pycairo"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "49136279ce219c5735880af7a0b97d3041f106eebf8e7527aad3e4df4e2fcf6d",
"md5": "541ec73b21ca908a71c17a06d82014c5",
"sha256": "b93b9e3072826a346f1f79cb1becc403d1ba4a3971cad61d144db0fe6dcb6be8"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp310-cp310-win32.whl",
"has_sig": false,
"md5_digest": "541ec73b21ca908a71c17a06d82014c5",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 766503,
"upload_time": "2024-06-21T10:37:05",
"upload_time_iso_8601": "2024-06-21T10:37:05.819434Z",
"url": "https://files.pythonhosted.org/packages/49/13/6279ce219c5735880af7a0b97d3041f106eebf8e7527aad3e4df4e2fcf6d/pycairo-1.26.1-cp310-cp310-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "32eccf8510f556ce950546216738cdbee631e917ad6734b5cd84f9204756f708",
"md5": "8d2952927efd46f50489f4c6985a3a29",
"sha256": "acfc76924ed668d8fea50f6cc6097b9a57ef6cd3dc3f2fa20814380d639a6dd2"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "8d2952927efd46f50489f4c6985a3a29",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 861880,
"upload_time": "2024-06-21T10:37:10",
"upload_time_iso_8601": "2024-06-21T10:37:10.404489Z",
"url": "https://files.pythonhosted.org/packages/32/ec/cf8510f556ce950546216738cdbee631e917ad6734b5cd84f9204756f708/pycairo-1.26.1-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8c3ba0d007048dd550afc3394bc7d80f6ddd1fa9c8d2d12b75aab651f604dba1",
"md5": "64f2117355b58a8dc8dacf9977962bcb",
"sha256": "067191315c3b4d09cad1ec57cdb8fc1d72e2574e89389c268a94f22d4fa98b5f"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp310-cp310-win_arm64.whl",
"has_sig": false,
"md5_digest": "64f2117355b58a8dc8dacf9977962bcb",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 675603,
"upload_time": "2024-06-21T10:37:13",
"upload_time_iso_8601": "2024-06-21T10:37:13.292213Z",
"url": "https://files.pythonhosted.org/packages/8c/3b/a0d007048dd550afc3394bc7d80f6ddd1fa9c8d2d12b75aab651f604dba1/pycairo-1.26.1-cp310-cp310-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b7257ef228b6436423a606c03044e65f9d7066179e0d3d7e3648979c7899ce9e",
"md5": "2aaf5624df24dcac63cb10f9bf7b3d9f",
"sha256": "56a29623aa7b4adbde5024c61ff001455b5a3def79e512742ea45ab36c3fe24b"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp311-cp311-win32.whl",
"has_sig": false,
"md5_digest": "2aaf5624df24dcac63cb10f9bf7b3d9f",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 766504,
"upload_time": "2024-06-21T10:37:16",
"upload_time_iso_8601": "2024-06-21T10:37:16.090783Z",
"url": "https://files.pythonhosted.org/packages/b7/25/7ef228b6436423a606c03044e65f9d7066179e0d3d7e3648979c7899ce9e/pycairo-1.26.1-cp311-cp311-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2d54fa4f1749b572853f537214bb01b6601b0eba7a9857b3a660e939b1959f4b",
"md5": "634b3cfe63efe93cac9bf8bb0762398e",
"sha256": "8d2889e03a095de5da9e68a589b691a3ada09d60ef18b5fc1b1b99f2a7794297"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "634b3cfe63efe93cac9bf8bb0762398e",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 861879,
"upload_time": "2024-06-21T10:37:18",
"upload_time_iso_8601": "2024-06-21T10:37:18.802741Z",
"url": "https://files.pythonhosted.org/packages/2d/54/fa4f1749b572853f537214bb01b6601b0eba7a9857b3a660e939b1959f4b/pycairo-1.26.1-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6de5e33bdb7a6cf7a86f994fc5950793b79dfd090b4302301daa62e5e7285bd6",
"md5": "59a7ee8d3e051bd6413bf227eef83dd1",
"sha256": "7a307111de345304ed8eadd7f81ebd7fb1fc711224aa314a4e8e33af7dfa3d27"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp311-cp311-win_arm64.whl",
"has_sig": false,
"md5_digest": "59a7ee8d3e051bd6413bf227eef83dd1",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 675602,
"upload_time": "2024-06-21T10:37:20",
"upload_time_iso_8601": "2024-06-21T10:37:20.904956Z",
"url": "https://files.pythonhosted.org/packages/6d/e5/e33bdb7a6cf7a86f994fc5950793b79dfd090b4302301daa62e5e7285bd6/pycairo-1.26.1-cp311-cp311-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e0b86b92544a90444fc97ea903798bc533e043b2d4653cb2a679d220978741c6",
"md5": "97c1b8a9815a9c511d19631ff5e835c0",
"sha256": "5cc1808e9e30ccd0f4d84ba7700db5aab5673f8b6b901760369ebb88a0823436"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp312-cp312-win32.whl",
"has_sig": false,
"md5_digest": "97c1b8a9815a9c511d19631ff5e835c0",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 766911,
"upload_time": "2024-06-21T10:37:23",
"upload_time_iso_8601": "2024-06-21T10:37:23.118204Z",
"url": "https://files.pythonhosted.org/packages/e0/b8/6b92544a90444fc97ea903798bc533e043b2d4653cb2a679d220978741c6/pycairo-1.26.1-cp312-cp312-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "60189d1bfe0c0ff23c65f04001d62d358e56fba11bbc1a86587aabc93f1809ba",
"md5": "77571e525e687fdc7dfb9593f11580bd",
"sha256": "36131a726f568b2dbc5e78ff50fbaa379e69db00614d46d66b1e4289caf9b1ce"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "77571e525e687fdc7dfb9593f11580bd",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 862105,
"upload_time": "2024-06-21T10:37:25",
"upload_time_iso_8601": "2024-06-21T10:37:25.700173Z",
"url": "https://files.pythonhosted.org/packages/60/18/9d1bfe0c0ff23c65f04001d62d358e56fba11bbc1a86587aabc93f1809ba/pycairo-1.26.1-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f671f21682a17ed0e23d2545a2de39a6f30255868cd81c5f78505640af75f8d3",
"md5": "20c6203d3f2adfd37ca0b5b09865ec98",
"sha256": "5577b51543ea4c283c15f436d891e9eaf6fd43fe74882adb032fba2c271f3fe9"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp312-cp312-win_arm64.whl",
"has_sig": false,
"md5_digest": "20c6203d3f2adfd37ca0b5b09865ec98",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 675512,
"upload_time": "2024-06-21T10:37:27",
"upload_time_iso_8601": "2024-06-21T10:37:27.831989Z",
"url": "https://files.pythonhosted.org/packages/f6/71/f21682a17ed0e23d2545a2de39a6f30255868cd81c5f78505640af75f8d3/pycairo-1.26.1-cp312-cp312-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0200b72beb131c320fdb23cea8e20cb4a5b38acc6510c2890877a74cdcea484d",
"md5": "f06602ce91ab1a63aa8093316de5b888",
"sha256": "27ec7b42c58af35dc11352881262dce4254378b0f11be0959d1c13edb4539d2c"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp38-cp38-win32.whl",
"has_sig": false,
"md5_digest": "f06602ce91ab1a63aa8093316de5b888",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 766848,
"upload_time": "2024-06-21T10:37:30",
"upload_time_iso_8601": "2024-06-21T10:37:30.034404Z",
"url": "https://files.pythonhosted.org/packages/02/00/b72beb131c320fdb23cea8e20cb4a5b38acc6510c2890877a74cdcea484d/pycairo-1.26.1-cp38-cp38-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0934619273df157e839e6754ce2ba44bf95522b5b200e2be0fb9c8106329ca46",
"md5": "71e5b4fbb600c6f48c38cd722b7ce157",
"sha256": "27357994d277b3fd10a45e9ef58f80a4cb5e3291fe76c5edd58d2d06335eb8e7"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp38-cp38-win_amd64.whl",
"has_sig": false,
"md5_digest": "71e5b4fbb600c6f48c38cd722b7ce157",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 862458,
"upload_time": "2024-06-21T10:37:32",
"upload_time_iso_8601": "2024-06-21T10:37:32.920291Z",
"url": "https://files.pythonhosted.org/packages/09/34/619273df157e839e6754ce2ba44bf95522b5b200e2be0fb9c8106329ca46/pycairo-1.26.1-cp38-cp38-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "583f9ddd32ef2ca7af25392df6cc01b8d536f2c6de56a28fd2b3e33eb99a51b2",
"md5": "e46c88acc1856810392c23d3cc775b07",
"sha256": "e68300d1c2196d1d34de3432885ae9ff78e10426fa16f765742a11c6f8fe0a71"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp39-cp39-win32.whl",
"has_sig": false,
"md5_digest": "e46c88acc1856810392c23d3cc775b07",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 766767,
"upload_time": "2024-06-21T10:37:34",
"upload_time_iso_8601": "2024-06-21T10:37:34.827833Z",
"url": "https://files.pythonhosted.org/packages/58/3f/9ddd32ef2ca7af25392df6cc01b8d536f2c6de56a28fd2b3e33eb99a51b2/pycairo-1.26.1-cp39-cp39-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9772afe8c322fb58fc66f10061f94d74440c40b9a11c7896c6c47f0fdc5a8556",
"md5": "bff621e9d198499b47945cfda145247d",
"sha256": "ce049930e294c29b53c68dcaab3df97cc5de7eb1d3d8e8a9f5c77e7164cd6e85"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "bff621e9d198499b47945cfda145247d",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 862456,
"upload_time": "2024-06-21T10:37:37",
"upload_time_iso_8601": "2024-06-21T10:37:37.068220Z",
"url": "https://files.pythonhosted.org/packages/97/72/afe8c322fb58fc66f10061f94d74440c40b9a11c7896c6c47f0fdc5a8556/pycairo-1.26.1-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "70010dd13ad12dc840bcbdf313ce5f3658ba8599c33cab87188fa355aafe1a09",
"md5": "2f0619ed90b80a0acef4edb2dee31317",
"sha256": "22e1db531d4ed3167a98f0ea165bfa2a30df9d6eb22361c38158c031065999a4"
},
"downloads": -1,
"filename": "pycairo-1.26.1-cp39-cp39-win_arm64.whl",
"has_sig": false,
"md5_digest": "2f0619ed90b80a0acef4edb2dee31317",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 675865,
"upload_time": "2024-06-21T10:37:38",
"upload_time_iso_8601": "2024-06-21T10:37:38.967067Z",
"url": "https://files.pythonhosted.org/packages/70/01/0dd13ad12dc840bcbdf313ce5f3658ba8599c33cab87188fa355aafe1a09/pycairo-1.26.1-cp39-cp39-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "194f0d48a017090d4527e921d6892bc550ae869902e67859fc960f8fe63a9094",
"md5": "36504ac01533ae14f0d2337516bbae2e",
"sha256": "a11b999ce55b798dbf13516ab038e0ce8b6ec299b208d7c4e767a6f7e68e8430"
},
"downloads": -1,
"filename": "pycairo-1.26.1.tar.gz",
"has_sig": false,
"md5_digest": "36504ac01533ae14f0d2337516bbae2e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 346882,
"upload_time": "2024-06-21T10:37:41",
"upload_time_iso_8601": "2024-06-21T10:37:41.527020Z",
"url": "https://files.pythonhosted.org/packages/19/4f/0d48a017090d4527e921d6892bc550ae869902e67859fc960f8fe63a9094/pycairo-1.26.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-21 10:37:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pygobject",
"github_project": "pycairo",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pycairo"
}