Skip to content
/ rsdb Public

Object–relational mapping for Riskspectrum PSA model database

License

Notifications You must be signed in to change notification settings

HexQuant/rsdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}')

About

Object–relational mapping for Riskspectrum PSA model database

Topics

Resources

License

Stars

Watchers

Forks

Languages