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()[source]
Returns

bool derived from --verbose

nuitka.Options.shallTraceExecution()[source]
Returns

bool derived from --trace-execution

nuitka.Options.shallExecuteImmediately()[source]
Returns

bool derived from --run

nuitka.Options.shallRunInDebugger()[source]
Returns

bool derived from --debug

nuitka.Options.shallDumpBuiltTreeXML()[source]
Returns

bool derived from --xml

nuitka.Options.shallOnlyExecCCompilerCall()[source]
Returns

bool derived from --recompile-c-only

nuitka.Options.shallNotDoExecCCompilerCall()[source]
Returns

bool derived from --generate-c-only

nuitka.Options.getFileReferenceMode()[source]

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()[source]
Returns

bool derived from --module

nuitka.Options.shallCreatePyiFile()[source]

bool = not --no-pyi-file

nuitka.Options.isAllowedToReexecute()[source]

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

nuitka.Options.shallFollowStandardLibrary()[source]
Returns

bool derived from --follow-stdlib

nuitka.Options.shallFollowNoImports()[source]
Returns

bool derived from --nofollow-imports

nuitka.Options.shallFollowAllImports()[source]
Returns

bool derived from --follow-imports

nuitka.Options.getShallFollowInNoCase()[source]

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

nuitka.Options.getShallFollowModules()[source]

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

nuitka.Options.getShallFollowExtra()[source]

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

nuitka.Options.getShallFollowExtraFilePatterns()[source]

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

nuitka.Options.getMustIncludeModules()[source]

list, items of --include-module=

nuitka.Options.getMustIncludePackages()[source]

list, items of --include-package=

nuitka.Options.getShallIncludePackageData()[source]

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

nuitka.Options.getShallIncludeDataFiles()[source]

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

nuitka.Options.getShallIncludeDataDirs()[source]

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

nuitka.Options.shallWarnImplicitRaises()[source]
Returns

bool derived from --warn-implicit-exceptions

nuitka.Options.shallWarnUnusualCode()[source]
Returns

bool derived from --warn-unusual-code

nuitka.Options.assumeYesForDownloads()[source]
Returns

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

nuitka.Options.isPythonDebug()[source]
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()[source]
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()[source]
Returns

bool derived from --profile

nuitka.Options.shallCreateGraph()[source]
Returns

bool derived from --graph

nuitka.Options.getOutputFilename()[source]

str, value of “-o”

nuitka.Options.getOutputPath(path)[source]

Return output pathname of a given path (filename).

nuitka.Options.getOutputDir()[source]

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

nuitka.Options.getPositionalArgs()[source]

tuple, command line positional arguments

nuitka.Options.getMainArgs()[source]

tuple, arguments following the optional arguments

nuitka.Options.shallOptimizeStringExec()[source]

Inactive yet

nuitka.Options.shallClearPythonPathEnvironment()[source]

bool = not --execute-with-pythonpath

nuitka.Options.shallUseStaticLibPython()[source]
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()[source]

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()[source]
Returns

bool derived from --show-scons

nuitka.Options.getJobLimit()[source]

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

nuitka.Options.getLtoMode()[source]
Returns

bool derived from --lto or --pgo

nuitka.Options.isClang()[source]
Returns

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

nuitka.Options.isMingw64()[source]
Returns

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

nuitka.Options.getMsvcVersion()[source]
Returns

str derived from --msvc on Windows, otherwise None

nuitka.Options.shallDisableCCacheUsage()[source]
Returns

bool derived from disable-ccache

nuitka.Options.shallDisableConsoleWindow()[source]
Returns

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

nuitka.Options.isShowProgress()[source]
Returns

bool derived from --show-progress

nuitka.Options.isShowMemory()[source]
Returns

bool derived from --show-memory

nuitka.Options.isShowInclusion()[source]
Returns

bool derived from --show-modules

nuitka.Options.isRemoveBuildDir()[source]
Returns

bool derived from --remove-output

nuitka.Options.getIntendedPythonArch()[source]
Returns

str, one of "x86", "x86_64" or None

Notes: This is only available on Windows, on other platforms it will be None

