Python API for Open Source Railway Designer https://osrd.fr/en/
sudo apt update && sudo apt upgrade -y
sudo apt install openjdk-17-jdk openjdk-17-jre
https://www.oracle.com/java/technologies/downloads/#java17
pip install git+ssh://git@github.com/y-plus/pyOSRD.git@main
or
pip install --upgrade git+ssh://git@github.com/y-plus/pyOSRD.git@main
>>> from pyosrd import OSRD
>>> sim = OSRD(simulation='point_switch', dir='point_switch')
Create a file name .env
at the root of your projet, containing
JAVA="<Your custon Java Path>"
On Windows, it is recommanded to use triple double quotes (especially if the path contains spaces), e.g.:
JAVA="""C:\Program Files\Common Files\Oracle\Java\javapath\java"""
git clone git@github.com:y-plus/pyOSRD.git
cd pyOSRD/
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt