Object–relational mapping for RiskSpectrum PSA model database
Project description
rsdb
Object–relational mapping for RiskSpectrum PSA model database.
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
Release history Release notifications | RSS feed
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)
Built Distribution
rsdb-0.9.2-py3-none-any.whl
(25.3 kB
view hashes)