API documentation

Options module

This exposes the choices made by the user. Defaults will be applied here, and some handling of defaults.

nuitka.Options.isVerbose()
Returns

bool derived from --verbose

nuitka.Options.shallTraceExecution()
Returns

bool derived from --trace-execution

nuitka.Options.shallExecuteImmediately()
Returns

bool derived from --run

nuitka.Options.shallRunInDebugger()
Returns

bool derived from --debug

nuitka.Options.shallDumpBuiltTreeXML()
Returns

bool derived from --xml

nuitka.Options.shallOnlyExecCCompilerCall()
Returns

bool derived from --recompile-c-only

nuitka.Options.shallNotDoExecCCompilerCall()
Returns

bool derived from --generate-c-only

nuitka.Options.getFileReferenceMode()

str, one of “runtime”, “original”, “frozen”, coming from --file-reference-choice

Notes:

Defaults to runtime for modules and packages, as well as standalone binaries, otherwise original is kept.

nuitka.Options.shallMakeModule()
Returns

bool derived from --module

nuitka.Options.shallCreatePyiFile()

bool = not --no-pyi-file

nuitka.Options.isAllowedToReexecute()

bool = not --must-not-re-execute

nuitka.Options.shallFollowStandardLibrary()
Returns

bool derived from --follow-stdlib

nuitka.Options.shallFollowNoImports()
Returns

bool derived from --nofollow-imports

nuitka.Options.shallFollowAllImports()
Returns

bool derived from --follow-imports

nuitka.Options.getShallFollowInNoCase()

list, items of --nofollow-import-to=

nuitka.Options.getShallFollowModules()

list, items of --follow-import-to=

nuitka.Options.getShallFollowExtra()

list, items of --include-plugin-directory=

nuitka.Options.getShallFollowExtraFilePatterns()

list, items of --include-plugin-files=

nuitka.Options.getMustIncludeModules()

list, items of --include-module=

nuitka.Options.getMustIncludePackages()

list, items of --include-package=

nuitka.Options.getShallIncludePackageData()

list, items of --include-package-data=

nuitka.Options.getShallIncludeDataFiles()

list, items of --include-data-file=

nuitka.Options.getShallIncludeDataDirs()

list, items of --include-data-dir=

nuitka.Options.shallWarnImplicitRaises()
Returns

bool derived from --warn-implicit-exceptions

nuitka.Options.shallWarnUnusualCode()
Returns

bool derived from --warn-unusual-code

nuitka.Options.assumeYesForDownloads()
Returns

bool derived from --assume-yes-for-downloads

nuitka.Options.isPythonDebug()
Returns

bool derived from --python-debug or sys.flags.debug

Passed to Scons as python_debug so it can consider it when picking link libraries to choose the correct variant. Also enables the define Py_DEBUG for C headers. Reference counting checks and other debug asserts of Python will happen in this mode.

nuitka.Options.isUnstripped()
Returns

bool derived from --unstripped or --profile

A binary is called stripped when debug information is not present, an unstripped when it is present. For profiling and debugging it will be necessary, but it doesn’t enable debug checks like --debug does.

Passed to Scons as unstripped_mode to it can ask the linker to include symbol information.

nuitka.Options.isProfile()
Returns

bool derived from --profile

nuitka.Options.shallCreateGraph()
Returns

bool derived from --graph

nuitka.Options.getOutputFilename()

str, value of “-o”

nuitka.Options.getOutputPath(path)

Return output pathname of a given path (filename).

nuitka.Options.getOutputDir()

str, value of --output-dir or “.”

nuitka.Options.getPositionalArgs()

tuple, command line positional arguments

nuitka.Options.getMainArgs()

tuple, arguments following the optional arguments

nuitka.Options.shallOptimizeStringExec()

Inactive yet

nuitka.Options.shallClearPythonPathEnvironment()

bool = not --execute-with-pythonpath

nuitka.Options.shallUseStaticLibPython()
Returns

bool derived from --static-libpython=yes|auto and not module mode

Notes:

Currently only Anaconda on non-Windows can do this and MSYS2.

nuitka.Options.shallTreatUninstalledPython()

bool = derived from Python installation and modes

Notes:

Not done for standalone mode obviously. The Python DLL will be a dependency of the executable and treated that way.

Also not done for extension modules, they are loaded with a Python runtime available.

Most often uninstalled Python versions are self compiled or from Anaconda.

nuitka.Options.isShowScons()
Returns

bool derived from --show-scons

nuitka.Options.getJobLimit()

int, value of --jobs / “-j” or number of CPU kernels

nuitka.Options.getLtoMode()
Returns

bool derived from --lto or --pgo

nuitka.Options.isClang()
Returns

bool derived from --clang or enforced by platform, e.g. macOS or FreeBSD some targets.

nuitka.Options.isMingw64()
Returns

bool derived from --mingw64, available only on Windows, otherwise false

nuitka.Options.getMsvcVersion()
Returns

str derived from --msvc on Windows, otherwise None

nuitka.Options.shallDisableCCacheUsage()
Returns

bool derived from disable-ccache

nuitka.Options.shallDisableConsoleWindow()
Returns

bool derived from --win-disable-console or ``--macos-disable-console

nuitka.Options.isShowProgress()
Returns

bool derived from --show-progress

nuitka.Options.isShowMemory()
Returns

bool derived from --show-memory

nuitka.Options.isShowInclusion()
Returns

bool derived from --show-modules

nuitka.Options.isRemoveBuildDir()
Returns

bool derived from --remove-output

nuitka.Options.isExperimental(indication)

Check whether a given experimental feature is enabled.

Args:

indication: (str) feature name

Returns:

bool

