arelle.CntlrCmdLine

This module is Arelle’s controller in command line non-interactive mode

(This module can be a pattern for custom integration of Arelle into an application.)

See COPYRIGHT.md for copyright information.

Module Contents

Classes

ParserForDynamicPlugins

CntlrCmdLine

.. class:: CntlrCmdLin()

Functions

main

Main program to initiate application from command line or as a separate process (e.g, java Runtime.getRuntime().exec). May perform a command line request, or initiate a web server on specified local port.

wsgiApplication

_parseAndRun

interface used by Main program and py.test (arelle_test.py)

parseAndRun

interface used by Main program and py.test (arelle_test.py)

preparseArgs

Some command line arguments influence the actual parsing of other arguments. This function pre-parses those arguments to allow for processing before full argument parseing occurs.

parseArgs

Parses the command line arguments and generates runtimeOptions and arellePluginModules

createCntlrAndPreloadPlugins

This function creates a cntlr and preloads all the necessary plugins.

_configAndRunCntlr

This function creates and configures a controller based off an options dataclass and

configAndRunCntlr

_pluginHasCliOptions

_parseOptionsFile

Parse the JSON options within the provided filepath.

Data

API

arelle.CntlrCmdLine.STILL_ACTIVE

259

arelle.CntlrCmdLine.PROCESS_QUERY_INFORMATION

1024

arelle.CntlrCmdLine.DISABLE_PERSISTENT_CONFIG_OPTION

‘–disablePersistentConfig’

arelle.CntlrCmdLine.TESTCASE_EXPECTED_ERRORS_OPTION

‘testcaseExpectedErrors’

arelle.CntlrCmdLine.UILANG_OPTION

‘–uiLang’

arelle.CntlrCmdLine._: arelle.typing.TypeGetText

None

arelle.CntlrCmdLine.main() None

Main program to initiate application from command line or as a separate process (e.g, java Runtime.getRuntime().exec). May perform a command line request, or initiate a web server on specified local port.

Parameters:

argv

Command line arguments. (Currently supported arguments can be displayed by the parameter –help.)

type message:

[str]

arelle.CntlrCmdLine.wsgiApplication(extraArgs: list[str] | None = None) CntlrCmdLine
arelle.CntlrCmdLine._parseAndRun(args: list[str]) tuple[bottle.Bottle | CntlrCmdLine | None, arelle.RuntimeOptions.RuntimeOptions, bool | None]

interface used by Main program and py.test (arelle_test.py)

arelle.CntlrCmdLine.parseAndRun(args: list[str]) CntlrCmdLine

interface used by Main program and py.test (arelle_test.py)

arelle.CntlrCmdLine.PREPARSE_ARG_CONFIGS

‘frozenset(…)’

arelle.CntlrCmdLine.preparseArgs(args: list[str], parser: optparse.OptionParser) dict[str, str]

Some command line arguments influence the actual parsing of other arguments. This function pre-parses those arguments to allow for processing before full argument parseing occurs.

Parameters:
  • args – Command line arguments

  • parser – OptionParser to report errors

Returns:

Dictionary of pre-parsed options

arelle.CntlrCmdLine.parseArgs(args: list[str]) tuple[arelle.RuntimeOptions.RuntimeOptions, dict[str, Any]]

Parses the command line arguments and generates runtimeOptions and arellePluginModules

Parameters:

args – Command Line arguments

Returns:

runtimeOptions which is an object of options specified and arellePluginModules which is a dictionary of commands and moduleInfos

arelle.CntlrCmdLine.createCntlrAndPreloadPlugins(uiLang: str | None, disablePersistentConfig: bool, arellePluginModules: dict[str, Any]) CntlrCmdLine

This function creates a cntlr and preloads all the necessary plugins.

Parameters:
  • uiLang – The UI Language

  • disablePersistentConfig – flag to determine if persistent configs should be ignored

  • arellePluginModules – a dictionary of commands and moduleInfos

Returns:

cntlr

arelle.CntlrCmdLine._configAndRunCntlr(options: arelle.RuntimeOptions.RuntimeOptions, arellePluginModules: dict[str, Any]) tuple[None, None] | tuple[bottle.Bottle, None] | tuple[CntlrCmdLine, bool]

This function creates and configures a controller based off an options dataclass and

Parameters:
  • options – RuntimeOptions dataclass

  • arellePluginModules – a dictionary of commands and moduleInfos

Returns:

cntlr

arelle.CntlrCmdLine.configAndRunCntlr(options: arelle.RuntimeOptions.RuntimeOptions, arellePluginModules: dict[str, Any]) CntlrCmdLine
class arelle.CntlrCmdLine.ParserForDynamicPlugins(options: arelle.RuntimeOptions.RuntimeOptions)

Initialization

add_option(*args: Any, **kwargs: Any) None
add_option_group(featureGroup: optparse.OptionGroup, *args: Any, **kwargs: Any) None
__getattr__(name: str) None
arelle.CntlrCmdLine._pluginHasCliOptions(moduleInfo: dict[str, Any]) bool
arelle.CntlrCmdLine._parseOptionsFile(optionsFile: str, parser: optparse.OptionParser) dict[str, Any]

Parse the JSON options within the provided filepath.

Parameters:
  • optionsFile – The path to the JSON options file.

  • parser – The parser to log an error to if needed.

Returns:

The parsed options as a dictionary.

class arelle.CntlrCmdLine.CntlrCmdLine(logFileName: str | None = None, uiLang: str | None = None, disable_persistent_config: bool = False)

Bases: arelle.Cntlr.Cntlr

.. class:: CntlrCmdLin()

Initialization sets up for platform via Cntlr.Cntlr.

Initialization

run(options: arelle.RuntimeOptions.RuntimeOptions, sourceZipStream: Any = None, responseZipStream: Any = None) bool

Process command line arguments or web service request, such as to load and validate an XBRL document, or start web server.

When a web server has been requested, this method may be called multiple times, once for each web service (REST) request that requires processing. Otherwise (when called for a command line request) this method is called only once for the command line arguments request.

Parameters:

options (optparse.Values) – OptionParser options from parse_args of main argv arguments (when called from command line) or corresponding arguments from web service (REST) request.

internet_user_password(host: str, realm: str) tuple[str, str]
showStatusOnPipe(message: str | None, clearAfter: int | None = None) None
loadPackage(package: str, packageManifestName: str) None
loadPackages(packages: list[str], packageManifestName: str) None

Loads specified packages.

Parameters:
  • packages – Pipe-separated list of options. See CLI documentation for ‘packages’.

  • packageManifestName – Unix shell style pattern used to find package manifest.