{"id":19705723,"url":"https://github.com/llnl/shroud","last_synced_at":"2025-04-05T04:08:42.687Z","repository":{"id":25797681,"uuid":"106583435","full_name":"LLNL/shroud","owner":"LLNL","description":"Shroud: generate Fortran and Python wrappers for C and C++ libraries","archived":false,"fork":false,"pushed_at":"2025-02-24T01:48:51.000Z","size":33674,"stargazers_count":90,"open_issues_count":11,"forks_count":7,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-03-29T03:03:36.042Z","etag":null,"topics":["build-tools","c","c-plus-plus","cpp","fortran","language-bindings","python","radiuss"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LLNL.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-10-11T16:58:45.000Z","updated_at":"2025-02-24T01:46:42.000Z","dependencies_parsed_at":"2023-10-14T17:03:35.986Z","dependency_job_id":"b60c9575-6586-46ed-beff-416851fd5ddd","html_url":"https://github.com/LLNL/shroud","commit_stats":{"total_commits":3289,"total_committers":8,"mean_commits":411.125,"dds":"0.46944359987838247","last_synced_commit":"c2a2d976d64fea07056ce2f81d971d72fd4037c0"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2Fshroud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2Fshroud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2Fshroud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2Fshroud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LLNL","download_url":"https://codeload.github.com/LLNL/shroud/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284943,"owners_count":20913704,"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":["build-tools","c","c-plus-plus","cpp","fortran","language-bindings","python","radiuss"],"created_at":"2024-11-11T21:29:55.285Z","updated_at":"2025-04-05T04:08:42.664Z","avatar_url":"https://github.com/LLNL.png","language":"Fortran","readme":"# Shroud: generate Fortran and Python wrappers for C and C++ libraries.\n\n**Shroud** is a tool for creating a Fortran or Python interface to a C\nor C++ library.  It can also create a C API for a C++ library.\n\nThe user creates a YAML file with the C/C++ declarations to be wrapped\nalong with some annotations to provide semantic information and code\ngeneration options.  **Shroud** produces a wrapper for the library.\nThe generated code is highly-readable and intended to be similar to code\nthat would be hand-written to create the bindings.\n\nverb\n1. wrap or dress (a body) in a shroud for burial.\n2. cover or envelop so as to conceal from view.\n\n[![Build Status](https://github.com/llnl/shroud/actions/workflows/python-test.yml/badge.svg)](https://github.com/llnl/shroud/actions/workflows/python-test.yml)\n[![Documentation Status](https://readthedocs.org/projects/shroud/badge/?version=develop)](http://shroud.readthedocs.io/en/latest/?badge=develop)\n\n## Goals\n\n- Simplify the creating of wrapper for a C++ library.\n- Preserves the object-oriented style of C++ classes.\n- Create an idiomatic wrapper API from the C++ API.\n- Generate code which is easy to understand.\n- No dependent runtime library.\n\n## Example\n\nThe user creates a YAML file which includes declarations from `zoo.hpp`.\n\n```\nlibrary: zoo\ncxx_header: zoo.hpp\n\ndeclarations:\n- decl: class Animal\n  declarations:\n  - decl: Animal()\n  - decl: void speak(const std::string \u0026word)\n```\nThis creates a Fortran interface which can be used as:\n\n```\nuse zoo_mod\ntype(Animal) dog\ndog = Animal()\ndog%speak(\"woof\")\n```\n\nAnd from Python\n\n```\nimport zoo\ndog = zoo.Animal()\ndog.speak(\"woof\")\n```\n\n## Documentation\n\nTo get started using Shroud, check out the full documentation:\n\nhttp://shroud.readthedocs.io/en/develop\n\nPresentation at FortranCon2020\n\nhttps://www.youtube.com/watch?v=1mdI-M94vDc\n[Slides](./pdf/Shroud-forcon.pdf)\n\n## Mailing List\n\nshroud-users@groups.io\n\nhttps://groups.io/g/shroud-users\n\n## Required Packages\n\n*  yaml - https://pypi.python.org/pypi/PyYAML\n\n## C++ to C to Fortran\n\nThe generated Fortran requires a Fortran 2003 compiler.\n\n## C++ or C to Python\n\nThe generated Python requires Python 2.7 or 3.4+.\n\nPython features:\n\n- Uses NumPy for arrays. Also able to use Python lists if NumPy is overkill.\n- Uses extension type for classes.\n- Creates readable source.\n\n## Getting started\n\nShroud can be installed using pip\n\n```\npip install llnl-shroud\n```\n\nThis can be done in a virtual environment as\n\n```\ncd my_project_folder\nvirtualenv my_project\nsource my_project/bin/activate\npip install llnl-shroud\n```\n\nThis assumes the bash shell. Source activate.csh for csh.\n\nIn addition, a file created by\n[shiv](https://github.com/linkedin/shiv)\nis available from the github release.\nShroud and PyYAML are bundled into a single executable which uses\nthe Python3 on your path.\nShiv requires Python 3.6+.\n\n```\nwget https://github.com/LLNL/shroud/archive/shroud-0.13.0.pyz\n```\n\n\n## License\n\nCopyright (c) 2017-2025, Lawrence Livermore National Security, LLC.\nProduced at the Lawrence Livermore National Laboratory.\n\nSPDX-License-Identifier: (BSD-3-Clause)\n\nSee [LICENSE](./LICENSE) for details\n\nUnlimited Open Source - BSD 3-clause Distribution\n`LLNL-CODE-738041`  `OCEC-17-143`\n\nSPDX usage\n------------\n\nIndividual files contain SPDX tags instead of the full license text.\nThis enables machine processing of license information based on the SPDX\nLicense Identifiers that are available here: https://spdx.org/licenses/\n\nFiles that are licensed as BSD 3-Clause contain the following\ntext in the license header:\n\nSPDX-License-Identifier: (BSD-3-Clause)\n\nExternal Packages\n-------------------\nShroud bundles some of its external dependencies in its repository.  These\npackages are covered by various permissive licenses.  A summary listing\nfollows.  See the license included with each package for full details.\n\n[//]: # (Note: The spaces at the end of each line below add line breaks)\n\nPackageName: fruit  \nPackageHomePage: https://sourceforge.net/projects/fortranxunit/  \nPackageLicenseDeclared: BSD-3-Clause  \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllnl%2Fshroud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllnl%2Fshroud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllnl%2Fshroud/lists"}