nuitka.Options.isExperimental(indication)[source]

Check whether a given experimental feature is enabled.

Args:

indication: (str) feature name

Returns:

bool

nuitka.Options.getExperimentalIndications()[source]

tuple, items of --experimental=

nuitka.Options.shallExplainImports()[source]
Returns

bool derived from --explain-imports

nuitka.Options.isStandaloneMode()[source]
Returns

bool derived from --standalone

nuitka.Options.isOnefileMode()[source]
Returns

bool derived from --onefile

nuitka.Options.isOnefileTempDirMode()[source]
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()[source]
Returns

bool derived from --pgo

nuitka.Options.isPythonPgoMode()[source]
Returns

bool derived from --pgo-python

nuitka.Options.getPythonPgoInput()[source]
Returns

str derived from --pgo-python-input

nuitka.Options.getPgoArgs()[source]

list = --pgo-args

nuitka.Options.getPgoExecutable()[source]

str = --pgo-args

nuitka.Options.getIconPaths()[source]

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

nuitka.Options.getWindowsIconExecutablePath()[source]

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

nuitka.Options.shallAskForWindowsAdminRights()[source]

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

nuitka.Options.shallAskForWindowsUIAccessRights()[source]

bool, value of --windows-uac-uiaccess

nuitka.Options.getWindowsVersionInfoStrings()[source]

dict of str, values of .

nuitka.Options.getWindowsProductVersion()[source]
Returns

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

nuitka.Options.getWindowsFileVersion()[source]

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

nuitka.Options.getWindowsSplashScreen()[source]
Returns

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

nuitka.Options.getWindowsCompanyName()[source]

str name of the company to use

nuitka.Options.getWindowsProductName()[source]

str name of the product to use

nuitka.Options.shallCreateAppBundle()[source]

bool shall create an application bundle

nuitka.Options.getMacOSAppName()[source]

str name of the app to use bundle

nuitka.Options.getMacOSSignedAppName()[source]

str name of the app to use during signing

nuitka.Options.getMacOSAppVersion()[source]

str version of the app to use for bundle

nuitka.Options.hasPythonFlagNoSite()[source]

bool = “no_site” in python flags given

nuitka.Options.hasPythonFlagNoAnnotations()[source]

bool = “no_annotations” in python flags given

nuitka.Options.hasPythonFlagNoAsserts()[source]

bool = “no_asserts” in python flags given

nuitka.Options.hasPythonFlagNoDocstrings()[source]

bool = “no_docstrings” in python flags given

nuitka.Options.hasPythonFlagNoWarnings()[source]

bool = “no_docstrings” in python flags given

nuitka.Options.hasPythonFlagTraceImports()[source]

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

nuitka.Options.hasPythonFlagNoRandomization()[source]

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

nuitka.Options.shallFreezeAllStdlib()[source]

bool = not shallFollowStandardLibrary

nuitka.Options.getWindowsDependencyTool()[source]

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

nuitka.Options.shallNotUseDependsExeCachedResults()[source]
Returns

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

nuitka.Options.shallNotStoreDependsExeCachedResults()[source]
Returns

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

nuitka.Options.getPluginNameConsideringRenames(plugin_name)[source]

Name of the plugin with renames considered.

nuitka.Options.getPluginsEnabled()[source]

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()[source]

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()[source]

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

nuitka.Options.shallDetectMissingPlugins()[source]

bool = not --plugin-no-detection

nuitka.Options.getPythonPathForScons()[source]

str, value of --python-for-scons

nuitka.Options.shallCompileWithoutBuildDirectory()[source]

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()[source]

bool prefer source code over extension modules if both are there

nuitka.Options.shallUseProgressBar()[source]

bool prefer source code over extension modules if both are there

nuitka.Options.getForcedStdoutPath()[source]

str force program stdout output into that filename

nuitka.Options.getForcedStderrPath()[source]

str force program stderr output into that filename

nuitka.Options.shallPersistModifications()[source]

bool write plugin source changes to disk

nuitka.Options.isLowMemory()[source]

bool low memory usage requested