The Zendir API is a python package that allows running multiple full-system simulations via our REST API. Here are some of it’s features:

  • A full system, multi-scenario, REST API simulator
  • Contains more than 170+ different real-world models
  • Simulates both the physics & the flight-software components
  • Uses pandas, numpy & matplotlib packages for visualizations
  • Supports the querying & fetching of time-series data for any property
  • Upload JSON scenario files configured and exported from Zendir Studio

Get your Zendir API access token

Start your free trial and copy your access token from the user dashboard:

Running a scenario with the Zendir API

Install Python 3.11 or later and run the following terminal/console command:

pip install zendir

Create a new python script (example.py) and copy the example below with your access token:

# import the 'zendir' module
import zendir
 
ACCESS_TOKEN = "XXX" # <= YOUR ACCESS TOKEN GOES HERE
 
# define your simulation scenario
async def scenario_1(simulation: zendir.Simulation):
 
    # initialize your scenario here...
    await simulation.add_object("Spacecraft")
 
    # propagate your simulation forward...
    for _ in range(10):
        await simulation.tick()
        elapsed_seconds = await simulation.get_time()
        print(f"- simulation at {elapsed_seconds:.1f} elapsed seconds")
 
# run your scenario with your access token
client = zendir.Client(token = ACCESS_TOKEN)
zendir.runner.run_simulation(client, scenario_1)

After running your new python script (example.py), you should see the following python output:

- simulation at 0.1 elapsed seconds
- simulation at 0.2 elapsed seconds
- simulation at 0.3 elapsed seconds
- simulation at 0.4 elapsed seconds
- simulation at 0.5 elapsed seconds
- simulation at 0.6 elapsed seconds
- simulation at 0.7 elapsed seconds
- simulation at 0.8 elapsed seconds
- simulation at 0.9 elapsed seconds
- simulation at 1.0 elapsed seconds

What’s Next?

Something Else?

Quick Start Guidance Modes Linking Components Power Systems