zendir 1.3.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zendir-1.3.0.0/LICENSE +19 -0
- zendir-1.3.0.0/PKG-INFO +26 -0
- zendir-1.3.0.0/README.md +124 -0
- zendir-1.3.0.0/setup.cfg +4 -0
- zendir-1.3.0.0/setup.py +46 -0
- zendir-1.3.0.0/src/zendir/__init__.py +12 -0
- zendir-1.3.0.0/src/zendir/connection/__init__.py +1 -0
- zendir-1.3.0.0/src/zendir/connection/client.py +515 -0
- zendir-1.3.0.0/src/zendir/data/__init__.py +1 -0
- zendir-1.3.0.0/src/zendir/data/frame.py +241 -0
- zendir-1.3.0.0/src/zendir/maths/__init__.py +0 -0
- zendir-1.3.0.0/src/zendir/maths/astro.py +2054 -0
- zendir-1.3.0.0/src/zendir/maths/computer_library.py +105 -0
- zendir-1.3.0.0/src/zendir/maths/constants.py +429 -0
- zendir-1.3.0.0/src/zendir/maths/constellations.py +812 -0
- zendir-1.3.0.0/src/zendir/maths/data.py +123 -0
- zendir-1.3.0.0/src/zendir/maths/kinematics.py +188 -0
- zendir-1.3.0.0/src/zendir/maths/mass.py +260 -0
- zendir-1.3.0.0/src/zendir/maths/sensors.py +34 -0
- zendir-1.3.0.0/src/zendir/maths/utils.py +206 -0
- zendir-1.3.0.0/src/zendir/mqtt/__init__.py +1 -0
- zendir-1.3.0.0/src/zendir/mqtt/client.py +213 -0
- zendir-1.3.0.0/src/zendir/simulation/__init__.py +7 -0
- zendir-1.3.0.0/src/zendir/simulation/behaviour.py +132 -0
- zendir-1.3.0.0/src/zendir/simulation/context.py +40 -0
- zendir-1.3.0.0/src/zendir/simulation/instance.py +265 -0
- zendir-1.3.0.0/src/zendir/simulation/message.py +30 -0
- zendir-1.3.0.0/src/zendir/simulation/model.py +136 -0
- zendir-1.3.0.0/src/zendir/simulation/object.py +825 -0
- zendir-1.3.0.0/src/zendir/simulation/simulation.py +1581 -0
- zendir-1.3.0.0/src/zendir/simulation/system.py +111 -0
- zendir-1.3.0.0/src/zendir/utils/__init__.py +1 -0
- zendir-1.3.0.0/src/zendir/utils/exception.py +40 -0
- zendir-1.3.0.0/src/zendir/utils/helper.py +163 -0
- zendir-1.3.0.0/src/zendir/utils/printer.py +264 -0
- zendir-1.3.0.0/src/zendir/utils/runner.py +117 -0
- zendir-1.3.0.0/src/zendir.egg-info/PKG-INFO +26 -0
- zendir-1.3.0.0/src/zendir.egg-info/SOURCES.txt +39 -0
- zendir-1.3.0.0/src/zendir.egg-info/dependency_links.txt +1 -0
- zendir-1.3.0.0/src/zendir.egg-info/requires.txt +9 -0
- zendir-1.3.0.0/src/zendir.egg-info/top_level.txt +1 -0
zendir-1.3.0.0/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2025 Space Services Australia Ptd. T/A Zendir
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
zendir-1.3.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zendir
|
|
3
|
+
Version: 1.3.0.0
|
|
4
|
+
Summary: Python Interface to the Zendir API for simulations
|
|
5
|
+
Home-page: https://github.com/zendir-dev/zendir-py
|
|
6
|
+
Author: Zendir
|
|
7
|
+
Author-email: support@zendir.io
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: aiohttp
|
|
10
|
+
Requires-Dist: urllib3
|
|
11
|
+
Requires-Dist: paho-mqtt
|
|
12
|
+
Requires-Dist: numpy
|
|
13
|
+
Requires-Dist: pandas
|
|
14
|
+
Requires-Dist: matplotlib
|
|
15
|
+
Requires-Dist: setuptools
|
|
16
|
+
Requires-Dist: pytest-asyncio
|
|
17
|
+
Requires-Dist: requests
|
|
18
|
+
Dynamic: author
|
|
19
|
+
Dynamic: author-email
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: home-page
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
Dynamic: requires-dist
|
|
24
|
+
Dynamic: summary
|
|
25
|
+
|
|
26
|
+
This is the Python interface library for the Zendir API. The Zendir API allows access to spacecraft and space-domain simulation functions and the framework for simulating high-fidelity satellites. It enables accessing the REST API simulation functions in an easy format. Examples of how to construct Zendir simulations are provided on the Zendir documentation found at https://docs.zendir.io.
|
zendir-1.3.0.0/README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# zendir
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/zendir/)
|
|
4
|
+
|
|
5
|
+
`zendir` is a Python library that enables easy access to the Zendir API. The API is a REST interface to the Zendir simulation library, enabling simulations of spacecraft, ground stations, maritime objects and more. The API requires an [access key](#accessing-your-api-token) that is available with a free account from the Zendir website.
|
|
6
|
+
|
|
7
|
+
Example simulation scripts and usage of the zendir library can be found in the public repository [zendir Examples](https://github.com/zendir-dev/zendir-py-examples). This contains some sample scripts showcasing how to use the library and how to run spacecraft simulations with flight software and requesting data from the simulation API. This requires an API key to execute but can be used as a basis for development.
|
|
8
|
+
|
|
9
|
+
Additional tutorials and functionality for the library can be found on the public documentation at [docs.zendir.io](https://docs.zendir.io) under the Guides page.
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Installing `zendir`
|
|
16
|
+
|
|
17
|
+
'zendir' includes the interface for the Zendir API architecture, allowing for custom simulations to be constructed using API endpoints. For a non-local simulation, this requires correct authentication. To install `zendir`, install the project from the PyPi repository:
|
|
18
|
+
|
|
19
|
+
`
|
|
20
|
+
pip install zendir -user
|
|
21
|
+
`
|
|
22
|
+
|
|
23
|
+
Alternatively, this package can be downloaded, unzipped and installed via the following command instead.
|
|
24
|
+
|
|
25
|
+
`
|
|
26
|
+
pip install . --user
|
|
27
|
+
`
|
|
28
|
+
|
|
29
|
+
zendir requires the following Third-Party Python libraries to be installed alongside the installation of this package:
|
|
30
|
+
- numpy
|
|
31
|
+
- pandas
|
|
32
|
+
- requests
|
|
33
|
+
- urllib3
|
|
34
|
+
- paho-mqtt
|
|
35
|
+
- matplotlib
|
|
36
|
+
- setuptools
|
|
37
|
+
- aiohttp
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Updating `zendir`
|
|
42
|
+
|
|
43
|
+
To upgrade a version of zendir, make sure to upgrade the python package. This can be done by the following command.
|
|
44
|
+
|
|
45
|
+
`
|
|
46
|
+
pip install zendir --user --upgrade
|
|
47
|
+
`
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Accessing your API Token
|
|
52
|
+
|
|
53
|
+
API Tokens are accessible via the [Zendir Website](https://www.zendir.io/account/log-in). Create a free account and start a 14-day trial of the software. This will give you access to unlimited sessions and requests during the trial period. The access token is available from the dashboard once the account is created and logged in.
|
|
54
|
+
|
|
55
|
+
To enable your token, create a Credential object and pass into the Simulation class when constructing simulations. Alternatively, if using the example library, update the token in the `credential_helper.py` class for easier access to the token over multiple files. More information can be found in the [API Access Keys](https://docs.zendir.io/v1.3/articles/guides/Python/GettingStarted/3_APIAccessKeys/index.html).
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## API Sessions
|
|
60
|
+
|
|
61
|
+
Each token enables a single API session to be made. Multiple sessions cannot be created at once using the free-tier of the API. Each session is associated with a single cloud instance running the simulation that you have access to. This instance will run for 2 hours once connected. When first connected to the session, it may take between 30 seconds and 2 minutes for the instance to start. After that, the instance will be available without any load times for up to 2 hours. Upon the completion of the session, a new session can be started immediately after with a similar load-up time as before. There is no limit for the number of sessions available during a period of time, with the exception of having one session running concurrently.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Creating a Simulation
|
|
66
|
+
|
|
67
|
+
To create a simulation, use the `Simulation` class. Once the client has been created, this can be used to set up all configurations of objects and data within your instance.
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from zendir import Client, Simulation
|
|
71
|
+
|
|
72
|
+
client = Client("https://api.zendir.io", token="$ACCESS_KEY$")
|
|
73
|
+
simulation = Simulation.create(client)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The simulation class can be used to manage the objects, tick the simulation and track the state of data over the lifetime of the session. As an example, a spacecraft could be created using the following code:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from zendir import Object
|
|
80
|
+
|
|
81
|
+
spacecraft: Object = simulation.add_object(
|
|
82
|
+
"Spacecraft",
|
|
83
|
+
Position=[6671000, 0, 0],
|
|
84
|
+
Velocity=[0, -7700, 0],
|
|
85
|
+
TotalMass=15.0,
|
|
86
|
+
AttitudeRate=[0.01, 0.02, -0.03]
|
|
87
|
+
)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Ticking a Simulation
|
|
93
|
+
|
|
94
|
+
Once the objects have been created in the simulation, the simulation can be ticked. A `tick` can have a step-size, specified in seconds, and an optional duration. A `duration` will specify how long to tick the simulation for, with the specified step size, before finishing the process.
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
simulation.tick(0.1)
|
|
98
|
+
simulation.tick_duration(time=1000.0, step=0.1)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Recording Data
|
|
104
|
+
|
|
105
|
+
Before the simulation is ticked, specific objects, messages or instances can have their data tracked over the simulation lifetime. This allows for the data to be pulled back as a time-series set at the end of the simulation for data analysis and saving. By default, no components are recorded unless the simulation is told to start tracking them. To track an object, use the following.
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
simulation.set_tracking_interval(10.0)
|
|
109
|
+
simulation.track_object(spacecraft)
|
|
110
|
+
simulation.track_object(spacecraft.get_message("Out_SpacecraftStateMsg"))
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Once the simulation has finished ticking, to retrieve the data at the end of the simulation, use the `query` functions, which can also return a pandas data frame object that can be plotted. This will only work with ojects that have been tracked before the simulation started running.
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
data_sc = simulation.query_object(spacecraft)
|
|
117
|
+
data_msg = simulation.query_dataframe(spacecraft.get_message("Out_SpacecraftStateMsg"))
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
</br>
|
|
123
|
+
|
|
124
|
+

|
zendir-1.3.0.0/setup.cfg
ADDED
zendir-1.3.0.0/setup.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# [ ZENDIR ]
|
|
2
|
+
# This code is developed by Zendir to aid with communication
|
|
3
|
+
# to the public API. All code is under the the license provided
|
|
4
|
+
# with the 'zendir' module. Copyright Zendir, 2025.
|
|
5
|
+
import re
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from setuptools import setup, find_packages
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_version():
|
|
11
|
+
init_file = Path(__file__).parent / "src" / "zendir" / "__init__.py"
|
|
12
|
+
content = init_file.read_text()
|
|
13
|
+
match = re.search(r'__version__\s*=\s*["\']([^"\']+)["\']', content)
|
|
14
|
+
if match:
|
|
15
|
+
return match.group(1)
|
|
16
|
+
raise RuntimeError("Cannot find version string.")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Setup the project
|
|
20
|
+
setup(
|
|
21
|
+
name="zendir",
|
|
22
|
+
version=get_version(),
|
|
23
|
+
packages=find_packages(where="src"),
|
|
24
|
+
package_dir={"": "src"},
|
|
25
|
+
install_requires=[
|
|
26
|
+
"aiohttp",
|
|
27
|
+
"urllib3",
|
|
28
|
+
"paho-mqtt",
|
|
29
|
+
"numpy",
|
|
30
|
+
"pandas",
|
|
31
|
+
"matplotlib",
|
|
32
|
+
"setuptools",
|
|
33
|
+
"pytest-asyncio",
|
|
34
|
+
"requests",
|
|
35
|
+
],
|
|
36
|
+
author="Zendir",
|
|
37
|
+
author_email="support@zendir.io",
|
|
38
|
+
description="Python Interface to the Zendir API for simulations",
|
|
39
|
+
long_description="This is the Python interface library for the Zendir API. \
|
|
40
|
+
The Zendir API allows access to spacecraft and space-domain simulation functions \
|
|
41
|
+
and the framework for simulating high-fidelity satellites. \
|
|
42
|
+
It enables accessing the REST API simulation functions in an easy format.\
|
|
43
|
+
Examples of how to construct Zendir simulations are provided on the\
|
|
44
|
+
Zendir documentation found at https://docs.zendir.io.",
|
|
45
|
+
url="https://github.com/zendir-dev/zendir-py",
|
|
46
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Define the version of the package
|
|
2
|
+
__version__ = "1.3.0.0"
|
|
3
|
+
|
|
4
|
+
# Import the standard utilities
|
|
5
|
+
from .utils import ZendirException, printer, helper
|
|
6
|
+
|
|
7
|
+
# Import the standard classes that are commonly used
|
|
8
|
+
from .connection import Client
|
|
9
|
+
from .simulation import *
|
|
10
|
+
|
|
11
|
+
# Include the runner utilities
|
|
12
|
+
from .utils import runner
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .client import Client
|