wideopensource / crelm

Python package which enables embedding C code directly into Python source. pip install crelm.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crelm

The Crelm package provides a relatively simple API around the CFFI system. Give it C code or source files, it gives you a package with bindings to functions and structs. Easiest way to get started is hack up the examples in the repo.

Installation

pip3 install crelm

Simple Demo

from crelm import Factory

paste = Factory(debug=False, verbose=True).create_Tube('add2') \
    .add_source_text('int add2(int a, int b) { return a + b; }') \
    .squeeze()

print(f'2 + 3 = {paste.add2(2, 3)}')

About

Python package which enables embedding C code directly into Python source. pip install crelm.

License:MIT License


Languages

Language:C 76.7%Language:Python 23.3%