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.2.tar.gz
(7.1 kB
view hashes)
Built Distribution
Close
Hashes for cairocffi_stubs-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1208023f17f6261debd01000b86818cc1c8cba8597a6fa134cd0217c53a59478 |
|
MD5 | 325e4242d7dd23846f3d2a52d1a40728 |
|
BLAKE2b-256 | 6b3ce2dca7798514cc15a485790a51094c7e2ace5451794e1eefa846d0c8fe17 |