{"id":19863496,"url":"https://github.com/sandialabs/staged-script","last_synced_at":"2025-05-02T04:31:04.952Z","repository":{"id":237077187,"uuid":"788687122","full_name":"sandialabs/staged-script","owner":"sandialabs","description":"A Python package enabling the development of robust automation scripts that are subdivided into stages.","archived":false,"fork":false,"pushed_at":"2025-04-24T13:02:00.000Z","size":573,"stargazers_count":21,"open_issues_count":18,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T14:22:57.266Z","etag":null,"topics":["replicability","reproducibility","scr-3001","scripting","snl-build-tools","snl-comp-science-libs","snl-os-sys-software","snl-performance-workflow"],"latest_commit_sha":null,"homepage":"","language":"Python","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/sandialabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-18T22:22:50.000Z","updated_at":"2025-04-24T13:02:03.000Z","dependencies_parsed_at":"2024-04-29T22:06:47.267Z","dependency_job_id":"21c4ae0b-a397-481f-9c79-a5368258dd2e","html_url":"https://github.com/sandialabs/staged-script","commit_stats":null,"previous_names":["sandialabs/staged-script"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Fstaged-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Fstaged-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Fstaged-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Fstaged-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandialabs","download_url":"https://codeload.github.com/sandialabs/staged-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251986758,"owners_count":21675951,"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":["replicability","reproducibility","scr-3001","scripting","snl-build-tools","snl-comp-science-libs","snl-os-sys-software","snl-performance-workflow"],"created_at":"2024-11-12T15:14:54.375Z","updated_at":"2025-05-02T04:31:04.939Z","avatar_url":"https://github.com/sandialabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Lines of code](https://sloc.xyz/github/sandialabs/staged-script/?category=code)\n[![codecov](https://codecov.io/gh/sandialabs/staged-script/branch/master/graph/badge.svg?token=FmDStZ6FVR)](https://codecov.io/gh/sandialabs/staged-script)\n[![CodeFactor](https://www.codefactor.io/repository/github/sandialabs/staged-script/badge/master)](https://www.codefactor.io/repository/github/sandialabs/staged-script/overview/master)\n[![CodeQL](https://github.com/sandialabs/staged-script/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/sandialabs/staged-script/actions/workflows/github-code-scanning/codeql)\n[![Conda Version](https://img.shields.io/conda/v/conda-forge/staged-script?label=conda-forge)](https://anaconda.org/conda-forge/staged-script)\n![Conda Downloads](https://img.shields.io/conda/d/conda-forge/staged-script?label=conda-forge%20downloads)\n[![Continuous Integration](https://github.com/sandialabs/staged-script/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/sandialabs/staged-script/actions/workflows/continuous-integration.yml)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n[![GitHub contributors](https://img.shields.io/github/contributors/sandialabs/staged-script.svg)](https://github.com/sandialabs/staged-script/graphs/contributors)\n[![Documentation Status](https://readthedocs.org/projects/staged-script/badge/?version=latest)](https://staged-script.readthedocs.io/en/latest/?badge=latest)\n[![License](https://anaconda.org/conda-forge/staged-script/badges/license.svg)](LICENSE.md)\n[![Merged PRs](https://img.shields.io/github/issues-pr-closed-raw/sandialabs/staged-script.svg?label=merged+PRs)](https://github.com/sandialabs/staged-script/pulls?q=is:pr+is:merged)\n[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8864/badge)](https://bestpractices.coreinfrastructure.org/projects/8864)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sandialabs/staged-script/badge)](https://securityscorecards.dev/viewer/?uri=github.com/sandialabs/staged-script)\n![Platforms](https://anaconda.org/conda-forge/staged-script/badges/platforms.svg)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)\n[![pre-commit.ci Status](https://results.pre-commit.ci/badge/github/sandialabs/staged-script/master.svg)](https://results.pre-commit.ci/latest/github/sandialabs/staged-script/master)\n[![PyPI - Version](https://img.shields.io/pypi/v/staged-script?label=PyPI)](https://pypi.org/project/staged-script/)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/staged-script?label=PyPI%20downloads)\n![Python Version](https://img.shields.io/badge/Python-3.9|3.10|3.11|3.12|3.13-blue.svg)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n# staged-script\n\nPython is an ideal language for certain types of infrastructure automation.\nAutomating what a user does manually often involves walking through a series of\nstages.  A user may wish to run all the stages in series, or perhaps only a\nsubset, and depending on how things go, certain stages may need to be retried.\nOnce the script finishes running, it'd be ideal if it could tell the user\nexactly what was run, for the sake of easing replicability.  `staged-script`\naims to ease the development such automation scripts.  It's easy to get started\nwith, but also provides significant power-user functionality for those who need\nit.\n\n## Installation\n\nTo get up and running with `staged-script`, simply:\n```bash\npython3 -m pip install staged-script\n```\n\n## Usage\n\nOnce installed, you can simply\n```python\nimport sys\n\nfrom staged_script import StagedScript\n\n\nclass MyScript(StagedScript):\n\n    @StagedScript.stage(\"hello\", \"Greeting the user\")\n    def say_hello(self) -\u003e None:\n        self.run(\"echo 'Hello World'\", shell=True)\n\n    @StagedScript.stage(\"goodbye\", \"Bidding farewell\")\n    def say_goodbye(self) -\u003e None:\n        self.run(\"echo 'Goodbye World'\", shell=True)\n\n    def main(self, argv: list[str]) -\u003e None:\n        self.parse_args(argv)\n        try:\n            self.say_hello()\n            self.say_goodbye()\n        finally:\n            self.print_script_execution_summary()\n\n\nif __name__ == \"__main__\":\n    my_script = MyScript({\"hello\", \"goodbye\"})\n    my_script.main(sys.argv[1:])\n```\n\nFor more detailed usage and API information, please see\n[our documentation][docs].\n\n[docs]: https://staged-script.readthedocs.io\n\n## Where to Get Help\n\nIf you're having trouble with `staged-script`, or just want to ask a question,\nhead on over to [our issue board][issues].  If a quick search doesn't yield\nwhat you're looking for, feel free to file an issue.\n\n[issues]: https://github.com/sandialabs/staged-script/issues\n\n## Contributing\n\nIf you're interested in contributing to the development of `staged-script`,\nwe'd love to have your help :grinning:  Check out our\n[contributing guidelines](CONTRIBUTING.md) for how to get started.\n[Past contributors][contributors] include:\n* [@jmgate](https://github.com/jmgate)\n\n[contributors]: https://github.com/sandialabs/staged-script/graphs/contributors\n\n## License \u0026 Copyright\n\nSee [LICENSE.md](LICENSE.md) and [COPYRIGHT.md](COPYRIGHT.md).\n\n## Credits\n\nSpecial thanks to [the GMS project][gms] for investing in the development of\nthis package.  Aspects of this functionality were inspired by the\n[SPiFI][spifi] Jenkins Pipeline plugin and the [ShellLogger][shelllogger]\nPython package.\n\n[gms]: https://github.com/SNL-GMS/GMS-PI25\n[spifi]: https://github.com/sandialabs/SPiFI\n[shelllogger]: https://github.com/sandialabs/shell-logger\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandialabs%2Fstaged-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandialabs%2Fstaged-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandialabs%2Fstaged-script/lists"}