Skip to main content

=================================================== pysimultanui

Python library for creating simple user interfaces for PySimultan

Installation

pysimultanui can be installed using pip:

pip install pysimultanui

Usage

import pysimultanui as psui
from PySimultan2.taxonomy_maps import TaxonomyMap, Content

# example class to be mapped:


class ExampleClass:
    def __init__(self, *args, **kwargs):
        self.a = kwargs.get('a', None)
        self.b = kwargs.get('b', None)
        self.c = None

    def add(self):
        self.c = self.a + self.b

    def subtract(self):
        self.c = self.a - self.b

    def multiply(self):
        self.c = self.a * self.b


# create content and taxonomy map:
contents = {}

contents['a'] = Content(text_or_key='a_in_simultan',
                        property_name='a',
                        type=None,
                        unit=None,
                        documentation='Content a')

contents['b'] = Content(text_or_key='b_in_simultan',
                        property_name='b',
                        type=None,
                        unit=None,
                        documentation='Content b')

contents['c'] = Content(text_or_key='c_in_simultan',
                        property_name='c',
                        type=None,
                        unit=None,
                        documentation='Content c')

example_class_map = TaxonomyMap(taxonomy_name='PySimultanUI',
                                taxonomy_key='PySimultanUI',
                                taxonomy_entry_name='ExampleClass',
                                taxonomy_entry_key='ExampleClass',
                                content=[contents['a'],
                                         contents['b'],
                                         contents['c']
                                         ],
                                )

# get the mapper:
mapper = psui.core.mapper

# register the class to be mapped:
mapper.register(example_class_map.taxonomy_entry_key,
                ExampleClass,
                taxonomy_map=example_class_map)


# register methods:
cls = mapper.get_mapped_class('ExampleClass')

# get the method mapper:
method_mapper = psui.core.method_mapper

method_mapper.register_method(cls=cls,
                              name='subtract',
                              method=cls.subtract,
                              args=[],
                              kwargs={})

method_mapper.register_method(cls=cls,
                              name='add',
                              method=cls.add,
                              args=[],
                              kwargs={})

method_mapper.register_method(cls=cls,
                              name='multiply',
                              method=cls.multiply,
                              args=[],
                              kwargs={})

# run the UI:
psui.run_ui()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysimultanui-1.1.1.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysimultanui-1.1.1-py3-none-any.whl (68.8 kB view details)

Uploaded Python 3

File details

Details for the file pysimultanui-1.1.1.tar.gz.

File metadata

  • Download URL: pysimultanui-1.1.1.tar.gz
  • Upload date:
  • Size: 50.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pysimultanui-1.1.1.tar.gz
Algorithm Hash digest
SHA256 fb9bfb59bc7b44a8e4857f1493711bd174e36228552ec43fe60b39794fc29e31
MD5 e72a098e88f0da1c7bbd88df166b9de3
BLAKE2b-256 d78f566153289714b4bace5df89697ee656e402a0c40a1220caac64aac6f92d9

See more details on using hashes here.

File details

Details for the file pysimultanui-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pysimultanui-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 68.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pysimultanui-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c9c45752ac5e266129ca1b083df447f5025cb513e1d2491fea760b9f5110fe9
MD5 050f3cef6dc8cb20f25bc7aa77d133d1
BLAKE2b-256 a7de852e560b318cf3cc403fbcaa67bb8b5df03a7ed92253341de271e88de5ab

See more details on using hashes here.

Release history Release notifications | RSS feed

2.2.1

2 files

2.1.0

2 files

2.0.0

2 files

1.6.5

2 files

1.6.4

2 files

1.6.0

2 files

1.5.10

2 files

1.5.9

2 files

1.5.8

2 files

1.5.7

2 files

1.5.6

2 files

1.5.5

2 files

1.5.4

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

This release

1.1.1 This release

2 files

1.0.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2

2 files

0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page