Build ctypes interfaces for shared libraries with type hinting
Project description
https://github.com/idlesign/ctyped
Description
Build ctypes interfaces for shared libraries with type hinting
Requires Python 3.6+
Less boilerplate;
Logical structuring;
Useful helpers.
from ctyped.toolbox import Library
# Define library.
lib = Library('mylib.so')
@lib.structure
class Box:
one: int
two: str
# Type less with function names prefixes.
with lib.scope(prefix='mylib_'):
# Describe function available in the library.
@lib.function
def some_func(title: str, year: int, box: Box) -> str:
...
# Bind ctype types to functions available in the library.
lib.bind_types()
# Call library function.
result_string = some_func('Hello!', 2019, Box(one=35, two='dummy'))
Read the documentation for more information.
Documentation
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
ctyped-0.7.0.tar.gz
(24.5 kB
view hashes)
Built Distribution
ctyped-0.7.0-py2.py3-none-any.whl
(11.0 kB
view hashes)
Close
Hashes for ctyped-0.7.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f453f7b9f89e3ddf40970f1b474105482424d7a809b9742884c8687fc4f2fec9 |
|
MD5 | 949482dcadcc4cee4270e8f958bbe32d |
|
BLAKE2b-256 | 8c155f98d3194192cd11c34eb0e7a9310b9f468fb43ad03e1bce58aff1f59b29 |