Skip to main content

Object–relational mapping for RiskSpectrum PSA model database

Project description

rsdb

Object–relational mapping for RiskSpectrum PSA model database.

image

Installation

# PyPI
pip install rsdb

Usage

from rsdb.connection import Connector
import rsdb.orm

server = Connector(ip='<ip>', port=1433)
# Show available models
print(server.GetAvailableModels())
# Get SqlAlchemy session factory
Session = server.GetModelSession('<model_name>')

with Session() as session:
    event_trees = session.execute(select(rsdb.orm EventTrees)).scalars().all()
        for et in event_trees:
            print(et.ID)
            func_events = et.FunctionEvents
            for event in func_events:
                print(f'\t fe:{e.ID}')

            initiating_event = et.InitiatingEvent
            print(f'\t ie:{ie.ID}')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rsdb-0.9.2.tar.gz (25.8 kB view hashes)

Uploaded Source

Built Distribution

rsdb-0.9.2-py3-none-any.whl (25.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page