{"id":17633016,"url":"https://github.com/tbennun/cpyke","last_synced_at":"2025-08-25T20:13:46.617Z","repository":{"id":86423111,"uuid":"271675958","full_name":"tbennun/cpyke","owner":"tbennun","description":"Easy integrated Python scripting embedded in C++","archived":false,"fork":false,"pushed_at":"2020-06-25T06:01:11.000Z","size":19,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-30T08:35:40.739Z","etag":null,"topics":["cpp","interoperability","python"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tbennun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-12T00:51:25.000Z","updated_at":"2025-02-26T20:35:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"879ec609-117e-44e1-a919-2cb3213820fb","html_url":"https://github.com/tbennun/cpyke","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tbennun/cpyke","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbennun%2Fcpyke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbennun%2Fcpyke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbennun%2Fcpyke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbennun%2Fcpyke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tbennun","download_url":"https://codeload.github.com/tbennun/cpyke/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbennun%2Fcpyke/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272124773,"owners_count":24877726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","interoperability","python"],"created_at":"2024-10-23T01:47:11.197Z","updated_at":"2025-08-25T20:13:46.536Z","avatar_url":"https://github.com/tbennun.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📍 CPyKE - C/Python Kludge Eliminator 📍\n\nHave you ever noticed how long boilerplate C++ code takes only several lines \nin Python? Want to avoid wrapper scripts for simple plotting and dataframe \nanalysis?\n\nKeep the productivity of Python and the performance of C++ with cpyke!\n\ncpyke links as a separate dynamic library (.so/.dll), so no special flags or \nCMake modules are necessary. Compile cpyke once against Python and reuse in any\napplication directly.\n\n## Executing commands\n\nAs easy as `cpyke`:\n\n```cpp\nint a = cpyke(\"1 + 2\");\nprintf(\"a = %d\\n\", a); // a = 3\n\ncpyke(\"import numpy as np\");\ncpy::ndarray\u003cdouble\u003e b = cpyke(\"np.random.rand(something, else_)\", a, 4);\ncpyke(\"print('shape:', b.shape)\", b); // shape: (3, 4)\n```\n\n## Installing packages\n\nWith `cpyke_pip_install`, you can install packages directly from your C++ \nprogram, ensuring anyone who runs your application will have the right modules.\n\n```cpp\ncpyke(\"import seaborn as sns\"); // ModuleNotFoundError\ncpyke_pip_install(\"seaborn\");\ncpyke(\"import seaborn as sns\"); // import successful!\n```\n\n## Behind the scenes\ncpyke is a seamless wrapper around the amazing [pybind11](https://github.com/pybind/pybind11) library.\nThe cpyke C++ library calls the cpyke Python module, which analyzes the given \ncode to find undefined variables (by order of appearance), mapping them to the arguments.\n\nFor example: `cpyke(\"print(a, b.c)\", d, e);` will map `d` in C++ to `a` in Python,\nand `e` in C++ to `b` in Python.\n\n## Compiling and installing cpyke\n```shell\n$ git clone --recursive https://github.com/tbennun/cpyke.git\n$ cd cpyke\n$ mkdir build\n$ cd build\n\n$ cmake .. \n# If a specific version of Python is required, use \n# cmake -DPYBIND11_PYTHON_VERSION=3.7 ..\n# or\n# cmake -DPYTHON_EXECUTABLE=/path/to/python ..\n# instead.\n\n$ make\n# To install: \n$ sudo make install\n# If you wish to install manually, ensure cpyke.h and libcpyke.so are accessible\n# (using CPATH and LD_LIBRARY_PATH) and install the cpyke Python module with:\n# python -m pip install /path/to/cpyke\n```\n\n## Linking with cpyke\nNothing more than adding cpyke as a library. For example:\n`g++ myfile.cpp -lcpyke -o myfile`\n\n## Dependencies and supported compilers\nAll dependencies are included as git submodules. Compiling cpyke or linking \nwith it requires only a C++11 compiler (GCC 4.8 or newer, clang 3.3 or newer, \nVS2015 update 3 or newer etc.).\n\n## Contributing\n\ncpyke is licensed under the New BSD (3-clause) license. \nAny contributions are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbennun%2Fcpyke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbennun%2Fcpyke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbennun%2Fcpyke/lists"}