Article
· Dec 14, 2023 1m read

Start IRIS in container from Python

I would like to share some of the latest projects I've implemented

It is based on Testcontainers project, and it allows, to start a container from Python, and it provides SQLAlchemy compatible URL to a working container

Mostly useful by using in tests, SQLAlchemy-iris project itself, uses this project in tests.

Give it a try, and download this demo from the project's repository

Discussion (3)2
Log in or sign up to continue

Also possible to use Enterprise license

import os
from testcontainers.iris import IRISContainer

license_key = os.path.abspath(os.path.expanduser("~/iris.key"))
image = 'containers.intersystems.com/intersystems/iris:2023.3'
container = IRISContainer(image, username="demo", password="demo", namespace="demo", license_key=license_key)
container.with_exposed_ports(1972, 52773)
container.start()
print('SQLAlchemy URL', container.get_connection_url())
print('Username', container.username)
print('Password', container.password)