{"id":13627399,"url":"https://github.com/libigl/libigl-python-bindings","last_synced_at":"2025-05-14T18:02:34.727Z","repository":{"id":38685962,"uuid":"178422326","full_name":"libigl/libigl-python-bindings","owner":"libigl","description":"libigl python bindings","archived":false,"fork":false,"pushed_at":"2025-05-13T14:14:54.000Z","size":74873,"stargazers_count":342,"open_issues_count":6,"forks_count":67,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-13T15:39:59.323Z","etag":null,"topics":["conda","easy-to-use","fast","geometry-processing","python"],"latest_commit_sha":null,"homepage":"https://libigl.github.io/libigl-python-bindings/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libigl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.GPL","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,"zenodo":null}},"created_at":"2019-03-29T14:39:48.000Z","updated_at":"2025-05-08T14:52:21.000Z","dependencies_parsed_at":"2025-04-14T22:19:34.028Z","dependency_job_id":null,"html_url":"https://github.com/libigl/libigl-python-bindings","commit_stats":{"total_commits":722,"total_committers":27,"mean_commits":26.74074074074074,"dds":0.4944598337950139,"last_synced_commit":"a2d0b232b7e1195a67d8fe8918b4eb7a8ac720d4"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libigl%2Flibigl-python-bindings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libigl%2Flibigl-python-bindings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libigl%2Flibigl-python-bindings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libigl%2Flibigl-python-bindings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libigl","download_url":"https://codeload.github.com/libigl/libigl-python-bindings/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990234,"owners_count":21995772,"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":["conda","easy-to-use","fast","geometry-processing","python"],"created_at":"2024-08-01T22:00:33.673Z","updated_at":"2025-05-14T18:02:29.705Z","avatar_url":"https://github.com/libigl.png","language":"C++","readme":"# libigl Python Bindings\n[![PyPI version](https://badge.fury.io/py/libigl.svg)](https://pypi.org/project/libigl/)\n[![buildwheels](https://github.com/libigl/libigl-python-bindings/actions/workflows/wheels.yml/badge.svg)](https://github.com/libigl/libigl-python-bindings/actions/workflows/wheels.yml?query=branch%3Amain)\n\nThis repository contains the source code for the python bindings for the C++\n[libigl](https://github.com/libigl/libigl) library written using\n[nanobind](https://nanobind.readthedocs.io/en/latest/). Functions allow NumPy\narrays as input and output for dense matrices and vectors and SciPy sparse\nmatrices for sparse matrices. \n\n## Installation\n\n```\npython -m pip install libigl\n```\n\n## Documentation\n\n| :warning: WARNING           |\n|:----------------------------|\n| The [python-binding documentation](https://libigl.github.io/libigl-python-bindings/) is perennially out of date and will likely be removed/changed. |\n\n* A tutorial on how to use the bindings can be found [here](https://libigl.github.io/libigl-python-bindings/tutorials/)\n* A function reference can be found [here](https://libigl.github.io/libigl-python-bindings/igl_docs/)\n\n## Getting the current version of libigl within python code\n\nSince version 2.5.4.dev0, the `igl.__version__` attribute has been removed. To\nget the version of the libigl package you're using within your python code, you\ncan use the following code:\n\n```\nimport importlib.metadata\nlibigl_version = importlib.metadata.version('libigl')\n```\n\nThe version of libigl is defined in the [pyproject.toml](./pyproject.toml) file.\n\n\n## Compiling and modifying the bindiings\n\nAccording to the [scikit-build-core documentation](https://scikit-build-core.readthedocs.io/en/latest/configuration.html#editable-installs), the way to make an editable (incremental) build is to:\n\n 1. Preinstall the dependencies (at the top of pyproject.toml \n 2. Then use this very long command:\n\n```\npython -m pip install --no-build-isolation --config-settings=editable.rebuild=true -Cbuild-dir=build -ve.\n```\n\n### Adding a missing binding\n\nBindings are fairly mechanical to write. For example, suppose we didn't have a\nbinding for the c++ function `igl::moments`. The first step would be to look at\nthe corresponding `.h` header file in the C++ libigl library:\n[moments.h](https://github.com/libigl/libigl/blob/main/include/igl/moments.h).\n\nThen we would create the [src/moments.cpp](src/moments.cpp) file in this project\nwhich uses `Eigen::MatrixXN` for numeric types and `Eigen::MatrixXI` for integer\ntypes. Typically this requires a simple wrapper around the function matching\nits signature to these types and some boilerplate `void bind_moments(...` code which adds the function to the python module.\n\nSimply adding this `.cpp` file will be enough to add the bindings on the next\nbuild.\n\nIf submitting a pull request with a new binding, please also add an execution\ntest in `tests/test_all.py` to ensure the binding can at least be called as\nexpected.\n\n\n## Testing cibuildwheel locally\n\nInstall whichever version of Python from the [official website](https://www.python.org/downloads/) and then run:\n\n    /Library/Frameworks/Python.framework/Versions/[version]/bin/python -m pip install cibuildwheel\n    CIBW_BUILD=\"cp311-*\" python -m cibuildwheel --output-dir wheelhouse --platform macos\n\n## Downloading all the artifacts\n\nA successful [.github/workflows/wheels.yml](.github/workflows/wheels.yml) run will a lot of `.whl` files. To download these all at once, you can use the following command:\n\n    mkdir wheelhouse\n    cd wheelhouse\n    gh run download [runid]\n\nThen these can be uploaded to pypi using:\n\n    python -m twine upload --repository testpypi wheelhouse/*/*.whl wheelhouse/*/*.tar.gz\n\n## Acknowledgements\n\nThe original python bindings were generated and maintained by\n[@teseoch](https://github.com/teseoch),\n[@KarlLeell](https://github.com/KarlLeell),\n[@fwilliams](https://github.com/fwilliams),\n[@skoch9](https://github.com/skoch9), and\n[@danielepanozzo](https://github.com/danielepanozzo)\n\nThe modern python bindings (since 2.5.4.dev0) can largely be blamed on\n[@alecjacobson](https://github.com/alecjacobson).\n","funding_links":[],"categories":["General Libraries","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibigl%2Flibigl-python-bindings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibigl%2Flibigl-python-bindings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibigl%2Flibigl-python-bindings/lists"}