Parcel.NExT.Python
Parcel.NExT.Python.Helpers.ZoraPythonRuntimeStandardDistributionConstants
Contains standard distribution constants for the Zora Python runtime.
Parcel.NExT.Python.Helpers.ZoraPythonRuntimeStandardDistributionConstants.CurrentZoraPythonDistributionVersion
Gets the current Zora Python distribution version.
Parcel.NExT.Python.Helpers.ZoraPythonRuntimeStandardDistributionConstants.MinNumpyVersion
Gets the minimum required Numpy version.
Parcel.NExT.Python.Helpers.ZoraPythonRuntimeStandardDistributionConstants.MinPandasVersion
Gets the minimum required Pandas version.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper
Provides helper methods to interact with and manage the Python runtime.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PythonDistributionMode
Indicates which python distribution we are using.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PythonDistributionMode.System
We are using python that comes packed with Zora
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PythonDistributionMode.User
We are using Python that's overriden as specified by user (using environment variable)
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PythonDistributionMode.Local
We are using python as found on local computer
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PythonDistributionMode.None
No Python installation is available.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PythonExecutableName
The name of the Python executable.
Remarks
Made private because in general we do not wish Zora packages to explicitly look for Python distribution as we will provide a layer interfacing with either on-system or embedded Python.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PipExecutableName
The name of the Pip executable.
Remarks
Made private because in general we do not wish Zora packages to explicitly look for Python distribution as we will provide a layer interfacing with either on-system or embedded Python.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.DivookaCustomPythonDistributionEnvironmentVariableName
The environment variable name used for custom Python distribution paths.
Remarks
Custom paths for python.exe and pip.exe and runtime script dependencies.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.GetDivookaDefaultDistributionPythonFolders
Default location to get python distribution that comes with Zora. This is overriden by
Returns
An array of folder paths.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.CustomPythonDistributionPaths
Gets the custom Python distribution paths from the environment variable.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.HasPython
Gets a value indicating whether the current (Zora) distribution has a usable Python.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.WhichPython()
Determines which Python distribution is in use, and retrieves its path and version.
Parameters
| Name | Description | Default |
|---|---|---|
path |
When this method returns, contains the path to the Python executable if found; otherwise, null. |
|
version |
When this method returns, contains the Python version if found; otherwise, null. |
Returns
The Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PythonDistributionMode indicating the type of Python distribution found.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.WhichPython()
Determines which Python distribution is in use, and retrieves its path.
Parameters
| Name | Description | Default |
|---|---|---|
path |
When this method returns, contains the path to the Python executable if found; otherwise, null. |
Returns
The Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PythonDistributionMode indicating the type of Python distribution found.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.GetModuleVersion()
Retrieves the installed version of the specified Python module.
Remarks
Made internal because in general we do not wish Zora packages to explicitly look for Python distribution as we will provide a layer interfacing with either on-system or embedded Python.
Parameters
| Name | Description | Default |
|---|---|---|
module |
The name of the Python module. |
Returns
The module version as a string if available; otherwise,
null.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.GetPythonVersion
Retrieves the installed Python version.
Remarks
Made internal because in general we do not wish Zora packages to explicitly look for Python distribution as we will provide a layer interfacing with either on-system or embedded Python.
Returns
The Python version as a string if available; otherwise,
null.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.GetPythonVersion()
Retrieves the Python version for the specified Python program path.
Parameters
| Name | Description | Default |
|---|---|---|
programPath |
The path to the Python executable. |
Returns
The Python version as a string if available; otherwise,
null.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PythonEngineAlreadyInitialized
Gets a value indicating whether the Python engine has already been initialized.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.TryInitializeEngine
Attempts to initialize the Python engine if it has not already been initialized.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.InitializeEngine
Initializes the Python engine.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.PerformCustomEnvironmentInitialization()
Performs custom environment initialization for the Python engine using the specified paths.
Parameters
| Name | Description | Default |
|---|---|---|
paths |
An array of paths to include in the Python environment. |
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.TryShutdownEngine
Attempts to shut down the Python engine.
Remarks
This function should generally be called by the runtime (otherwise usually implemented on the front-end side), otherwise the entire application will NOT shutdown properly.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.DependencyRequirement
Represents a dependency requirement for the Python runtime.
Parameters
| Name | Description | Default |
|---|---|---|
Name |
The name of the dependency. | |
MinVersionPrefix |
The minimum version prefix required. |
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.DependencyRequirement.#ctor()
Represents a dependency requirement for the Python runtime.
Parameters
| Name | Description | Default |
|---|---|---|
Name |
The name of the dependency. | |
MinVersionPrefix |
The minimum version prefix required. |
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.DependencyRequirement.Name
The name of the dependency.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.DependencyRequirement.MinVersionPrefix
The minimum version prefix required.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.ValidateDependencies()
Validates that the current Python environment meets the specified version and dependency requirements.
Parameters
| Name | Description | Default |
|---|---|---|
validPythonVersions |
An optional array of valid Python version prefixes. If not provided, the current Zora distribution version is used. | |
dependencyRequirements |
An optional array of dependency requirements. |
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.RunScopedSnippetAsFunctionBody()
Runs the specified code snippet as the body of a function in a new Python scope and returns its result.
Remarks
Requires explicit return statement; Does not support imports - will cause syntax error or unexpected behaviors.
Parameters
| Name | Description | Default |
|---|---|---|
snippet |
The Python code snippet to run. |
Returns
A Python.Runtime.PyObject representing the result of the executed function.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.RunTopLevelSnippet()
Runs a code snippet as if executing a script file using Python executable.
Parameters
| Name | Description | Default |
|---|---|---|
snippet |
The Python code snippet to execute. | |
shutDown |
A value indicating whether to shut down the Python engine after execution. The default is true. |
Returns
A Python.Runtime.PyModule representing the Python execution scope.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.GetEnvironment()
Get environment variables to use for launching standlone python process instances from embedded Divooka Python (i.e. not through Python.Net, but may use pythonnet to make use of C# side definitions).
Remarks
Notice this function is directly tied to how Divooka.py sets things up.
For now since we haven't decided on exactly which one to use - we will just expose both PYTHONPATH and PATH.
Returns
A set of environment variables to be used.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.GetDistributionPythonDllPath
Gets the active Python DLL path for the current distribution.
Returns
The path to the Python DLL if found; otherwise,
null.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.GetDistributionPythonProgramPath
Gets the active Python program path for the current distribution.
Returns
The path to the Python executable if found; otherwise,
null.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.GetDistributionPipPath
Gets the active Pip program path for the current distribution.
Returns
The path to the Pip executable if found; otherwise,
null.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.GetDistributionPythonScriptExecutablePath()
Find inside "script" for python programs.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.FindPythonDLL()
Searches for a Python DLL in the specified paths.
Parameters
| Name | Description | Default |
|---|---|---|
paths |
An array of paths to search. |
Returns
The path to the Python DLL if found; otherwise,
null.
Parcel.NExT.Python.Helpers.PythonRuntimeHelper.FindPythonPip
Searches for the Pip executable in the environment paths.
Returns
The path to the Pip executable if found; otherwise,
null.
Parcel.NExT.Python.PythonReflection
Provide reflection related functions for Python