Skip to main content

Add your description here

Project description

cc-shellback-kit

License: MIT Version CI CD Python Version Download Ask DeepWiki docs

Shellback is a robust, architecturally-agnostic Python library designed to bridge terminal environments (Bash, CMD, PowerShell) with Python scripts. It provides a clean, decoupled abstraction layer to execute system commands while maintaining persistent session state and cross-platform compatibility.

Built with Hexagonal Architecture (Ports and Adapters) principles, Shellback ensures that your domain logic remains independent of the specific shell or operating system being used.


📍 Contents


Installation

You can install cc-shellback-kit using pip:

pip install cc.shellback-kit

Usage

from cc_shellback_kit import Bash, ConsoleLogObserver, Command

# 1. We configure the observer to see the activity in the console
observer = ConsoleLogObserver()

# 2. We start the Shell using the context manager (with)
with Bash(observer=observer) as shell:
    
    # --- EXECUTION OF EXTERNAL COMMANDS ---
    # We create a simple command: 'ls -la'
    cmd_list = Command("ls").add_args("-la")
    result = shell.run(cmd_list)
    
    if result.is_success():
        print(f"Files found:\n{result.standard_output}")

    # --- STATE MANAGEMENT (VIRTUAL BUILT-INS) ---
    # We change directory (this affects the SessionContext, not just the process)
    shell.run(Command("cd").add_args("/tmp"))
    
    # We verify the change by running 'pwd'
    shell.run(Command("pwd"))

    # --- ENVIRONMENT VARIABLES ---
    # We export a variable that will persist during this 'with' block
    shell.run(Command("export").add_args("APP_STAGE=development", "DEBUG=true"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cc_shellback_kit-0.5.0.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cc_shellback_kit-0.5.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file cc_shellback_kit-0.5.0.tar.gz.

File metadata

  • Download URL: cc_shellback_kit-0.5.0.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cc_shellback_kit-0.5.0.tar.gz
Algorithm Hash digest
SHA256 733bc14e5d54b17d800ad9236f7f3f72c1cec7e2038c615678a23646a84779cb
MD5 6e315dbc159f2746a97ec552fbc2208d
BLAKE2b-256 cf42ca15eb75616f4a00d036f9aaff1152072ece9b8c87d855d06e7fd653eb06

See more details on using hashes here.

File details

Details for the file cc_shellback_kit-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: cc_shellback_kit-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cc_shellback_kit-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9322ac8d04b05a07373bce7c1347283fb955073008f918c3171a56b58edf0a03
MD5 ce617fcdc11f666a28473c8e15685b97
BLAKE2b-256 e96e306db27018af3f78b7cf0283c4c330985d567bf65ddcc4ae8f361b01b683

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page