{"id":16902285,"url":"https://github.com/benjaminjack/python_cpp_example","last_synced_at":"2025-04-03T02:11:16.401Z","repository":{"id":45398951,"uuid":"91860093","full_name":"benjaminjack/python_cpp_example","owner":"benjaminjack","description":"An example of a hybrid python/C++ package with unit tests","archived":false,"fork":false,"pushed_at":"2019-11-01T16:26:28.000Z","size":198,"stargazers_count":144,"open_issues_count":3,"forks_count":24,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T08:23:56.805Z","etag":null,"topics":["catch-tests","cmake","cpp","pybind11","python","python-cpp","setuptools","unittest"],"latest_commit_sha":null,"homepage":"http://www.benjack.io/2018/02/02/python-cpp-revisited.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benjaminjack.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}},"created_at":"2017-05-20T02:34:26.000Z","updated_at":"2025-01-12T04:27:53.000Z","dependencies_parsed_at":"2022-09-08T22:32:01.788Z","dependency_job_id":null,"html_url":"https://github.com/benjaminjack/python_cpp_example","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminjack%2Fpython_cpp_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminjack%2Fpython_cpp_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminjack%2Fpython_cpp_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminjack%2Fpython_cpp_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjaminjack","download_url":"https://codeload.github.com/benjaminjack/python_cpp_example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246922247,"owners_count":20855345,"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","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":["catch-tests","cmake","cpp","pybind11","python","python-cpp","setuptools","unittest"],"created_at":"2024-10-13T18:05:21.676Z","updated_at":"2025-04-03T02:11:16.380Z","avatar_url":"https://github.com/benjaminjack.png","language":"Python","readme":"# python_cpp_example\n\nThis repository contains an example Python module which wraps C++ code. The code presented here was designed to meet four requirements:\n\n1. Python bindings for C++ code (using [`pybind11`](http://pybind11.readthedocs.io/en/stable/index.html) and built with [CMake](http://cmake.org))\n2. Unit tests for C++ code (using [`catch`](http://catch-lib.net))\n3. Unit tests for Python code (using `unittest`)\n4. A `setuptools` setup.py script for building, installation, and testing\n\nPlease see the [blog post that accompanies this repository](http://www.benjack.io/2018/02/02/python-cpp-revisited.html) for more information.\n\n**NOTE**: If you'd like to see the version of the repository that corresponds to my [original June 2017 blog post](http://www.benjack.io/2017/06/12/python-cpp-tests.html), go to [this release](https://github.com/benjaminjack/python_cpp_example/tree/v0.1). However, I no longer recommend using the repository structure from this old release.\n\n# Installation\n\nTo build and install `python_cpp_example`, clone or download this repository and then, from within the repository, run:\n\n```bash\npython3 ./setup.py install\n```\n\nor\n\n```bash\npip3 install .\n```\n\n# Tests\n\nTo execute all unit tests, run the following command:\n\n```bash\npython3 ./setup.py test\n```\n\n# Requirements\n\n- Python 2 or 3\n- CMake 2.8.12 or higher\n- A modern compiler with C++11 support\n\n# Acknowledgements\n\nMuch of the code in this repository was adapted from the [`pybind11` tutorial](http://pybind11.readthedocs.io/en/stable/basics.html) and the [`pybind11` example CMake repository](https://github.com/pybind/cmake_example).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminjack%2Fpython_cpp_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjaminjack%2Fpython_cpp_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminjack%2Fpython_cpp_example/lists"}