API reference#

The API for PyGranta BoM Analytics is split into different sections. The following sections describe general capabilities applicable to both restricted substances and sustainability:

  • Granta MI connection describes how to connect to Granta MI and, if required, configure any schema customizations in the API client. It also explains how to run queries.

  • Log messages describes the structure of log messages returned by the Granta MI server.

  • Exceptions lists the possible custom exceptions that might be raised.

  • Batching requests explains how queries are batched if they exceed a certain size.

  • Differences between BoM-based queries and record-based queries explains some key differences between record-based and BoM-based queries, including how records are identified and how additional items are included in the analysis.

  • BoM helpers explains how to create, read, edit, and save BoM objects for restricted substances and sustainability analysis.

The following sections describe how to build queries and interpret results for different types of analysis:


While some examples use a different class than the one being documented, both classes are always equivalent in terms of the capability being demonstrated.