Skip to content
Build ctypes interfaces for shared libraries with type hinting
Branch: master
Clone or download
Latest commit 4e3bb1c Mar 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ctyped
docs
tests
.coveragerc Start here. Feb 17, 2019
.gitignore
.travis.yml
AUTHORS Start here. Feb 17, 2019
CHANGELOG
CONTRIBUTING
INSTALL
LICENSE Start here. Feb 17, 2019
MANIFEST.in Start here. Feb 17, 2019
README.rst
setup.cfg
setup.py Formatting. Mar 2, 2019
tox.ini

README.rst

ctyped

https://github.com/idlesign/ctyped

release lic ci coverage

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

http://ctyped.readthedocs.org/

You can’t perform that action at this time.