Architecture

Every user-facing operation in modalysis follows the same six-layer flow:

  1. CLI Parser

  2. CLI Handler

  3. HTTP Client

  4. FastAPI Server

  5. Core Function

The main CLI entrypoint is modalysis.__init__.main. Subcommands are registered in parser modules with set_defaults(func=...) and dispatched by args.func(args).

Design Rules

  • Core modules in src/modalysis/core contain business logic and should not include HTTP or CLI logic.

  • Server modules in src/modalysis/server expose POST endpoints and delegate to core.

  • Client modules in src/modalysis/client send requests to server endpoints.

  • CLI handlers in src/modalysis/cli/handlers parse command arguments and invoke clients.

  • CLI parsers in src/modalysis/cli/parsers define command groups and argument schemas.

Output Convention

Tabular processing commands write .modalysis TSV outputs. Plot commands write .png files.