{"id":16328128,"url":"https://github.com/terminaldweller/luatablegen","last_synced_at":"2026-05-18T02:31:49.993Z","repository":{"id":109635462,"uuid":"138706768","full_name":"terminaldweller/luatablegen","owner":"terminaldweller","description":"Generate Lua tables from C structures automatically.","archived":false,"fork":false,"pushed_at":"2019-07-12T12:49:44.000Z","size":64,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T20:49:35.965Z","etag":null,"topics":["codegen","codegenerator","lua","lua-table"],"latest_commit_sha":null,"homepage":"","language":"Python","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/terminaldweller.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":"2018-06-26T08:18:20.000Z","updated_at":"2019-07-12T12:49:46.000Z","dependencies_parsed_at":"2023-03-13T14:06:55.847Z","dependency_job_id":null,"html_url":"https://github.com/terminaldweller/luatablegen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/terminaldweller/luatablegen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminaldweller%2Fluatablegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminaldweller%2Fluatablegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminaldweller%2Fluatablegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminaldweller%2Fluatablegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terminaldweller","download_url":"https://codeload.github.com/terminaldweller/luatablegen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terminaldweller%2Fluatablegen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272356664,"owners_count":24920356,"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-27T02:00:09.397Z","response_time":76,"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":["codegen","codegenerator","lua","lua-table"],"created_at":"2024-10-10T23:13:47.386Z","updated_at":"2026-05-18T02:31:44.961Z","avatar_url":"https://github.com/terminaldweller.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# luatablegen\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fbloodstalker%2Fluatablegen.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fbloodstalker%2Fluatablegen?ref=badge_shield)\n\n\n`luatablegen` takes a list of C structures and generates lua tables in C.\u003cbr/\u003e\nThe input is in the form of a JSON file that describes the C structure and the Lua types you want.\u003cbr/\u003e\nEach structure will have it's own pair of C source and header. There is an option for an aggregate header which will include all the headers and in has a function that registers all the tables with Lua.\u003cbr/\u003e\n`luatablegen` will generate a lua file that includes default constructors for all tables which you can use in Lua with `require`. luatablegen will also generate a markdown file listing the methods for the tables.\u003cbr/\u003e\nFor an example you can look under the test directory.\u003cbr/\u003e\n\n## Lua Version\nThe generated code is supposed to be used with lua 5.3.\u003cbr/\u003e\n\n## table gen file\n\nEach entry in the JSON file should have the following fields:\u003cbr/\u003e\n* field_name: a list of the names of the C structure field names.\u003cbr/\u003e\n* field_type: a list of the names of the C types for the C structure fields.\u003cbr/\u003e\n* lua_type: a list of the names of the lua types that the Lua table fields corresponding to the C structure fields will have.\u003cbr/\u003e\n* methods: a list of the methods that will be generated for the Lua table corresponding to the C structure.\u003cbr/\u003e\n\n## Options\n\n```bash\n  -h, --help            show this help message and exit\n  --out OUT             output directory\n  --tbg TBG             the table gen file\n  --pre PRE             path to source code file to add after header\n                        guard/extern c\n  --post POST           path to source code file to add before header\n                        guard/extern c end\n  --luaheader LUAHEADER\n                        path to lua header files\n  --dbg                 debug\n  --singlefile          should all the generated code be added to a single\n                        file\n  --makemacro           generate a makefile containing all objects in a macro\n                        to be included by another makefile\n  --outfile OUTFILE     name of the output file if signlefile is set, ignored\n                        otherwise\n  --headeraggr HEADERAGGR\n                        header aggregate file name\n  --lualibpath LUALIBPATH\n                        where the lua module file will be placed\n  --docpath DOCPATH     where the doc file will be placed\n```\n\n## Projects\nThe list of the projects that use luatablegen:\u003cbr/\u003e\n* [bruiser](https://github.com/bloodstalker/mutator/tree/master/bruiser)\u003cbr/\u003e\n\n## TODO\n* fields should be able to reference each other.\u003cbr/\u003e\n* add more options for the table fileds.\u003cbr/\u003e\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fbloodstalker%2Fluatablegen.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fbloodstalker%2Fluatablegen?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterminaldweller%2Fluatablegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterminaldweller%2Fluatablegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterminaldweller%2Fluatablegen/lists"}