All Projects → tbennun → Cpyke

tbennun / Cpyke

Licence: bsd-3-clause
Easy integrated Python scripting embedded in C++

Programming Languages

python
139335 projects - #7 most used programming language
cpp
1120 projects

Projects that are alternatives of or similar to Cpyke

SEPA
Get notifications about changes in your SPARQL endpoint.
Stars: ✭ 21 (+10.53%)
Mutual labels:  interoperability
keep-core
The smart contracts and reference client behind the Keep network
Stars: ✭ 87 (+357.89%)
Mutual labels:  interoperability
Rdotnet
.NET interop library to call the R statistical language in the same process
Stars: ✭ 297 (+1463.16%)
Mutual labels:  interoperability
NetteAdapterForSymfonyBundles
[DEPRECATED due to only 20 downloads per 2 years] Read an article about this idea
Stars: ✭ 15 (-21.05%)
Mutual labels:  interoperability
jni
V wrapper around the C Java Native Interface
Stars: ✭ 15 (-21.05%)
Mutual labels:  interoperability
syscoin
Syscoin is a crypto currency that is universally merge-mineable and offers a unique variety of services including decentralized identities, asset token issuance platform capabilities directly on the blockchain and trustless 0-counterparty interoptibility with the Ethereum blockchain
Stars: ✭ 152 (+700%)
Mutual labels:  interoperability
speckle-unity
AEC Interoperability for Unity through Speckle
Stars: ✭ 28 (+47.37%)
Mutual labels:  interoperability
Queue Interop
Promoting the interoperability of message queue objects.
Stars: ✭ 399 (+2000%)
Mutual labels:  interoperability
speckle-server
The Speckle Server, Frontend, 3D Viewer, & other JS utilities.
Stars: ✭ 224 (+1078.95%)
Mutual labels:  interoperability
Bitxhub
Interchain protocol 跨链协议
Stars: ✭ 286 (+1405.26%)
Mutual labels:  interoperability
bnbridge.exchange
https://bnbridge.exchange
Stars: ✭ 43 (+126.32%)
Mutual labels:  interoperability
promise
Common interface for simple asynchronous placeholders.
Stars: ✭ 66 (+247.37%)
Mutual labels:  interoperability
nxtp
Nxtp is a lightweight protocol for generalized crosschain transfers.
Stars: ✭ 129 (+578.95%)
Mutual labels:  interoperability
Objective-CPP
C++ compatibility library for Objective-C - Objective-CPP is a library intended to ease software development using Objective-C++. It declares categories on Objective-C classes, to work with the STL C++ types, such as std::string, std::vector, etc.
Stars: ✭ 37 (+94.74%)
Mutual labels:  interoperability
Hint
💡 A hinting engine for the web
Stars: ✭ 3,280 (+17163.16%)
Mutual labels:  interoperability
speckle-qgis
QGIS Connector for Speckle 2.0
Stars: ✭ 17 (-10.53%)
Mutual labels:  interoperability
elements
Lovingly crafted ui components based on web components. Works well with all Frameworks - including Angular, React and Vue.
Stars: ✭ 42 (+121.05%)
Mutual labels:  interoperability
Haskellr
The full power of R in Haskell.
Stars: ✭ 491 (+2484.21%)
Mutual labels:  interoperability
Connect
The swiss army knife of healthcare integration.
Stars: ✭ 326 (+1615.79%)
Mutual labels:  interoperability
Sharpgentools
Accurate and high performance C++ interop code generator for C#.
Stars: ✭ 275 (+1347.37%)
Mutual labels:  interoperability

📍 CPyKE - C/Python Kludge Eliminator 📍

Have you ever noticed how long boilerplate C++ code takes only several lines in Python? Want to avoid wrapper scripts for simple plotting and dataframe analysis?

Keep the productivity of Python and the performance of C++ with cpyke!

cpyke links as a separate dynamic library (.so/.dll), so no special flags or CMake modules are necessary. Compile cpyke once against Python and reuse in any application directly.

Executing commands

As easy as cpyke:

int a = cpyke("1 + 2");
printf("a = %d\n", a); // a = 3

cpyke("import numpy as np");
cpy::ndarray<double> b = cpyke("np.random.rand(something, else_)", a, 4);
cpyke("print('shape:', b.shape)", b); // shape: (3, 4)

Installing packages

With cpyke_pip_install, you can install packages directly from your C++ program, ensuring anyone who runs your application will have the right modules.

cpyke("import seaborn as sns"); // ModuleNotFoundError
cpyke_pip_install("seaborn");
cpyke("import seaborn as sns"); // import successful!

Behind the scenes

cpyke is a seamless wrapper around the amazing pybind11 library. The cpyke C++ library calls the cpyke Python module, which analyzes the given code to find undefined variables (by order of appearance), mapping them to the arguments.

For example: cpyke("print(a, b.c)", d, e); will map d in C++ to a in Python, and e in C++ to b in Python.

Compiling and installing cpyke

$ git clone --recursive https://github.com/tbennun/cpyke.git
$ cd cpyke
$ mkdir build
$ cd build

$ cmake .. 
# If a specific version of Python is required, use 
# cmake -DPYBIND11_PYTHON_VERSION=3.7 ..
# or
# cmake -DPYTHON_EXECUTABLE=/path/to/python ..
# instead.

$ make
# To install: 
$ sudo make install
# If you wish to install manually, ensure cpyke.h and libcpyke.so are accessible
# (using CPATH and LD_LIBRARY_PATH) and install the cpyke Python module with:
# python -m pip install /path/to/cpyke

Linking with cpyke

Nothing more than adding cpyke as a library. For example: g++ myfile.cpp -lcpyke -o myfile

Dependencies and supported compilers

All dependencies are included as git submodules. Compiling cpyke or linking with it requires only a C++11 compiler (GCC 4.8 or newer, clang 3.3 or newer, VS2015 update 3 or newer etc.).

Contributing

cpyke is licensed under the New BSD (3-clause) license. Any contributions are welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].