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
Release history Release notifications | RSS feed
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.1.tar.gz
(7.1 kB
view hashes)
Built Distribution
Close
Hashes for cairocffi_stubs-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cab91ba2e0f914e3a461663634ed3c8b5ec04a3767f6bf887991ccecec990e56 |
|
MD5 | 11cc5abdfae8da8b6d6ddf6d4dbe0ad5 |
|
BLAKE2b-256 | c95dd2c7875701e9e138c71ea32adf4c43b60f809a5f5968fb06b2886490f860 |