![Lines of code](https://sloc.xyz/github/sandialabs/shell-logger/?category=code)
[![codecov](https://codecov.io/gh/sandialabs/shell-logger/branch/master/graph/badge.svg?token=FmDStZ6FVR)](https://codecov.io/gh/sandialabs/shell-logger)
[![CodeFactor](https://www.codefactor.io/repository/github/sandialabs/shell-logger/badge/master)](https://www.codefactor.io/repository/github/sandialabs/shell-logger/overview/master)
[![CodeQL](https://github.com/sandialabs/shell-logger/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/sandialabs/shell-logger/actions/workflows/github-code-scanning/codeql)
[![Conda Version](https://img.shields.io/conda/v/conda-forge/shell-logger?label=conda-forge)](https://anaconda.org/conda-forge/shell-logger)
![Conda Downloads](https://img.shields.io/conda/d/conda-forge/shell-logger?label=conda-forge%20downloads)
[![Continuous Integration](https://github.com/sandialabs/shell-logger/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/sandialabs/shell-logger/actions/workflows/continuous-integration.yml)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
[![GitHub contributors](https://img.shields.io/github/contributors/sandialabs/shell-logger.svg)](https://github.com/sandialabs/shell-logger/graphs/contributors)
[![Documentation Status](https://readthedocs.org/projects/shell-logger/badge/?version=latest)](https://shell-logger.readthedocs.io/en/latest/?badge=latest)
[![License](https://anaconda.org/conda-forge/shell-logger/badges/license.svg)](LICENSE.md)
[![Merged PRs](https://img.shields.io/github/issues-pr-closed-raw/sandialabs/shell-logger.svg?label=merged+PRs)](https://github.com/sandialabs/shell-logger/pulls?q=is:pr+is:merged)
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8863/badge)](https://bestpractices.coreinfrastructure.org/projects/8863)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sandialabs/shell-logger/badge)](https://securityscorecards.dev/viewer/?uri=github.com/sandialabs/shell-logger)
![Platforms](https://anaconda.org/conda-forge/shell-logger/badges/platforms.svg)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![pre-commit.ci Status](https://results.pre-commit.ci/badge/github/sandialabs/shell-logger/master.svg)](https://results.pre-commit.ci/latest/github/sandialabs/shell-logger/master)
[![PyPI - Version](https://img.shields.io/pypi/v/shell-logger-sandialabs?label=PyPI)](https://pypi.org/project/shell-logger-sandialabs/)
![PyPI - Downloads](https://img.shields.io/pypi/dm/shell-logger-sandialabs?label=PyPI%20downloads)
![Python Version](https://img.shields.io/badge/Python-3.8|3.9|3.10|3.11|3.12-blue.svg)
[![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)
# 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": "https://github.com/sandialabs/shell-logger",
"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/3d/10/ae909cf33c40058a3857bf8fcb1f3f12e21489de66d3445210a2c0e10fb3/shell_logger_sandialabs-1.0.2.tar.gz",
"platform": null,
"description": "![Lines of code](https://sloc.xyz/github/sandialabs/shell-logger/?category=code)\n[![codecov](https://codecov.io/gh/sandialabs/shell-logger/branch/master/graph/badge.svg?token=FmDStZ6FVR)](https://codecov.io/gh/sandialabs/shell-logger)\n[![CodeFactor](https://www.codefactor.io/repository/github/sandialabs/shell-logger/badge/master)](https://www.codefactor.io/repository/github/sandialabs/shell-logger/overview/master)\n[![CodeQL](https://github.com/sandialabs/shell-logger/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/sandialabs/shell-logger/actions/workflows/github-code-scanning/codeql)\n[![Conda Version](https://img.shields.io/conda/v/conda-forge/shell-logger?label=conda-forge)](https://anaconda.org/conda-forge/shell-logger)\n![Conda Downloads](https://img.shields.io/conda/d/conda-forge/shell-logger?label=conda-forge%20downloads)\n[![Continuous Integration](https://github.com/sandialabs/shell-logger/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/sandialabs/shell-logger/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/shell-logger.svg)](https://github.com/sandialabs/shell-logger/graphs/contributors)\n[![Documentation Status](https://readthedocs.org/projects/shell-logger/badge/?version=latest)](https://shell-logger.readthedocs.io/en/latest/?badge=latest)\n[![License](https://anaconda.org/conda-forge/shell-logger/badges/license.svg)](LICENSE.md)\n[![Merged PRs](https://img.shields.io/github/issues-pr-closed-raw/sandialabs/shell-logger.svg?label=merged+PRs)](https://github.com/sandialabs/shell-logger/pulls?q=is:pr+is:merged)\n[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8863/badge)](https://bestpractices.coreinfrastructure.org/projects/8863)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sandialabs/shell-logger/badge)](https://securityscorecards.dev/viewer/?uri=github.com/sandialabs/shell-logger)\n![Platforms](https://anaconda.org/conda-forge/shell-logger/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/shell-logger/master.svg)](https://results.pre-commit.ci/latest/github/sandialabs/shell-logger/master)\n[![PyPI - Version](https://img.shields.io/pypi/v/shell-logger-sandialabs?label=PyPI)](https://pypi.org/project/shell-logger-sandialabs/)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/shell-logger-sandialabs?label=PyPI%20downloads)\n![Python Version](https://img.shields.io/badge/Python-3.8|3.9|3.10|3.11|3.12-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# 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": "1.0.2",
"project_urls": {
"CI": "https://github.com/sandialabs/shell-logger/actions",
"Documentation": "https://shell-logger.readthedocs.io",
"Homepage": "https://github.com/sandialabs/shell-logger",
"Issues": "https://github.com/sandialabs/shell-logger/issues",
"Repository": "https://github.com/sandialabs/shell-logger"
},
"split_keywords": [
"shell",
" logging"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "84baaea5e19c1cb839ba35e446221e7e289c96e064dbe3d40d0df51d0aa6120b",
"md5": "5ca683cbdcbab58291c008146089db46",
"sha256": "7673078a39bc792d318975c87e2a458f67f9550a6702d31ef41ed18768eaa4c5"
},
"downloads": -1,
"filename": "shell_logger_sandialabs-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5ca683cbdcbab58291c008146089db46",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 183079,
"upload_time": "2024-07-10T20:42:18",
"upload_time_iso_8601": "2024-07-10T20:42:18.459076Z",
"url": "https://files.pythonhosted.org/packages/84/ba/aea5e19c1cb839ba35e446221e7e289c96e064dbe3d40d0df51d0aa6120b/shell_logger_sandialabs-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3d10ae909cf33c40058a3857bf8fcb1f3f12e21489de66d3445210a2c0e10fb3",
"md5": "d72964e4909e4217399242ae706e7ba4",
"sha256": "266f29c04bd3b7e43f8e7c73df2bafa4383005e9d7be149fb9f4114c1698ebd9"
},
"downloads": -1,
"filename": "shell_logger_sandialabs-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "d72964e4909e4217399242ae706e7ba4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 174471,
"upload_time": "2024-07-10T20:42:28",
"upload_time_iso_8601": "2024-07-10T20:42:28.148856Z",
"url": "https://files.pythonhosted.org/packages/3d/10/ae909cf33c40058a3857bf8fcb1f3f12e21489de66d3445210a2c0e10fb3/shell_logger_sandialabs-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-10 20:42:28",
"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"
}