Initializing help system before first use

# Application Interface

Topics covered in this chapter:

- App Interface Classes
  - xpressinsight.AppInterface
  - xpressinsight.InsightContext
  - xpressinsight.InsightDmpContext
  - xpressinsight.ResourceLimits
  - xpressinsight.ScenarioData
  - xpressinsight.SolutionDatabase
- Attachments Classes
  - xpressinsight.AttachStatus
  - xpressinsight.Attachment
  - xpressinsight.AttachmentRules
  - xpressinsight.AttachTag
  - xpressinsight.AttachTagUsage
- Repository Classes
  - xpressinsight.InterfaceError
  - xpressinsight.ItemInfo
  - xpressinsight.RepositoryPath

The functions for interacting with the Insight server are provided by the xpressinsight.AppInterface class. The methods of that class can be used, e.g., for downloading and uploading attachments, and for getting scenario and application metadata.

You can access the application interface functions via the insight property of the Insight application. This property is inherited from the base class xpressinsight.AppBase. The following example code, can be used to upload an attachment from within the Insight application class:

        self.insight.put_scen_attach("attachment.txt")

Note that the Python keyword self represents the current instance of the Insight application class. The following example shows how to integrate this line of code in an application.

    import xpressinsight as xi

    @xi.AppConfig(name="Attachment Example", raise_attach_exceptions=True)
    class App(xi.AppBase):

        @xi.ExecModeLoad(descr="Uploads attachment.")
        def load(self):
            with open("attachment.txt", "w") as text_file:
                text_file.write("Hello!")

            self.insight.put_scen_attach("attachment.txt")

        @xi.ExecModeRun(descr="Downloads attachment.")
        def run(self):
            self.insight.get_scen_attach("attachment.txt")

            with open("attachment.txt", "r") as text_file:
                print(text_file.readline())

Covered Topics

- App Interface Classes
- Attachments Classes
- Repository Classes

Parent Topic Insight 5 Python Reference

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.