{"id":17062616,"url":"https://github.com/wardbrian/cookiecutter-cmdstanpy-wrapper","last_synced_at":"2025-07-14T05:34:16.403Z","repository":{"id":50388767,"uuid":"518916442","full_name":"WardBrian/cookiecutter-cmdstanpy-wrapper","owner":"WardBrian","description":"Easily wrap a Stan model in a Python package","archived":false,"fork":false,"pushed_at":"2024-05-28T16:18:58.000Z","size":21,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T00:08:31.781Z","etag":null,"topics":["cookiecutter","cookiecutter-python","cookiecutter-template","python","stan"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WardBrian.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":"2022-07-28T16:20:36.000Z","updated_at":"2024-01-10T08:29:23.000Z","dependencies_parsed_at":"2023-01-23T20:16:19.615Z","dependency_job_id":null,"html_url":"https://github.com/WardBrian/cookiecutter-cmdstanpy-wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WardBrian%2Fcookiecutter-cmdstanpy-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WardBrian%2Fcookiecutter-cmdstanpy-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WardBrian%2Fcookiecutter-cmdstanpy-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WardBrian%2Fcookiecutter-cmdstanpy-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WardBrian","download_url":"https://codeload.github.com/WardBrian/cookiecutter-cmdstanpy-wrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252788526,"owners_count":21804284,"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":["cookiecutter","cookiecutter-python","cookiecutter-template","python","stan"],"created_at":"2024-10-14T10:50:21.188Z","updated_at":"2025-05-07T00:08:39.068Z","avatar_url":"https://github.com/WardBrian.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cookiecutter-cmdstanpy-wrapper\n\nThis project a [cookiecutter](https://cookiecutter.readthedocs.io/en/stable/index.html)\ntemplate  designed for package developers who wish to wrap a [Stan](mc-stan.org)\nmodel in a Python package.\nIt provides the ability to pre-compile the model as part\nof a Python [wheel](https://pypi.org/project/wheel/), removing the need for end users\nto have a C++ toolchain installed to install or use the package.\n\nThis uses [cmdstanpy](https://github.com/stan-dev/cmdstanpy) as the underlying interface to the Stan model.\n\nIf you're looking instead for a template for doing applied modeling work in CmdStanPy,\ncheck out [cookiecutter-cmdstanpy-analysis](https://github.com/teddygroves/cookiecutter-cmdstanpy-analysis).\n\n\nSee an example based on the output of the template [here](https://github.com/WardBrian/stan_py_example)\n\n## Usage\n\n```\ncookiecutter gh:WardBrian/cookiecutter-cmdstanpy-wrapper\n```\n\nThis will ask you some basic prompts and then generate a folder with skeleton of a Python package.\nThis package will include the setup.py required for building the models as part of the wheel, and\na Github Actions script to do so on MacOS, Linux, and Windows using\n[cibuildwheel](https://cibuildwheel.readthedocs.io/en/stable/).\n\n## How it works\n\nThe process of shipping a pre-compiled Stan model is a bit more complicated than it needs to be\ndue to Stan's reliance on Intel's [TBB](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onetbb.html)\nlibrary.\n\nTo make a Stan model work in the most generality (e.g., on a machine it was not compiled on),\nit needs to also have a compiled dynamic shared object for TBB. This is done by (optionally)\nrepackaging part of the CmdStan distribution alongside the built model. This allows TBB\nto be detected on the new system. The built-in relocation tools in cibuildwheel ensure this\nDSO is relocatable and that the compiled Stan models work.\n\nThe above behavior is only enabled when an environment variable called `PKG_NAME_REDISTRIBUTE_CMDSTAN` is set.\nSource installations assume that the end user has a working CmdStan distribution already.\n\n\n## License\nThis cookiecutter and the building code is licensed under the MIT license.\n\nThis project is modeled on work I assisted with on Facebook's\n[prophet](https://github.com/facebook/prophet/) package, and the yet-unreleased\n[scitkit-stan](https://github.com/WardBrian/scikit-stan) package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwardbrian%2Fcookiecutter-cmdstanpy-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwardbrian%2Fcookiecutter-cmdstanpy-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwardbrian%2Fcookiecutter-cmdstanpy-wrapper/lists"}