confingy.cli.transpile#
transpile
#
Transpile command for confingy CLI.
This module provides functionality to convert serialized confingy configurations back into Python code with proper type hints and imports.
transpile
#
transpile(
input_path: Annotated[str, Argument()],
output: Annotated[
Optional[str],
Option(
help="Output Python file path (default: stdout)"
),
] = None,
)
Transpile serialized confingy fingys to Python code.
Examples:
Transpile a JSON file to Python code
confingy transpile fingy.json
Write output to a file
confingy transpile fingy.json -o fingy.py
Transpile from stdin
echo '{"_confingy_class": "MyClass", ...}' | confingy transpile -
You can also pipe to ruff to format
confingy transpile fingy.json | ruff format -
Source code in src/confingy/cli/transpile.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |