Skip to main content

Add your description here

Project description

CapsuleCore shellback

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.

Usage

from cc_shellback_kit.capsule import Bash
from cc_shellback_kit.core import Command, SessionContext
from cc_shellback_kit.observers import ConsoleLogObserver

# 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.3.0.tar.gz (19.1 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.3.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cc_shellback_kit-0.3.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_shellback_kit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5d2c12382b14575562e0aa7b3c9ce799740c8964ab4b548c5107b16442a1fa79
MD5 c2f4ef3c8be6f7369831c82c2777439d
BLAKE2b-256 fd66a4a2ff2b03a0044a12be6861bdcd023015d16898d72bcb9ab301911ad28a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cc_shellback_kit-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_shellback_kit-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cfc9c0f616bd2ccad5f15047580ab15cad342c22a63f6066a54b9d46f4da726
MD5 19a8bc3c229775d5333eefdd5aa9d533
BLAKE2b-256 30637aaa653e6e2db4f4824908b7a83b08b88d25549b6fe0c975adcedba9c726

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