Skip to main content

PyamlSide2(ぴゃむるさいどつー)

PyPI version

PySide2 configuration in yaml format providing the most simple script.

Requirements

  • yaml
  • PySide2

Installation

cd <path-to-ReadableWidgets>/PyamlSide2
pip install .

Demo

python3 examples/chaos.py

Tutorial

1. create drawio-xml

Open draw.io.


Put the Rounded Rectangle and add text.


+----------------------+

| widget:unique-label |

+----------------------+


  • widget : widget name pushbutton, label, ...
  • unique-label : Unique label (also treated as a Key in Python).

Don't use compression flag. (Please uncheck.)

2. 🏁 drawio-xml -> YAML & Python (simple conversion)

rw_gen_xml2all -i <input .xml> -o <output directory>

2-1. Generate YAML file from drawio-xml

Although it is possible to convert directly from drawio-xml, conversion to YAML is recommended for readability.

rw_gen_xml2yaml -i <input .xml> -o <output .yaml>

2-2. Generate Python file from YAML

Create a sample Python program from a YAML file.

rw_gen_yaml2py -i <input .yaml> -o <output .py>

3. Run example python template

python3 <output .py (3rd step)> <input .yaml (3rd step)>

Template

Previously (v0.3.2)

See examples/simple_gui.py.

import sys
import os

from pyamlside2.mainwindow import PyamlSide2Window
from PySide2.QtWidgets import QApplication

class MainWindow(pyamlside2Window):
    def __init__(self):
        self.number = 0
        yaml_path = os.path.join(os.path.dirname(__file__), "../yaml/chaos.yaml")
        super().__init__(yaml_path)
        # your code -------------------------
        # ************ #
        # -----------------------------------
        self.show()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = MainWindow()
    sys.exit(app.exec_())

Test YAML 📝

pyamlside2_yaml is preview feature app.

pyamlside2_yaml <yaml-file-path or draw.io xml-file>
# pyamlside2_yaml PySide2/drawio_xml/example.xml

Elements (dev)

In yaml, you can add the following elements defined in PyQt.Widgets This may be added in the future.

  • pushbutton : definition of QPushButton
  • qlabel : definition of QLabel
  • qlcdnumber : definition of QLCDNumber
  • qprogressbar : definition of QProgressBar
  • qlineedit : definition of QLineEdit
  • qcheckbox : definition of QCheckbox
  • qslider : definition of QSlider
  • qspinbox : definition of QSpinBox
  • qcombobox : definition of QCombobox
  • image : definition of QLabel (using image path)
  • stylesheet : definition of Stylesheet (define as QLabel and setHidden=True)

YAML format

PyamlQt defines common elements for simplicity. Not all values need to be defined, but if not set, default values will be applied

WINDOW: # unique key (Define key)
  type: window
  x: 0
  y: 0
  width: 800
  height: 720
  title: "example"

slider2: # keyname
  type: qslider # QWidgets
  x_center: 500 # x center point
  y_center: 550 # y center point
  rect:
    width: 200 # QWidgets width
    height: 50 # QWidgets height
  max: 100 # QObject max value
  min: 0 # QObject min value
  default: 70 # QObject set default value
  text: "Slider" # Set Text
  style: # Setting style using stylesheet (css)
    font: 30px # font size
    color: #ff0000 # Color
    font-family: Ubuntu # font-family
  items: # Selectable items( Combobox's option )
    - a
    - b
    - c

Metadata

Release files for pyamlside2 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyamlside2 0.4.1
File Size Uploaded Provenance Actions
pyamlside2-0.4.1.tar.gz 15.7 kB Without provenance Details for pyamlside2-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyamlside2 0.4.1
File Interpreter ABI Platform Actions
pyamlside2-0.4.1-py3-none-any.whl Python 3 none any Details for pyamlside2-0.4.1-py3-none-any.whl

Total release size: 40.4 kB

Release files / pyamlside2-0.4.1.tar.gz

Download URL pyamlside2-0.4.1.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
617e0f05e5d72aac3f1c32479c2d3093fb99e474c2bbb29175021dd05a0255d1
BLAKE2b-256 checksum
How to use checksums
69269df9c23afbff9caff4049f11fc77bc5d9423dd8ae0c2530a009fdbb90df5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / pyamlside2-0.4.1-py3-none-any.whl

Download URL pyamlside2-0.4.1-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db1daf2bbd7c4c18c07651b9221e6e9619117127b04b52573a78646c03e7e22f
BLAKE2b-256 checksum
How to use checksums
a2e784ad102fef387ef1d1fc4638aa527a46d94dbb7ff8a3f3497e034377662a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Security for pyamlside2 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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