No project description provided
Project description
pysimultan
PySimultan is a Python library designed to facilitate the creation, manipulation, and management of SIMULTAN data models, taxonomies, and templates. It provides a structured way to define and interact with complex data structures, making it particularly useful for applications that require detailed data organization and templating.
Key Features:
- Data Models: Create and manage data SIMULTAN models with ease.
- Taxonomies: Define and use taxonomies to categorize and structure data.
- File and Directory Management: Handle files and directories within the data models.
- Mapping of Python objects to SIMULTAN data models: Map Python objects to SIMULTAN data models for easy data creation and manipulation.
- Simple integration in existing Python projects: Easily integrate PySimultan into existing Python projects to enhance data management capabilities.
Table of Contents
Installation
pip install PySimultan
License
PySimultan is distributed under the terms of the MIT license.
Usage
Data Models
Create a new data model:
from PySimultan2 import DataModel
# Create a new data model
data_model = DataModel.create_new_project(project_path='my_project.simultan',
user_name='admin',
password='admin')
Load an existing data model:
from PySimultan2 import DataModel
# Load an existing data model
data_model = DataModel(project_path='my_project.simultan',
user_name='admin',
password='admin')
save the data model:
data_model.save()
close and cleanup the data model:
data_model.cleanup()
Mapping python to SIMULTAN
Create a mapped class:
from PySimultan2 import DataModel, TaxonomyMap, Content, PythonMapper
mapper = PythonMapper()
class TestComponent(object):
def __init__(self, *args, **kwargs):
self.param_1 = kwargs.get('param_1')
self.param_2 = kwargs.get('param_2')
content0 = Content(text_or_key='param_1', # text or key of the content/parameter/property
property_name='param_1', # name of the generated property
type=None, # type of the content/parameter/property
unit=None, # unit of the content/parameter/property
documentation='param_1 to test')
content1 = Content(text_or_key='param_2', # text or key of the content/parameter/property
property_name='param_2', # name of the generated property
type=None, # type of the content/parameter/property
unit=None, # unit of the content/parameter/property
documentation='param_2 to test')
test_component_map = TaxonomyMap(taxonomy_name='PySimultan',
taxonomy_key='Test',
taxonomy_entry_name='test_component',
taxonomy_entry_key='test_component',
content=[content0, content1],
)
mapper.register(test_component_map.taxonomy_entry_key, TestComponent, taxonomy_map=test_component_map)
Create an instance of the mapped class:
# get the mapped class
mapped_test_component_cls = mapper.get_mapped_class('test_component')
# create an instance of the mapped class
mapped_test_component = mapped_test_component_cls(param_1='value1',
param_2='value2',
data_model=data_model)
# save the data_model
data_model.save()
# cleanup the data_model
data_model.cleanup()
Load an instance of the mapped class:
# load the data_model
data_model = DataModel(project_path='my_project.simultan',
user_name='admin',
password='admin')
# get the mapped class
mapped_test_component_cls = mapper.get_mapped_class('test_component')
# get the instances of the mapped class
instances = mapped_test_component_cls.cls_instaces
print(instances[0].param_1)
Change Log
[0.6.4] - 2025-06-06
Updated SIMULTAN version to 0.7.18
[0.5.9.7] - 2025-01-09
- Added default component support to Mapper: if a default component is not present in the datamodel, it is automatically added
- Fixed content naming bug: Content.name is now used for the name of the TaxonomyEntry in SIMULTAN
- Added typing for better code completion
[0.5.9.4] - 2024-12-31
- Fixed bug in DirectoryInfo where __dir_helper_file__ was not found if already existing
[0.5.8] - 2024-12-17
- Added FileInfo.from_existing_file method to create FileInfo object from existing file in ProjectUnpackFolder
[0.5.7] - 2024-12-09
- Added support for different taxonomy for content
- Added support for numpy np.float32, np.float64 and np.int32, np.int64
[0.4.20] - 2024-07-01
- Fixed Bug in nested dictionary creation
[0.4.19] - 2024-07-01
- Refactored dictionaries
Project details
Release history Release notifications | RSS feed
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 pysimultan-0.7.5.tar.gz.
File metadata
- Download URL: pysimultan-0.7.5.tar.gz
- Upload date:
- Size: 6.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c76d94cb60799e60b71f26214e66fdc9b5af1912c63b2aa56642509d7de7da33
|
|
| MD5 |
afbad5b0c754f5438744dfff11642a1c
|
|
| BLAKE2b-256 |
9894ac9e0817691407063912351d1a7b4b652df3c51bc9118d472e983fdb259b
|
File details
Details for the file pysimultan-0.7.5-py3-none-any.whl.
File metadata
- Download URL: pysimultan-0.7.5-py3-none-any.whl
- Upload date:
- Size: 6.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4857a611ab61fd8ca42abb12da5a2abf5a98d5a31b416acc9c697b024ba1b631
|
|
| MD5 |
db3f576d321c08ef9e9601cb0802a8d1
|
|
| BLAKE2b-256 |
309b63cf0237d243b31fcf7c41dfa96b7f8991977397a7400e8c9b4d330a7408
|