Home / Function/ commands_json() — fastapi Function Reference

commands_json() — fastapi Function Reference

Architecture documentation for the commands_json() function in translate.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  bd6325fb_ea63_5a3e_78aa_820f70a58f1b["commands_json()"]
  6dda5e35_b655_8af3_cd89_8c1584a092c4["translate.py"]
  bd6325fb_ea63_5a3e_78aa_820f70a58f1b -->|defined in| 6dda5e35_b655_8af3_cd89_8c1584a092c4
  style bd6325fb_ea63_5a3e_78aa_820f70a58f1b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/translate.py lines 246–268

def commands_json(
    command: Annotated[str | None, typer.Option(envvar="COMMAND")] = None,
) -> None:
    available_commands = [
        "translate-page",
        "translate-lang",
        "update-outdated",
        "add-missing",
        "update-and-add",
        "remove-removable",
    ]
    default_commands = [
        "remove-removable",
        "update-outdated",
        "add-missing",
    ]
    if command:
        if command in available_commands:
            print(json.dumps([command]))
            return
        else:
            raise typer.Exit(code=1)
    print(json.dumps(default_commands))

Domain

Subdomains

Frequently Asked Questions

What does commands_json() do?
commands_json() is a function in the fastapi codebase, defined in scripts/translate.py.
Where is commands_json() defined?
commands_json() is defined in scripts/translate.py at line 246.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free