Application Programming Interface (API)

Simulation scripts interact with the BornAgain core library through an Application Programming Interface (API). This API consists of numerous classes and their member functions.

The primary API is written in the programming language C++. All important classes and their member functions are also available through a Python API.

C++ API documentation

The C++ API documentation, automatically extracted from the source code, can be found at https://bornagainproject.org/ext/api.

For the current development branch, see

  • main/user-API, which documents all classes and functions that are available for Python scripting;
  • main/full-API, which is mainly intended for developers and covers all classes and functions, whether exposed to Python or not.

For the moment, we do not dispose of a similarly efficient documentation generator for Python. Therefore, Python users need to refer to the C++ API. Even though Python and C++ have different syntax, it is usually straightforward to infer from the C++ API how the corresponding Python method call will look like.