
[](https://codecov.io/gh/sandialabs/shell-logger)
[](https://www.codefactor.io/repository/github/sandialabs/shell-logger/overview/master)
[](https://github.com/sandialabs/shell-logger/actions/workflows/github-code-scanning/codeql)
[](https://github.com/sandialabs/shell-logger/actions/workflows/continuous-integration.yml)
[](CODE_OF_CONDUCT.md)
[](https://github.com/sandialabs/shell-logger/graphs/contributors)
[](https://shell-logger.readthedocs.io/en/latest/?badge=latest)
[](LICENSE.md)
[](https://github.com/sandialabs/shell-logger/pulls?q=is:pr+is:merged)
[](https://bestpractices.coreinfrastructure.org/projects/8863)
[](https://securityscorecards.dev/viewer/?uri=github.com/sandialabs/shell-logger)

[](https://github.com/pre-commit/pre-commit)
[](https://results.pre-commit.ci/latest/github/sandialabs/shell-logger/master)
[](https://pypi.org/project/shell-logger-sandialabs/)


[](https://github.com/astral-sh/ruff)
> **NOTICE:** After using this package for a few years, we realized we'd
> attempted to do too many things at once with it. It still provides
> tremendous functionality for a wide variety of use cases, but for particular
> corner cases, it became apparent that design decisions made early on were
> hampering forward progress, and we wouldn't recommend doing things the same
> way today. Certain aspects of its functionality have inspired more focused
> packages ([reverse-argparse][reverse-argparse],
> [staged-script][staged-script]), and we hope to do the same with more
> functionality in the future. For the time being, though, don't expect much
> development and maintenance here. That said, if you use `shell-logger` and
> are eager to contribute to its longevity, let us know.
[reverse-argparse]: https://github.com/sandialabs/reverse_argparse
[staged-script]: https://github.com/sandialabs/staged-script
# shell-logger
The `shell-logger` Python package allows you to interact with the shell, while
logging various metadata, statistics, and trace information. Any time you're
tempted to write your own wrapper around things like `subprocess.Popen()` or
`subprocess.run()`, consider using `shell_logger.ShellLogger.log()` instead.
If you're familiar with [the Unix script command][script], this is similar in
principle, but with substantially more functionality. If you're familiar with
[Python's logging module][logging], the motivation is similar, but this intends
to capture what's happening *in the shell* rather than in Python itself.
[script]: https://man7.org/linux/man-pages/man1/script.1.html
[logging]: https://docs.python.org/3/library/logging.html
## Installation
To get up and running with `shell-logger`, simply:
```bash
python3 -m pip install shell-logger-sandialabs
```
## Usage
Once the package is installed, you can simply
```python
from shell_logger import ShellLogger
sl = ShellLogger("Title of Log File")
sl.log("Execute my first command in the shell.", "echo 'Hello World'")
sl.finalize()
```
For more detailed usage and API information, please see
[our documentation][readthedocs].
[readthedocs]: https://shell-logger.readthedocs.io
## Where to Get Help
If you're having trouble with `shell-logger`, or just want to ask a question,
head on over to [our issue board][issues]. If a quick search doesn't yield
what you're looking for, feel free to file an issue.
[issues]: https://github.com/sandialabs/shell-logger/issues
## Contributing
If you're interested in contributing to the development of `shell-logger`, we'd
love to have your help :grinning: Check out our
[contributing guidelines](CONTRIBUTING.md) for how to get started.
[Past contributors][contributors] include:
* [@bbraunj](https://github.com/bbraunj)
* [@sswan](https://github.com/sswan)
* [@dc-snl](https://github.com/dc-snl)
* [@jmgate](https://github.com/jmgate)
* [@mvlopri](https://github.com/mvlopri)
[contributors]: https://github.com/sandialabs/shell-logger/graphs/contributors
## License & Copyright
See [LICENSE.md](LICENSE.md) and [COPYRIGHT.md](COPYRIGHT.md).
## Credits
Special thanks to the EMPIRE project for investing in the initial development
of this tool, and [the GMS project][gms] for serving as a second user and
contributing to its clean-up.
[gms]: https://github.com/SNL-GMS/GMS-PI25
Raw data
{
"_id": null,
"home_page": null,
"name": "shell-logger-sandialabs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "shell, logging",
"author": "Josh Braun",
"author_email": "josbrau@sandia.gov",
"download_url": "https://files.pythonhosted.org/packages/48/e8/a8f62266ad5e3bfeb2f95b594e7b29999fd0c67ee35ba6f73923489872ed/shell_logger_sandialabs-3.0.3.tar.gz",
"platform": null,
"description": "\n[](https://codecov.io/gh/sandialabs/shell-logger)\n[](https://www.codefactor.io/repository/github/sandialabs/shell-logger/overview/master)\n[](https://github.com/sandialabs/shell-logger/actions/workflows/github-code-scanning/codeql)\n[](https://github.com/sandialabs/shell-logger/actions/workflows/continuous-integration.yml)\n[](CODE_OF_CONDUCT.md)\n[](https://github.com/sandialabs/shell-logger/graphs/contributors)\n[](https://shell-logger.readthedocs.io/en/latest/?badge=latest)\n[](LICENSE.md)\n[](https://github.com/sandialabs/shell-logger/pulls?q=is:pr+is:merged)\n[](https://bestpractices.coreinfrastructure.org/projects/8863)\n[](https://securityscorecards.dev/viewer/?uri=github.com/sandialabs/shell-logger)\n\n[](https://github.com/pre-commit/pre-commit)\n[](https://results.pre-commit.ci/latest/github/sandialabs/shell-logger/master)\n[](https://pypi.org/project/shell-logger-sandialabs/)\n\n\n[](https://github.com/astral-sh/ruff)\n\n> **NOTICE:** After using this package for a few years, we realized we'd\n> attempted to do too many things at once with it. It still provides\n> tremendous functionality for a wide variety of use cases, but for particular\n> corner cases, it became apparent that design decisions made early on were\n> hampering forward progress, and we wouldn't recommend doing things the same\n> way today. Certain aspects of its functionality have inspired more focused\n> packages ([reverse-argparse][reverse-argparse],\n> [staged-script][staged-script]), and we hope to do the same with more\n> functionality in the future. For the time being, though, don't expect much\n> development and maintenance here. That said, if you use `shell-logger` and\n> are eager to contribute to its longevity, let us know.\n\n[reverse-argparse]: https://github.com/sandialabs/reverse_argparse\n[staged-script]: https://github.com/sandialabs/staged-script\n\n# shell-logger\n\nThe `shell-logger` Python package allows you to interact with the shell, while\nlogging various metadata, statistics, and trace information. Any time you're\ntempted to write your own wrapper around things like `subprocess.Popen()` or\n`subprocess.run()`, consider using `shell_logger.ShellLogger.log()` instead.\nIf you're familiar with [the Unix script command][script], this is similar in\nprinciple, but with substantially more functionality. If you're familiar with\n[Python's logging module][logging], the motivation is similar, but this intends\nto capture what's happening *in the shell* rather than in Python itself.\n\n[script]: https://man7.org/linux/man-pages/man1/script.1.html\n[logging]: https://docs.python.org/3/library/logging.html\n\n## Installation\n\nTo get up and running with `shell-logger`, simply:\n```bash\npython3 -m pip install shell-logger-sandialabs\n```\n\n## Usage\n\nOnce the package is installed, you can simply\n```python\nfrom shell_logger import ShellLogger\nsl = ShellLogger(\"Title of Log File\")\nsl.log(\"Execute my first command in the shell.\", \"echo 'Hello World'\")\nsl.finalize()\n```\n\nFor more detailed usage and API information, please see\n[our documentation][readthedocs].\n\n[readthedocs]: https://shell-logger.readthedocs.io\n\n## Where to Get Help\n\nIf you're having trouble with `shell-logger`, 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/shell-logger/issues\n\n## Contributing\n\nIf you're interested in contributing to the development of `shell-logger`, we'd\nlove to have your help :grinning: Check out our\n[contributing guidelines](CONTRIBUTING.md) for how to get started.\n[Past contributors][contributors] include:\n* [@bbraunj](https://github.com/bbraunj)\n* [@sswan](https://github.com/sswan)\n* [@dc-snl](https://github.com/dc-snl)\n* [@jmgate](https://github.com/jmgate)\n* [@mvlopri](https://github.com/mvlopri)\n\n[contributors]: https://github.com/sandialabs/shell-logger/graphs/contributors\n\n## License & Copyright\n\nSee [LICENSE.md](LICENSE.md) and [COPYRIGHT.md](COPYRIGHT.md).\n\n## Credits\n\nSpecial thanks to the EMPIRE project for investing in the initial development\nof this tool, and [the GMS project][gms] for serving as a second user and\ncontributing to its clean-up.\n\n[gms]: https://github.com/SNL-GMS/GMS-PI25\n\n",
"bugtrack_url": null,
"license": "LICENSE.md",
"summary": "A tool for keeping track of Python's interactions with the shell.",
"version": "3.0.3",
"project_urls": {
"CI": "https://github.com/sandialabs/shell-logger/actions",
"Documentation": "https://shell-logger.readthedocs.io",
"Issues": "https://github.com/sandialabs/shell-logger/issues",
"Repository": "https://github.com/sandialabs/shell-logger"
},
"split_keywords": [
"shell",
" logging"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b0bcf47dd1740db73fd82d34c3185c7160890ec876b855577388b4af54a6a1b5",
"md5": "ebb154f4cd8a9a64676228ac372f24b1",
"sha256": "21a0eff80ad08818ff973e76dd690764f962da3651a4161c9a8aa37144576022"
},
"downloads": -1,
"filename": "shell_logger_sandialabs-3.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ebb154f4cd8a9a64676228ac372f24b1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 182778,
"upload_time": "2025-07-16T20:34:01",
"upload_time_iso_8601": "2025-07-16T20:34:01.573017Z",
"url": "https://files.pythonhosted.org/packages/b0/bc/f47dd1740db73fd82d34c3185c7160890ec876b855577388b4af54a6a1b5/shell_logger_sandialabs-3.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "48e8a8f62266ad5e3bfeb2f95b594e7b29999fd0c67ee35ba6f73923489872ed",
"md5": "0b5806c9b8d327edb2614360ebab810f",
"sha256": "cf4f68a3b2858b3f9b499f4f06f9411142023a732a220218393e56d6956efe28"
},
"downloads": -1,
"filename": "shell_logger_sandialabs-3.0.3.tar.gz",
"has_sig": false,
"md5_digest": "0b5806c9b8d327edb2614360ebab810f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 173601,
"upload_time": "2025-07-16T20:34:03",
"upload_time_iso_8601": "2025-07-16T20:34:03.318153Z",
"url": "https://files.pythonhosted.org/packages/48/e8/a8f62266ad5e3bfeb2f95b594e7b29999fd0c67ee35ba6f73923489872ed/shell_logger_sandialabs-3.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-16 20:34:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sandialabs",
"github_project": "shell-logger",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "shell-logger-sandialabs"
}