Skip to main content

intersystems_pyprod

intersystems_pyprod, short for InterSystems Python Productions, is a library that allows you to build components for the InterSystems Productions framework entirely in Python. Productions provide the integration engine to connect systems that use different communication protocols and different message formats.

You can read this introductory article to learn how to use pyprod.

The following image shows all the production components that pyprod enables you to create:

SystemDiagramOfProductions

Example Workflow

Using pyprod is essentially a 3 step process. The following example shows a Production that uses a Business Process written using intersystems_pyprod. This Business Process simply returns the request it receives back to the sender.

Note: Before running the example, make sure you have configured the required environment variables to connect to a running IRIS instance.

Step 1: Create your production components

# save this as Readme.py
from intersystems_pyprod import (BusinessProcess,Status)

iris_package_name = "Readme"

class HelloWorldBP(BusinessProcess):
    def OnRequest(self, request):
        return Status.OK(), request

Step 2: Load your components to IRIS

From a command line session where you configured the environment variables, run the intersystems_pyprod command and provide the path to your script as an argument.

$ intersystems_pyprod /full/path/to/HelloWorld.py

    Compiling class Readme.HelloWorldBP...
    ...
    ...
    Load finished successfully.

Step 3: Create a production

You can create the production using one of two approaches: programmatically or using the UI.
Note: These two approaches must not be mixed - use only one for the entire lifecycle of a production.

A. Programmatically

# add this to the end of the Readme.py file
from intersystems_pyprod import Production, ServiceItem, ProcessItem

class MyProduction(Production):
    services = [
        ServiceItem(
            "MyFileService",
            "EnsLib.File.PassthroughService",
            host_settings={
                "TargetConfigNames": "MyCustomBP",
            },
            adapter_settings={
                "FilePath": "path/to/read/files/for/Readme/in",
                "DeleteFromServer": 0,
            },
        )
    ]
    processes = [
        ProcessItem("MyCustomBP", f"{iris_package_name}.HelloWorldBP")
    ]

Follow Step 2 to load this production to IRIS

B. Using the UI

Create the production using the Production Configuration page, which you can access in the IRIS UI by navigating to Interoperability > Configure > Productions

HelloWorldProductionSetup

This production reads in a file from a defined path and then forwards it to a target Business Process.

We use a pre-existing Business Service called Enslib.File.PassthroughService. Configure the service by setting the file path from which it should read. Then select the Business Process you created as its target.

Note: The Business Process class name in ProcessItem() includes the iris_package_name appended to it. Read more about package names here


Test your Production

You can start the production and inspect messages in two ways:

A. Using the UI

Start the Production, then place a text file in the configured file path for the Business Service. After refreshing the Production page, you should see the messages that were delivered.

HelloWorldResults

Note: EnsLib.File.PassthroughService is an existing Business Service bundled with IRIS Productions. It loads a file from a specified location and forwards it to the configured target component.

B. Programmatically

You can control the production lifecycle and inspect messages using the director module. The following example starts the production, stops it, then retrieves messages sent and received at MyFileService:

>>> from intersystems_pyprod import director
>>> director.start_production("Readme.MyProduction")
>>> director.stop_production()
>>> msgs = director.get_host_messages("MyFileService",100)
>>> msgs[1]
{'id': '496', 'time_created': '2026-06-02 23:32:36.674', 'source': 'MyFileService', 'target': 'MyCustomBP', 'status': 9, 'session_id': 496, 'body_class': 'Ens.StreamContainer', 'body_id': '6'}

Reporting Issues

Please report issues via GitHub Issues.

Contributing

See Contributing guidelines

Useful links

Installing

Quick Start

Debugging

API Reference

Changelog

Release files for intersystems-pyprod 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for intersystems-pyprod 0.2.0
File Size Uploaded
intersystems_pyprod-0.2.0.tar.gz 32.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for intersystems-pyprod 0.2.0
File Interpreter ABI Platform
intersystems_pyprod-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 63.9 kB

Release files / intersystems_pyprod-0.2.0.tar.gz

Download URL intersystems_pyprod-0.2.0.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
12e8dee6b2b6d3ee4ad03b33ae0058dc082d4f74cfd56912c28f2c7bc441ed09
BLAKE2b-256 checksum
How to use checksums
713ee47b354a7630e462afa6582c96977b9c687aa2c5c2ce38f75bda13d9dbf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / intersystems_pyprod-0.2.0-py3-none-any.whl

Download URL intersystems_pyprod-0.2.0-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
843b6384d3fbb04462795c83d6638e400d60fcc383c64e9d0dd3a1acf391243b
BLAKE2b-256 checksum
How to use checksums
6f4f78be7dfd8b45d903f4778bc8a251f1e1ebe1ed361427436ab49b7ea762b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page