shell-interface


Nameshell-interface JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryHelpful and convenient utilities to interact with UNIX shells
upload_time2025-02-15 17:13:31
maintainerNone
docs_urlNone
authorMax Görner
requires_python>=3.9
licenseGPL-3.0-or-later
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)

# Shell Interface

A lightweight Python library providing convenient utilities to interact with UNIX shells.

## Features

- Execute shell commands safely with error handling
- Pipe the output of one command to another
- Retrieve system user and group information
- Logging support with `loguru` (if installed)

## Usage

### Running Shell Commands

```python
from shell_interface import run_cmd

result = run_cmd(cmd=["ls", "-l"], capture_output=True)
print(result.stdout.decode())
```

### Piping Commands

```python
from shell_interface import pipe_pass_cmd_to_real_cmd

result = pipe_pass_cmd_to_real_cmd("echo Hello", ["grep", "Hello"])
print(result.stdout.decode())
```

### Getting User and Group Information

```python
from shell_interface import get_user, get_group

user = get_user()
group = get_group(user)
print(f"User: {user}, Group: {group}")
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "shell-interface",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Max G\u00f6rner",
    "author_email": "5477952+MaxG87@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/9e/28/92f4692b4df100e049884ed2b69a0cfa98c3d5c4a02729017e6f395efaf2/shell_interface-1.0.0.tar.gz",
    "platform": null,
    "description": "[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)\n\n# Shell Interface\n\nA lightweight Python library providing convenient utilities to interact with UNIX shells.\n\n## Features\n\n- Execute shell commands safely with error handling\n- Pipe the output of one command to another\n- Retrieve system user and group information\n- Logging support with `loguru` (if installed)\n\n## Usage\n\n### Running Shell Commands\n\n```python\nfrom shell_interface import run_cmd\n\nresult = run_cmd(cmd=[\"ls\", \"-l\"], capture_output=True)\nprint(result.stdout.decode())\n```\n\n### Piping Commands\n\n```python\nfrom shell_interface import pipe_pass_cmd_to_real_cmd\n\nresult = pipe_pass_cmd_to_real_cmd(\"echo Hello\", [\"grep\", \"Hello\"])\nprint(result.stdout.decode())\n```\n\n### Getting User and Group Information\n\n```python\nfrom shell_interface import get_user, get_group\n\nuser = get_user()\ngroup = get_group(user)\nprint(f\"User: {user}, Group: {group}\")\n```\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Helpful and convenient utilities to interact with UNIX shells",
    "version": "1.0.0",
    "project_urls": {
        "Changelog": "https://github.com/MaxG87/shell-interface/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/MaxG87/shell-interface",
        "Issues": "https://github.com/MaxG87/shell-interface/issues",
        "Repository": "https://github.com/MaxG87/shell-interface"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6e016bee8855eacb0bdd54084f77737e42ab246af72ee189a910b95bdf9ee338",
                "md5": "9bc98808843cee20d769792475526ee4",
                "sha256": "0144bb397ae1b11f8840fae8ca2bc69ed102e349887ef6b1a84d29cedef1b6cf"
            },
            "downloads": -1,
            "filename": "shell_interface-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9bc98808843cee20d769792475526ee4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 16190,
            "upload_time": "2025-02-15T17:13:29",
            "upload_time_iso_8601": "2025-02-15T17:13:29.346685Z",
            "url": "https://files.pythonhosted.org/packages/6e/01/6bee8855eacb0bdd54084f77737e42ab246af72ee189a910b95bdf9ee338/shell_interface-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9e2892f4692b4df100e049884ed2b69a0cfa98c3d5c4a02729017e6f395efaf2",
                "md5": "d92c987f3d904038b329b0c6c9f6dfa1",
                "sha256": "3055cfc96b5208d4cda75cea49c4436465a7504c7a2b0f5018057d4f21e036f7"
            },
            "downloads": -1,
            "filename": "shell_interface-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d92c987f3d904038b329b0c6c9f6dfa1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 15374,
            "upload_time": "2025-02-15T17:13:31",
            "upload_time_iso_8601": "2025-02-15T17:13:31.385246Z",
            "url": "https://files.pythonhosted.org/packages/9e/28/92f4692b4df100e049884ed2b69a0cfa98c3d5c4a02729017e6f395efaf2/shell_interface-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-15 17:13:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MaxG87",
    "github_project": "shell-interface",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "shell-interface"
}
        
Elapsed time: 1.63567s