This release is a pre-release and may not be stable for production use.
F Prime Python Model
F Prime Python Model is a utility for translating fpp-to-json AST, Location Map,
and Analysis JSON to Python data structures. For more information on the fpp-to-json
tool, see the FPP User's Guide.
Installation
pip install git+https://github.com/fprime-community/fprime-python-model.git
Usage
In order to use this utility, you must first run the fpp-to-json tool to generate
the AST, Location Map, and Analysis JSON files for a given FPP model.
-
When using
fpp-to-jsonas part of a larger project, you can setFPRIME_ENABLE_JSON_MODEL_GENERATION=ONin your settings.ini to generate JSON files automatically. -
For specific steps on how to run
fpp-to-jsonmanually, see the FPP User's Guide.Note: When running the
fpp-to-jsontool, ensure that you do not include the-soption as that will prevent the Analysis JSON from being generated.
Once the AST, Location Map, and Analysis JSON files have been generated, you can translate the model JSON to it's Python representation by doing:
from fprime_python_model.model import FprimePythonModel
model = FprimePythonModel(
ast_file_path, # Path to AST JSON file
locations_file_path, # Path to Location Map JSON file
analysis_json_file_path # Path to Analysis JSON file
)
Once an FprimePythonModel is constructed, you can access the python data structures that represent
the FPP AST, Location Map, and Analysis of the model:
model.ast # Model AST
model.location_map # Location map
model.analysis # Model Analysis data structure
Traversing AST
You can traverse AST nodes by writing an AST visitor, which can be used to query or search the AST of a model. An AST visitor base class (AstVisitor) is provided in fprime_python_model/utils/fpp_ast_visitor.py.
Examples of how the AstVistor is used in this project are:
fprime_python_model/utils/fpp_ast_writer.py, which is used to print the AST to the consolefprime_python_model/translators/construct_ast_id_map.py, which is used to create a mapping from AST IDs to AST nodes.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fprime_python_model-3.3.0a1.tar.gz.
File metadata
- Download URL: fprime_python_model-3.3.0a1.tar.gz
- Upload date:
- Size: 194.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b7cb8b1055c0c05cfb1e4b4a15deeccb343bf9e1d10ee910e8f904863ee1888
|
|
| MD5 |
6cd57b4b49588fe4f641e36c9640aa55
|
|
| BLAKE2b-256 |
6b9d25096120c2be771fed857ec235aa7e20e94bbdc6b82ca0534f09c606d5fe
|
Provenance
The following attestation bundles were made for fprime_python_model-3.3.0a1.tar.gz:
Publisher:
publish.yml on fprime-community/fprime-python-model
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fprime_python_model-3.3.0a1.tar.gz -
Subject digest:
0b7cb8b1055c0c05cfb1e4b4a15deeccb343bf9e1d10ee910e8f904863ee1888 - Sigstore transparency entry: 2219578229
- Sigstore integration time:
-
Permalink:
fprime-community/fprime-python-model@912c191f46cbe04751afc95fcccf6082f8d73add -
Branch / Tag:
refs/tags/v3.3.0a1 - Owner: https://github.com/fprime-community
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@912c191f46cbe04751afc95fcccf6082f8d73add -
Trigger Event:
release
-
Statement type:
File details
Details for the file fprime_python_model-3.3.0a1-py3-none-any.whl.
File metadata
- Download URL: fprime_python_model-3.3.0a1-py3-none-any.whl
- Upload date:
- Size: 103.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13c5e0acc32af1445d77f99e868c10f26312c06b66aafba4b43a4b8a25b319ca
|
|
| MD5 |
e347d41954f16eeef3de62a2e8b4b874
|
|
| BLAKE2b-256 |
ee0e67dc949939d1b2de74168804590fcb85a051ef94849a09d873c08b838965
|
Provenance
The following attestation bundles were made for fprime_python_model-3.3.0a1-py3-none-any.whl:
Publisher:
publish.yml on fprime-community/fprime-python-model
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fprime_python_model-3.3.0a1-py3-none-any.whl -
Subject digest:
13c5e0acc32af1445d77f99e868c10f26312c06b66aafba4b43a4b8a25b319ca - Sigstore transparency entry: 2219578249
- Sigstore integration time:
-
Permalink:
fprime-community/fprime-python-model@912c191f46cbe04751afc95fcccf6082f8d73add -
Branch / Tag:
refs/tags/v3.3.0a1 - Owner: https://github.com/fprime-community
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@912c191f46cbe04751afc95fcccf6082f8d73add -
Trigger Event:
release
-
Statement type: