Skip to content

[Feature] Add JSON output format for pipeline integration #2

Description

@AdvancingTitans

Background

All current commands output formatted tables (using rich). Users running automated pipelines, cron jobs, or shell scripts need machine-readable output.

Requirements

  • Global flag --json for all subcommands
  • Example: young indices --json outputs JSON array instead of table
  • Should be pipe-friendly: young a --zt --json | jq '.[] | .code'

Suggested implementation

  • Add --json to the root group in cli.py
  • When set, skip rich Table rendering and call json.dumps() on the raw data dict
  • Each subcommand should already have structured data before rendering, so this is mostly a render-layer fork

Acceptance

  • young indices --json outputs valid JSON
  • young a --zt --json outputs valid JSON
  • young global --json outputs valid JSON
  • Tests verify JSON is parseable
  • README updated with pipeline examples

For

  • Python users who like click
  • Anyone using A-share data in shell pipelines

Easy first PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions