Documentation on Python bindings for SAMSON API

Python bindings for SAMSON API are part of the integrated Python console. They provide you with an access to most of the SAMSON SDK allowing you to access most of SAMSON’s functionality through python scripting.

Python bindings for the SAMSON API are done in the same structure as the SAMSON SDK. The Software Development Kit (SDK) of SAMSON is composed of a set of libraries gathered in several library groups (SDK Organization). This documentation has links to the SAMSON SDK Developers guide which you also can check out for more information.


This version of Python bindings is for SAMSON SDK 2022 R2.

The Python console in SAMSON comes with an integrated Jupyter Qt Console.

Python bindings are done thanks to pybind11 (pybind11 license).

Importing python bindings

Python bindings for the SAMSON API are imported in the embedded Jupyter Qt console in the following way:

import samson as sam
from samson.Facade import SAMSON        # SAMSON Facade - main interface of SAMSON
from samson.DataModel import Quantity   # Quantities: length, mass, time, etc
from samson.DataModel import Type       # Types: position3, etc
from samson.DataModel.DataGraph import Node
from samson.Modeling.StructuralModel import Atom