Skip to content

argument #

The argument parser used by main.py

Classes:

Name Description
CLIArgumentParser

Argument parser for commandline interface.

CLINamespace

Typings for namespace of companies-house-codegen command-line interface.

CLIArgumentParser #

CLIArgumentParser()

Argument parser for commandline interface.

CLINamespace dataclass #

CLINamespace(input: str, select: Sequence[ReFormatFlags] = (TYPE_DATE_TO_STRING, TYPE_LIST_TO_ARRAY, TYPE_INFER_BOOLEANS, TYPE_ARRAY_ENSURE_ITEMS, PATHS_ENSURE_SNAKECASE, PARAM_PARAMTYPE_TO_IN, PARAM_TITLE_TO_NAME), ignore: Sequence[ReFormatFlags] = (), extract: Path | None = None, zip: IO[str] = stdout, openapi: bool = False, serve: tuple[str, int] | None = None, silent: bool = False, threaded: bool = True, diff: bool = False, verbose: bool = False)

Typings for namespace of companies-house-codegen command-line interface.

Parameters:

Name Type Description Default

input #

str

URL of a Companies House Swagger Specification from the Companies House Developer's API Suite. See: companies_house_codegen.constants.CHOAS or https://developer-specs.company-information.service.gov.uk for more info.

required

select #

Sequence[ReFormatFlags]

Space-separated list of rule codes to enable. See, companies_house_codegen.constants.ReFormatFlags for more info on available flags.

(TYPE_DATE_TO_STRING, TYPE_LIST_TO_ARRAY, TYPE_INFER_BOOLEANS, TYPE_ARRAY_ENSURE_ITEMS, PATHS_ENSURE_SNAKECASE, PARAM_PARAMTYPE_TO_IN, PARAM_TITLE_TO_NAME)

ignore #

Sequence[ReFormatFlags]

Space-separated list of rule codes to disable. Note, ignored rules have higher priority than slected rules from --select flag. See, companies_house_codegen.constants.ReFormatFlags for more info on available flags.

()

extract #

Path | None

When specified, save specification files as to a directory.

None

zip #

IO[str]

Output as single file. Outputs as to stdout otherwise

stdout

openapi #

bool

Convert Swagger specification to OpenAPI.

False

serve #

tuple[str, int] | None

When specified, creates a local HTTP server. By default, serves on 127.0.0.1:10000. This can be overidden by passing an argument argument is passed

None

silent #

bool

Stop emitting all non-critical output. Error messages will still be emitted (which can silenced by 2>/dev/null).

False

threaded #

bool

Download syncronously on a single thread. By default, downloads syncronously using multithreading. Useful for debugging.

True

diff #

bool

Logs the difference between pre and post formatting. Note, will be ignored if the --silent flag is passed.

False

verbose #

bool

Use verbose debug logging

False
Notes

Generated using generate_namespace_typing<https://mmurape.github.io/companies-house-codegen/developement/typings_suite/#typings_suite.generate_cli_ns>_

See Also

https://mmurape.github.io/companies-house-codegen/developement/typings_suite/#typings_suite.generate_cli_ns