Skip to main content

Build ctypes interfaces for shared libraries with type hinting

Project description

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;

  • Basic code generator (.so function -> ctyped function);

  • 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/

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.8.0.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

ctyped-0.8.0-py2.py3-none-any.whl (12.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ctyped-0.8.0.tar.gz.

File metadata

  • Download URL: ctyped-0.8.0.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for ctyped-0.8.0.tar.gz
Algorithm Hash digest
SHA256 e1c179d27a0d9fe8649485b34c67e00eb30e2c4fa149bd2a6cc5de489def4b7b
MD5 61819ee0d9e145ccf1c8097215c10b75
BLAKE2b-256 f2ff1706e5e67e666730d216aaa3942892381e16c9dcb25a572c1c75c33b2be8

See more details on using hashes here.

File details

Details for the file ctyped-0.8.0-py2.py3-none-any.whl.

File metadata

  • Download URL: ctyped-0.8.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for ctyped-0.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0297a526c53948df4d6a0411f2054df545c1f4a0d92172d1921e48ef5ea5b34f
MD5 73fc21e78b142c9fef0aae3aa3cdad09
BLAKE2b-256 f6af7f660b8831e9456d3a6d536518153d7d61841176c9dd8d34ba244a73338e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page