.. _PythonStep.json#/: PythonStep ========== Run a user defined python step. Parameters are passed to python. Python steps can be used both from command-line invocations of DP3 and from the DP3 python bindings. **Note**: The documentation on how to call DP3 from python is currently work in progress. To make a python step work, make sure that the python libraries of DP3 are in the python path, e.g. by setting .. code-block:: sh export PYTHONPATH=/path/to/dp3/lib64/python3.10/site-packages:$PYTHONPATH The example below shows a minimal example of a python step. .. literalinclude:: ../mockpystep.py :language: python For a complete list of DP3 functions available in python see the source code of pydp3.cc .. _PythonStep.json#/inputs: inputs ****** .. _PythonStep.json#/inputs/type: type ++++ :type: ``string`` :doc: Case-insensitive step type; must be :code:`python` or :code:`pythondppp` `.` .. _PythonStep.json#/inputs/python.class: python.class ++++++++++++++++ :type: ``string`` :doc: Name of the python class that subclasses the :code:`Step` class. In the example above, this should be :code:`MockPyStep`. .. _PythonStep.json#/inputs/python.module: python.module +++++++++++++++++ :type: ``string`` :doc: Name of the module where the python code lives. Typically this is the file name of the python code, which should be in the python path. E.g. if your code is in :code:`mockpystep.py` in the working directory, set :code:`module` to :code:`mockpystep`.