Readme is needed for now.
otdm-cpp-wrapper aks otcpp
It's my fix for making c / cpp code functions injections in one way to python. By using decorators from python it's wrapping def then look for it content. In example you can see its' raff!
what is working now
why to use it
As one line solution for native python .so file builder it's fast to make a function moved to native c / cpp where all the power is in your hands. Really good in situations where performance of your code in computing high / math
how to use it [ manual installation ]
- get
otcppwrapper.py file to your project
- in your python
from otcpwrapper import *
- wrap a
MyDiv function for example
@otcpp
def MyDiv( a: int = 0, b: int = 1 ) -> int:
'''
int MyDiv( int a, int b ){
return a/b;
}
'''
It gets it's c/cpp code as comment in the def it can by any function you want. It this example it's division of two integers.
- use it as normally you use
def by
or
after invoking it once it's in cache then you can use
f = otDynoWith( 'MyDiv' )
print( f( 6, 2 ) )
It's making in background a .c files then it compiles it and in dynamic way import those files as .so library
example
https://github.com/yOyOeK1/oiyshTerminal/blob/main/otdm-cpp-wrapper/otcpp.py
it running

This shows that light function are ok if not faster in python but if the amount of math is higher / more data to process it's ~15x faster in execution.
Readme is needed for now.
otdm-cpp-wrapper aks otcpp
It's my fix for making c / cpp code functions injections in one way to python. By using
decoratorsfrom python it's wrappingdefthen look for it content. In example you can see its' raff!what is working now
__type__:_int_directly from python_array_/_vector_of_ctypes.c_*_directly from pythondefbuild and imported.so(code change)why to use it
As one line solution for native python
.sofile builder it's fast to make a function moved to native c / cpp where all the power is in your hands. Really good in situations where performance of your code in computing high / mathhow to use it [ manual installation ]
otcppwrapper.pyfile to your projectMyDivfunction for exampledefit can by any function you want. It this example it's division of two integers.defbyafter invoking it once it's in cache then you can use
It's making in background a .c files then it compiles it and in dynamic way import those files as .so library
example
https://github.com/yOyOeK1/oiyshTerminal/blob/main/otdm-cpp-wrapper/otcpp.py
it running
This shows that light function are ok if not faster in python but if the amount of math is higher / more data to process it's ~15x faster in execution.