Python Grid Libraries

Last published : Jul 27, 2026
Grid Libraries with Services implemented in Python must contain a top-level folder where the individual .py files are stored. In the example below, this folder is named commands. In the grid-library.xml, you must reference this folder in a lib-path element.
The Grid Library must either contain the binary ("pybridge-win64-vc14" for Windows or "pybridge-linux64-gcc34" for Linux) or reference a dependent grid-library containing it.
Lastly, it is necessary to set an environment variable ds.PYTHON_USER_FILE_PATH which references the folder containing the .py files set above. The value of this environment variable must be $ds.GridLibraryRoot$/folder-name where folder-name is the folder containing the .py files.
Here is an example of a grid-library.xml for Python:
<?xml version="1.0" encoding="UTF-8"?>
<grid-library>
    <grid-library-name>Python-example</grid-library-name>
    <grid-library-version>1.0.0</grid-library-version>
       <lib-path>
        <pathelement>commands</pathelement>
    </lib-path>
    <dependency os="win64">
      <grid-library-name>pybridge-win64-vc14</grid-library-name>
      <grid-library-version>7.1</grid-library-version>
   </dependency>
   <dependency os="linux64">
      <grid-library-name>pybridge-linux64-gcc34</grid-library-name>
      <grid-library-version>7.1</grid-library-version>
   </dependency>
   <environment-variables>
    <property>
      <name>ds.PYTHON_USER_FILE_PATH</name>
      <value>$ds.GridLibraryRoot$/commands</value>
      </property>
   </environment-variables>

</grid-library>
Related information