Skip to main content

Build ctypes interfaces for shared libraries with type hinting

Project description

https://github.com/idlesign/ctyped

release lic ci coverage

Work in progress. Stay tuned.

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')

# Type less with function names prefixes.
with lib.functions_prefix('mylib_'):

    # Describe function available in the library.
    @lib.function()
    def some_func(title: str, year: int) -> str:
        ...

# Bind ctype types to functions available in the library.
lib.bind_types()

# Call function from the library.
result_string = some_func('Hello!', 2019)

Read the documentation for more information.

Documentation

http://ctyped.readthedocs.org/

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

ctyped-0.1.0.tar.gz (17.9 kB view hashes)

Uploaded source

Built Distribution

ctyped-0.1.0-py2.py3-none-any.whl (14.1 kB view hashes)

Uploaded 2 7

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page