|
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | +# 📘 easySSP – Simulation Client Examples |
| 5 | + |
| 6 | +This repository provides real-world examples for using the |
| 7 | +official [easySSP Simulation Client](https://github.com/exxcellent/easyssp-simulation-client-python). Whether you're |
| 8 | +testing the |
| 9 | +API or building production workflows, these scripts will help you get started quickly. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## 🎯 What’s Inside |
| 14 | + |
| 15 | +- 🔐 Authentication via the authentication module |
| 16 | +- 🧪 Run, stop, and delete simulations |
| 17 | +- 📈 Download results and sampled results |
| 18 | +- 📘 **Includes documentation for all Simulation API endpoints and models** |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## 📁 Project Structure |
| 23 | + |
| 24 | +```bash |
| 25 | +easyssp-simulation-examples-python/ |
| 26 | +├── demo.py # Run a basic scenario |
| 27 | +├── simulation_operations.py # Helper functions for polling simulation status, downloading results, etc. |
| 28 | +├── start_simulation_config_json.py # JSON representation of a start simulation configuration |
| 29 | +├── input/ |
| 30 | +│ └── exampleStimuli.csv # Stimuli file for starting a simulation |
| 31 | +│ └── simulation_example.ssp # SSP file for starting a simulation |
| 32 | +└── output # Directory for storing the simulation runs results and simulation steps logs. |
| 33 | +``` |
| 34 | + |
| 35 | +# 🚀 Getting Started with easySSP Simulation Examples |
| 36 | + |
| 37 | +This guide walks you through setting up and running the example scripts provided in the easySSP Simulation Examples |
| 38 | +repository. |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## 1. Clone the Repository |
| 43 | + |
| 44 | +To begin, clone the repository and navigate into the project directory: |
| 45 | + |
| 46 | +- Clone the repo: |
| 47 | + `git clone https://github.com/exxcellent/easyssp-simulation-examples-python.git` |
| 48 | +- Change into the directory: |
| 49 | + `cd easyssp-simulation-examples-python` |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## 2. Install Dependencies |
| 54 | + |
| 55 | +Ensure you have Python 3.11 or higher installed and a Pro Edition easySSP Account. |
| 56 | +Create the virtual environment by running |
| 57 | + |
| 58 | +```bash |
| 59 | +python -m venv .venv |
| 60 | +.\.venv\Scripts\activate # or source .venv/bin/activate on macOS |
| 61 | +``` |
| 62 | + |
| 63 | +Then, install all required dependencies using uv: |
| 64 | + |
| 65 | +```bash |
| 66 | +pip install uv |
| 67 | +uv sync |
| 68 | +``` |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## 3. Provide your login credentials |
| 73 | + |
| 74 | +In the `demo.py` file, replace `your_easyssp_username` and `your_easyssp_password` with your real easySSP credentials |
| 75 | +to start the demo. |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +## 4. Run an Example Script |
| 80 | + |
| 81 | +### 📂 Input & Output Directories |
| 82 | + |
| 83 | +This repository uses structured folders to organize data and results: |
| 84 | + |
| 85 | +#### 📥 `input/` |
| 86 | + |
| 87 | +The `input/` directory contains files used to **start simulations**. These include: |
| 88 | + |
| 89 | +- .ssp files |
| 90 | +- .csv stimuli files |
| 91 | + |
| 92 | +Each script pulls its input data from this folder when submitting a request to the Simulation API. |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +#### 📤 `output/` |
| 97 | + |
| 98 | +The `output/` directory is where **simulation results** are stored. This may include: |
| 99 | + |
| 100 | +- Raw result files in CSV format |
| 101 | +- Simulation steps log files |
| 102 | + |
| 103 | +This separation of input and output ensures clarity, reproducibility, and easy cleanup. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +#### 🧪 `demo.py` |
| 108 | + |
| 109 | +The `demo.py` script in the `demo` directory acts as a **central demo runner** and contains example requests that show |
| 110 | +how to use the client |
| 111 | +across different simulation scenarios. It's a great starting point if you're exploring the API for the first time or |
| 112 | +want to see full workflows in action. |
| 113 | +To start the demo, run |
| 114 | + |
| 115 | +```bash |
| 116 | +cd demo |
| 117 | +python -m demo |
| 118 | +``` |
| 119 | + |
| 120 | +## 📚 Related Projects |
| 121 | + |
| 122 | +### 🧠 [**Simulation Client**](https://github.com/exxcellent/easyssp-simulation-client-python) |
| 123 | + |
| 124 | +The official Python client for interacting with the easySSP Simulation API. |
| 125 | + |
| 126 | +### 🔐 [**Auth Client**](https://github.com/exxcellent/easyssp-auth-client-python) |
| 127 | + |
| 128 | +Handles authentication by retrieving and storing JWT tokens. |
| 129 | + |
| 130 | +### 🧰 [**Utils**](https://github.com/exxcellent/easyssp-python-clients-util) |
| 131 | + |
| 132 | +A shared utility module used by all Python clients. Includes request handling, exceptions, and other reusable helpers. |
| 133 | + |
| 134 | +--- |
| 135 | + |
| 136 | +## 🤝 Contributing |
| 137 | + |
| 138 | +Spotted a bug or want to add your own scenario? |
| 139 | +Pull requests and issues are welcome! |
| 140 | + |
| 141 | +## 📄 License |
| 142 | + |
| 143 | +This project is licensed under the MIT License. |
0 commit comments