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.


📍 Contenido


Installation

You can install cc-shellback-kit using pip:

pip install cc.shellback-kit

Usage

from cc_shellback_kit import Bash, ConsoleLogObserver, Command, SessionContext

# 1. Configuramos el observador para ver la actividad en consola
observer = ConsoleLogObserver()

# 2. Iniciamos la Shell usando el manejador de contexto (with)
with Bash(observer=observer) as shell:
    
    # --- EJECUCIÓN DE COMANDOS EXTERNOS ---
    # Creamos un comando simple: 'ls -la'
    cmd_list = Command("ls").add_args("-la")
    result = shell.run(cmd_list)
    
    if result.is_success():
        print(f"Archivos encontrados:\n{result.standard_output}")

    # --- MANEJO DE ESTADO (VIRTUAL BUILT-INS) ---
    # Cambiamos de directorio (esto afecta al SessionContext, no solo al proceso)
    shell.run(Command("cd").add_args("/tmp"))
    
    # Verificamos el cambio ejecutando un 'pwd'
    shell.run(Command("pwd"))

    # --- VARIABLES DE ENTORNO ---
    # Exportamos una variable que persistirá durante este bloque 'with'
    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.4.0.tar.gz (19.2 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.4.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cc_shellback_kit-0.4.0.tar.gz
  • Upload date:
  • Size: 19.2 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.4.0.tar.gz
Algorithm Hash digest
SHA256 737489307978f563c467039aace909191111836153249cbbd4a9fd65d4c8cbc2
MD5 6b96491fb7b6758448f57c1f3d982c19
BLAKE2b-256 cebb59a5348fd0aa198dc39e31c9ac58403a22993e233433f99d21ff5e9558be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cc_shellback_kit-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9d8601ecf85d317cb04cf0bdf0fbeba8421768df1b6fa0090eac2d091e85a8e
MD5 c433fc2558a8075118fdfe54f01ff730
BLAKE2b-256 df0093089a8ace17fc3d084db8304945f78721469e5c01644daa4ae10e87ad5a

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