Skip to main content

A multi-console TTY framework for complex CLI/TTY apps

Project description

Command Line Framework (V2: Web/RPC-ready)

中文

V2 extends the TTY core toward Web + RPC, while keeping the current codebase focused on the TTY runtime. At the moment, Web/RPC is planned but not yet implemented.

Quick Start (TTY Core)

  1. Define your consoles and commands (see examples in python_tty/consoles/examples and python_tty/commands/examples).
  2. Ensure console modules are imported so decorators can register them:
    • Update DEFAULT_CONSOLE_MODULES in python_tty/consoles/loader.py, or
    • Call load_consoles([...]) manually.
  3. Start the factory:
from python_tty.console_factory import ConsoleFactory

factory = ConsoleFactory(service=my_business_core)
factory.start()

The service instance is available in all consoles via console.service, and in commands via self.console.service. If service does not inherit UIEventSpeaker, a warning is emitted at startup.

Current Capabilities (TTY Core)

Console layer:

  • python_tty/consoles/core.py: BaseConsole, MainConsole, SubConsole
  • python_tty/consoles/manager.py and python_tty/consoles/registry.py for lifecycle and registration

Commands layer:

  • python_tty/commands/core.py: BaseCommands, CommandValidator
  • python_tty/commands/registry.py: CommandRegistry, ArgSpec
  • python_tty/commands/general.py: GeneralValidator, GeneralCompleter
  • python_tty/commands/mixins.py: CommandMixin and built-in mixins

UI and utilities:

  • python_tty/core/events.py: UIEvent, UIEventLevel, UIEventSpeaker
  • python_tty/ui/output.py: proxy_print
  • python_tty/utils/: tokenize.py, table.py, ui_logger.py

Roadmap (V2)

Planned milestones for Web + RPC:

  • M1: Meta Descriptor v1 + Exporter
  • M2: RPC proto v1 + local (de)serialization
  • M3: Meta Web Server (HTTP + WS)
  • M4: RPC Server (mTLS + allowlist + audit)
  • M5: Unified execution system (CommandExecutor)

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

python_tty-0.1.7.tar.gz (78.7 kB view details)

Uploaded Source

Built Distribution

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

python_tty-0.1.7-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

Details for the file python_tty-0.1.7.tar.gz.

File metadata

  • Download URL: python_tty-0.1.7.tar.gz
  • Upload date:
  • Size: 78.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_tty-0.1.7.tar.gz
Algorithm Hash digest
SHA256 61a0089475d9468278ce87aa18f280f2f2faac4baec8f74c011c297da9130820
MD5 c1a115689b6fbad6fb8db7b379a6e116
BLAKE2b-256 91a16b8e7c43c118d46e77ec86a0735e2015abd5d56d2272962c80b9a4e6eec7

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_tty-0.1.7.tar.gz:

Publisher: python-publish.yml on ROOKIEMIE/python-tty

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_tty-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: python_tty-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 45.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_tty-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 20d214c644c2e4562b23d13707a16d92e4efcd98caeffe4d9ddeedf2d9cba275
MD5 7cf8d8f310521d05b137e0cef0603b41
BLAKE2b-256 38fcb21fc5aa4fa93afcbc6c58d9b0f9b1129aa027f7a0b91db2f4d0d69bcac1

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_tty-0.1.7-py3-none-any.whl:

Publisher: python-publish.yml on ROOKIEMIE/python-tty

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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