Skip to main content

Stubs for cairocffi.

Project description

cairocffi-stubs

This package contains type stubs to provide more precise static types and type inference for cairocffi.

Installation

pip install cairocffi-stubs

Usage

from io import BytesIO
import cairocffi as cairo
import matplotlib.pyplot as plt

surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 300, 200)
context = cairo.Context(surface)
context.show_text('Hello World!')
img = BytesIO(surface.write_to_png())  # overloaded
plt.imshow(plt.imread(img))
plt.show()

Static type checker can correctly recognize the return type of surface.write_to_png() as bytes when passing no arguments. No type errors will be raised.

Style Guidelines

Follow the same style guidelines as typeshed.

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

cairocffi-stubs-0.1.2.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

cairocffi_stubs-0.1.2-py3-none-any.whl (9.4 kB view hashes)

Uploaded Python 3

Supported by

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