nuitka.Options.getExperimentalIndications()

tuple, items of --experimental=

nuitka.Options.shallExplainImports()
Returns

bool derived from --explain-imports

nuitka.Options.isStandaloneMode()
Returns

bool derived from --standalone

nuitka.Options.isOnefileMode()
Returns

bool derived from --onefile

nuitka.Options.isOnefileTempDirMode()
Returns

bool derived from --onefile-tempdir and OS

Notes:

On all but Linux, using a bootstrap binary that does unpack is mandatory, but on Linux, the AppImage tool is used by default, this enforces using a bootstrap binary there too.

nuitka.Options.isPgoMode()
Returns

bool derived from --pgo

nuitka.Options.isPythonPgoMode()
Returns

bool derived from --pgo-python

nuitka.Options.getPythonPgoInput()
Returns

str derived from --pgo-python-input

nuitka.Options.getPgoArgs()

list = --pgo-args

nuitka.Options.getPgoExecutable()

str = --pgo-args

nuitka.Options.getPythonPgoUnseenModulePolicy()

str = --python-pgo-unused-module-policy

nuitka.Options.getIconPaths()

list of str, values of --windows-icon-from-ico and --linux-onefile-icon

nuitka.Options.getWindowsIconExecutablePath()

str or None if not given, value of --windows-icon-from-exe

nuitka.Options.shallAskForWindowsAdminRights()

bool, value of --windows-uac-admin or --windows-uac-uiaccess

nuitka.Options.shallAskForWindowsUIAccessRights()

bool, value of --windows-uac-uiaccess

nuitka.Options.getWindowsVersionInfoStrings()

dict of str, values of .

nuitka.Options.getWindowsProductVersion()
Returns

tuple of 4 ints or None, derived from --windows-product-version

nuitka.Options.getWindowsFileVersion()

:returns tuple of 4 ints or None, derived from --windows-file-version

nuitka.Options.getWindowsSplashScreen()
Returns

bool derived from --onefile-windows-splash-screen-image

nuitka.Options.getWindowsCompanyName()

str name of the company to use

nuitka.Options.getWindowsProductName()

str name of the product to use

nuitka.Options.getMacOSTargetArch()
Returns

str enum (“universal”, “arm64”, “x86_64”) derived from --macos-target-arch value

nuitka.Options.shallCreateAppBundle()

bool shall create an application bundle

nuitka.Options.getMacOSAppName()

str name of the app to use bundle

nuitka.Options.getMacOSSignedAppName()

str name of the app to use during signing

nuitka.Options.getMacOSAppVersion()

str version of the app to use for bundle

nuitka.Options.hasPythonFlagNoSite()

bool = “no_site” in python flags given

nuitka.Options.hasPythonFlagNoAnnotations()

bool = “no_annotations” in python flags given

nuitka.Options.hasPythonFlagNoAsserts()

bool = “no_asserts” in python flags given

nuitka.Options.hasPythonFlagNoDocstrings()

bool = “no_docstrings” in python flags given

nuitka.Options.hasPythonFlagNoWarnings()

bool = “no_docstrings” in python flags given

nuitka.Options.hasPythonFlagTraceImports()

bool = “trace_imports”, “-v” in python flags given

nuitka.Options.hasPythonFlagNoRandomization()

bool = “no_randomization”, “-R”, “static_hashes” in python flags given

nuitka.Options.hasPythonFlagUnbuffered()

bool = “package_mode”, “-m” in python flags given

nuitka.Options.hasPythonFlagPackageMode()

bool = “package_mode”, “-m” in python flags given

nuitka.Options.shallFreezeAllStdlib()

bool = not shallFollowStandardLibrary

nuitka.Options.getWindowsDependencyTool()

str, value of --windows-dependency-tool=

nuitka.Options.shallNotUseDependsExeCachedResults()
Returns

bool derived from --disable-dll-dependency-cache or --force-dll-dependency-cache-update

nuitka.Options.shallNotStoreDependsExeCachedResults()
Returns

bool derived from --disable-dll-dependency-cache

nuitka.Options.getPluginNameConsideringRenames(plugin_name)

Name of the plugin with renames considered.

nuitka.Options.getPluginsEnabled()

tuple, user enabled (standard) plugins (not including user plugins)

Note:

Do not use this outside of main binary, as plugins are allowed to activate plugins themselves and that will not be visible here.

nuitka.Options.getPluginsDisabled()

tuple, user disabled (standard) plugins.

Note:

Do not use this outside of main binary, as other plugins, e.g. hinted compilation will activate plugins themselves and this will not be visible here.

nuitka.Options.getUserPlugins()

tuple, items user provided of --user-plugin=

nuitka.Options.shallDetectMissingPlugins()

bool = not --plugin-no-detection

nuitka.Options.getPythonPathForScons()

str, value of --python-for-scons

nuitka.Options.shallCompileWithoutBuildDirectory()

bool currently hard coded, not when using debugger.

When this is used, compilation is executed in a fashion that it runs inside the build folder, hiding it, attempting to make results more reproducible across builds of different programs.

TODO: Make this not hardcoded, but possible to disable via an options.

nuitka.Options.shallPreferSourcecodeOverExtensionModules()

bool prefer source code over extension modules if both are there

nuitka.Options.shallUseProgressBar()

bool prefer source code over extension modules if both are there

nuitka.Options.getForcedStdoutPath()

str force program stdout output into that filename

nuitka.Options.getForcedStderrPath()

str force program stderr output into that filename

nuitka.Options.shallPersistModifications()

bool write plugin source changes to disk

nuitka.Options.isLowMemory()

bool low memory usage requested

nuitka.Options.getCompilationReportFilename()

str filename to write XML report of compilation to