fpc command line
fpc.cli
cli.py - the fpc command: library calculations from the terminal.
Rung 5 of docs/building-tools.md: a command that is installed with the
package. pyproject.toml maps the name to this module's main::
[project.scripts]
fpc = "fpc.cli:main"
so after installing (uv sync here, or uv tool install
git+https://github.com/kovirlabs/first-principles-code anywhere) you can run::
fpc --help
fpc pipe-flow --flow-l-s 12 --diameter-mm 102.3 --length-m 120
fpc water --temperature-c 37
Subcommands (argparse "subparsers") let one program offer several tools,
the way git commit and git push share the git command.
build_parser()
Build the top-level parser with one subparser per tool.
Source code in fpc/cli.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
main(argv=None)
Entry point for the fpc command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argv
|
list of arguments (defaults to the real command line); tests pass a list so they do not need a subprocess |
None
|
Source code in fpc/cli.py
90 91 92 93 94 95 96 97 | |