{"id":34054497,"url":"https://github.com/pybind/pybind11_mkdoc","last_synced_at":"2026-04-05T17:39:59.930Z","repository":{"id":40692104,"uuid":"295504080","full_name":"pybind/pybind11_mkdoc","owner":"pybind","description":"Pybind11 tool for making docstrings from C++ comments","archived":false,"fork":false,"pushed_at":"2026-01-15T17:33:57.000Z","size":77,"stargazers_count":44,"open_issues_count":9,"forks_count":25,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-15T20:15:28.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/pybind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-09-14T18:28:54.000Z","updated_at":"2026-01-15T17:34:01.000Z","dependencies_parsed_at":"2024-04-24T03:30:12.755Z","dependency_job_id":"b5702f16-8252-41bd-8cf7-c9514c3014b4","html_url":"https://github.com/pybind/pybind11_mkdoc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pybind/pybind11_mkdoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybind%2Fpybind11_mkdoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybind%2Fpybind11_mkdoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybind%2Fpybind11_mkdoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybind%2Fpybind11_mkdoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pybind","download_url":"https://codeload.github.com/pybind/pybind11_mkdoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybind%2Fpybind11_mkdoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31444702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T15:22:31.103Z","status":"ssl_error","status_checked_at":"2026-04-05T15:22:00.205Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-12-14T02:16:55.444Z","updated_at":"2026-04-05T17:39:59.924Z","avatar_url":"https://github.com/pybind.png","language":"Python","readme":"# pybind11_mkdoc\n\n[![CI](https://github.com/pybind/pybind11_mkdoc/workflows/CI/badge.svg)](https://github.com/pybind/pybind11_mkdoc/actions)\n\nThis tool processes a sequence of C/C++ headers and extracts comments that can\nbe referenced to generate docstrings in pybind11 binding code.\n\n\nTo install the latest development version:\n\n```bash\npython -m pip install git+https://github.com/pybind/pybind11_mkdoc.git\n```\n\n## Usage\n\nTo use this tool, simply invoke it with a list of header files. All output will\nbe written to ``stdout``, or to a filename provided via the ``-o`` parameter.\n\n```bash\npython -m pybind11_mkdoc -o docstrings.h header_file_1.h header_file_2.h\n```\n\nOptionally, the path to the `libclang.so` and LLVM directory can be specified by setting the LIBCLANG_PATH and LLVM_DIR_PATH environment variables respectively.\n\nSuppose we provide an input file with the following contents:\n\n```cpp\n/// Docstring 1\nclass MyClass {\n\n    /// Docstring 2\n    MyClass() {\n    }\n\n    /// Docstring 3\n    void foo() {\n    }\n\n    /// Docstring 4 for overload\n    void foo(int bar) {\n    }\n\n    /// Docstring 5 for yet another overload\n    void foo(int bar, int baz) {\n    }\n};\n```\n\nOnce processed via ``pybind11_mkdoc``, the docstrings can be accessed as follows\nfrom pybind11 binding code:\n\n```cpp\n#include \"docstrings.h\"\n\nconst char *docstring_1 = DOC(MyClass);\nconst char *docstring_2 = DOC(MyClass, MyClass);\nconst char *docstring_3 = DOC(MyClass, foo);\nconst char *docstring_4 = DOC(MyClass, foo, 2);\nconst char *docstring_5 = DOC(MyClass, foo, 3);\n```\n\nNote the counter suffix for repeated definitions and docstrings. Namespaces and\nnested classes are also supported, in which case the number of arguments to the\n``DOC`` macro simply increases.\n\nIn practice, the docstrings are likely referenced in a matching set of binding\ndeclarations:\n\n```cpp\n\npy::class_\u003cMyClass\u003e(m, \"MyClass\", DOC(MyClass))\n    .def(py::init\u003c\u003e(), DOC(MyClass, MyClass))\n    ...\n```\n\n## Limitations\n\nThis tool supports Linux and macOS for Python versions 3.8 to 3.11.  Also, it\nrequires Clang/LLVM to be installed.\n\n\n## Testing\n\nInstall the packages `pytest`, `pytest-xdist`, and `flit`:\n```\npython3 -m pip install pytest==7.1.3 pytest-xdist==2.4.0\n```\n\nNext, install this project:\n```\npython3 -m pip install .\n```\n\nAnd execute the tests (forked)\n```\npython3 -m pytest --forked\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpybind%2Fpybind11_mkdoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpybind%2Fpybind11_mkdoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpybind%2Fpybind11_mkdoc/lists"}