PyQt6 configuration in yaml format providing the most simple script.

Overview

PyamlQt(ぴゃむるきゅーと)

PyPI version

PyQt6 configuration in yaml format providing the most simple script.

Requirements

  • yaml
  • PyQt6, ( PyQt5 )

Installation

pip install PyamlQt

Demo

python3 examples/chaos.py

Template

See examples/simple_gui.py.

import sys
import os

from pyamlqt.create_widgets import create_widgets
import pyamlqt.qt6_switch as qt6_switch

qt6_mode = qt6_switch.qt6

if qt6_mode:
    from PyQt6.QtWidgets import QApplication, QMainWindow
else:
    from PyQt5.QtWidgets import QApplication, QMainWindow

YAML = os.path.join(os.path.dirname(__file__), "../yaml/chaos.yaml")

class MainWindow(QMainWindow):
    def __init__(self):
        self.number = 0
        super().__init__()

        # geometry setting ---
        self.setWindowTitle("Simple GUI")
        self.setGeometry(0, 0, 800, 720)
        
        # Template ==========================================
        self.widgets, self.stylesheet = self.create_all_widgets(YAML)
        for key in self.widgets.keys():
            self.widgets[key].setStyleSheet(self.stylesheet[key])
        # ==============================================

        # --- Your code ----
        # -*-*-*-*-*-*-*-*-*
        # -----------------
        
        self.show()

    # Template ==========================================
    def create_all_widgets(self, yaml_path: str) -> dict:
        import yaml
        widgets, stylesheet_str = dict(), dict()
        with open(yaml_path, 'r') as f:
            self.yaml_data = yaml.load(f, Loader=yaml.FullLoader)
        
            for key in self.yaml_data:
                data = create_widgets.create(self, yaml_path, key, os.path.abspath(os.path.dirname(__file__)) + "/../")
                widgets[key], stylesheet_str[key] = data[0], data[1]

        return widgets, stylesheet_str
    # ==============================================

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

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

key: # key name (Required for your scripts)
  type: slider # QWidgets
  x_center: 500 # x center point
  y_center: 550 # y center point
  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" # Text
  font_size: 30 # Text size [px]
  font_color: "#ff0000" # Text color
  font: "Ubuntu" # Text font
  font_bold: false # bold-text option
  items: # Selectable items( Combobox's option )
    - a
    - b
    - c

PyQt5 Mode

If you want to use PyQt5, you have to change the qt6_switch.py file.

  • Open the file and change the qt6_mode variable to False.
  • pip3 install PyQt5
  • pip3 install -v -e .
You might also like...
Hi Guys, here I am providing examples, which will help you in Lerarning Python

LearningPython Hi guys, here I am trying to include as many practice examples of Python Language, as i Myself learn, and hope these will help you in t

NVIDIA Merlin is an open source library providing end-to-end GPU-accelerated recommender systems, from feature engineering and preprocessing to training deep learning models and running inference in production.

NVIDIA Merlin NVIDIA Merlin is an open source library designed to accelerate recommender systems on NVIDIA’s GPUs. It enables data scientists, machine

phylotorch-bito is a package providing an interface to BITO for phylotorch

phylotorch-bito phylotorch-bito is a package providing an interface to BITO for phylotorch Dependencies phylotorch BITO Installation Get the source co

arxiv-sanity, but very lite, simply providing the core value proposition of the ability to tag arxiv papers of interest and have the program recommend similar papers.
arxiv-sanity, but very lite, simply providing the core value proposition of the ability to tag arxiv papers of interest and have the program recommend similar papers.

arxiv-sanity, but very lite, simply providing the core value proposition of the ability to tag arxiv papers of interest and have the program recommend similar papers.

ManimML is a project focused on providing animations and visualizations of common machine learning concepts with the Manim Community Library.
ManimML is a project focused on providing animations and visualizations of common machine learning concepts with the Manim Community Library.

ManimML ManimML is a project focused on providing animations and visualizations of common machine learning concepts with the Manim Community Library.

Sequential Model-based Algorithm Configuration

SMAC v3 Project Copyright (C) 2016-2018 AutoML Group Attention: This package is a reimplementation of the original SMAC tool (see reference below). Ho

My personal Home Assistant configuration.

About This is my personal Home Assistant configuration. My guiding princile is to have full local control of all my devices. I intend everything to ru

Interactive Terraform visualization. State and configuration explorer.
Interactive Terraform visualization. State and configuration explorer.

Rover - Terraform Visualizer Rover is a Terraform visualizer. In order to do this, Rover: generates a plan file and parses the configuration in the ro

Gin provides a lightweight configuration framework for Python

Gin Config Authors: Dan Holtmann-Rice, Sergio Guadarrama, Nathan Silberman Contributors: Oscar Ramirez, Marek Fiser Gin provides a lightweight configu

Releases(v0.3.0)
  • v0.3.0(Apr 28, 2022)

    Japanese

    PyamlQtはGUIデザイン初心者のためのGUI定義フォーマットです。コントリビューション大歓迎です!

    しばらくはAPIの破壊的変更が行われる可能性があります。

    変更点

    • 新しいモジュールPyamlQtWindow
      • 初期化には引数が必要です。(README.mdを読んでください)
      • デモプログラムがとてもシンプルになりました。

    English

    PyamlQt is a GUI definition format for GUI design beginners. Contributions are welcome!

    There is a possibility of destructive changes to the API for the time being.

    Changes

    • New module PyamlQtWindow.
      • Arguments are required for initialization. (Please read README.md)
      • The demo program is now very simple.

    import sys
    import os
    
    from pyamlqt.mainwindow import PyamlQtWindow
    from PyQt6.QtWidgets import QApplication
    
    YAML = os.path.join(os.path.dirname(__file__), ". /yaml/chaos.yaml")
    
    class MainWindow(PyamlQtWindow):
        def __init__(self):
            self.number = 0
            super(). __init__("title", 0, 0, 800, 720, YAML)
            self.show()
    
    if __name__ == '__main__':
        app = QApplication(sys.argv)
        window = MainWindow()
        sys.exit(app.exec())
    
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Apr 13, 2022)

    Japanese

    PyamlQtはGUIデザイン初心者のためのGUI定義フォーマットです。コントリビューション大歓迎です!

    しばらくはAPIの破壊的変更が行われる可能性があります。

    変更点

    • rect要素とstyle要素を追加し、stylesheetの仕様が大きく変更されました。
    • 複数のyamlからのロードをサポートします。パスは絶対パスを指定するか、GitHubなどのソースコードへのURL(raw.githubusercontent.com に続くURL)を指定してください。
      • URL指定する場合は~/.cache/pyamlqt/yaml以下にyamlがダウンロードされます。
      • ロード先のyamlファイルで同じファイル名・同じキー名を指定しないでください。再帰的にロードされてメモリを消費し続けます。

    English

    PyamlQt is a GUI definition format for GUI design beginners. Contributions are welcome!

    The API may undergo destructive changes for a while.

    Changes

    • The specification of stylesheet has been significantly changed with the addition of the rect and style elements.
    • Support for loading from multiple yaml files. Paths should be absolute paths or URLs to source code such as GitHub (URLs following raw.githubusercontent.com).
      • If you specify a URL, the yaml will be downloaded under ~/.cache/pyamlqt/yaml.
      • Do not specify the same file name and the same key name in the yaml file to be loaded. They will be loaded recursively and continue to consume memory.
    Source code(tar.gz)
    Source code(zip)
Owner
Ar-Ray
1st grade of National Institute of Technology(=Kosen) student. Associate degree, Hatena Blogger
Ar-Ray
Human4D Dataset tools for processing and visualization

HUMAN4D: A Human-Centric Multimodal Dataset for Motions & Immersive Media HUMAN4D constitutes a large and multimodal 4D dataset that contains a variet

tofis 15 Nov 09, 2022
Code of Periodic Activation Functions Induce Stationarity

Periodic Activation Functions Induce Stationarity This repository is the official implementation of the methods in the publication: L. Meronen, M. Tra

AaltoML 12 Jun 07, 2022
Official code of our work, Unified Pre-training for Program Understanding and Generation [NAACL 2021].

PLBART Code pre-release of our work, Unified Pre-training for Program Understanding and Generation accepted at NAACL 2021. Note. A detailed documentat

Wasi Ahmad 138 Dec 30, 2022
"Exploring Vision Transformers for Fine-grained Classification" at CVPRW FGVC8

FGVC8 Exploring Vision Transformers for Fine-grained Classification paper presented at the CVPR 2021, The Eight Workshop on Fine-Grained Visual Catego

Marcos V. Conde 19 Dec 06, 2022
Y. Zhang, Q. Yao, W. Dai, L. Chen. AutoSF: Searching Scoring Functions for Knowledge Graph Embedding. IEEE International Conference on Data Engineering (ICDE). 2020

AutoSF The code for our paper "AutoSF: Searching Scoring Functions for Knowledge Graph Embedding" and this paper has been accepted by ICDE2020. News:

AutoML Research 64 Dec 17, 2022
Code for paper [ACE: Ally Complementary Experts for Solving Long-Tailed Recognition in One-Shot] (ICCV 2021, oral))

ACE: Ally Complementary Experts for Solving Long-Tailed Recognition in One-Shot This repository is the official PyTorch implementation of ICCV-21 pape

Jiarui 21 May 09, 2022
Memory Efficient Attention (O(sqrt(n)) for Jax and PyTorch

Memory Efficient Attention This is unofficial implementation of Self-attention Does Not Need O(n^2) Memory for Jax and PyTorch. Implementation is almo

Amin Rezaei 126 Dec 27, 2022
Exe-to-xlsm - Simple script to create VBscript of exe and inject to xlsm

🎁 Exe To Office Executable file injection to Office documents: .xlsm, .docm, .p

3 Jan 25, 2022
🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022

🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022

Advanced Image Manipulation Lab @ Samsung AI Center Moscow 4.7k Dec 31, 2022
Trajectory Extraction of road users via Traffic Camera

Traffic Monitoring Citation The associated paper for this project will be published here as soon as possible. When using this software, please cite th

Julian Strosahl 14 Dec 17, 2022
PyTorch code for MART: Memory-Augmented Recurrent Transformer for Coherent Video Paragraph Captioning

MART: Memory-Augmented Recurrent Transformer for Coherent Video Paragraph Captioning PyTorch code for our ACL 2020 paper "MART: Memory-Augmented Recur

Jie Lei 雷杰 151 Jan 06, 2023
Create animations for the optimization trajectory of neural nets

Animating the Optimization Trajectory of Neural Nets loss-landscape-anim lets you create animated optimization path in a 2D slice of the loss landscap

Logan Yang 81 Dec 25, 2022
Interpretation of T cell states using reference single-cell atlases

Interpretation of T cell states using reference single-cell atlases ProjecTILs is a computational method to project scRNA-seq data into reference sing

Cancer Systems Immunology Lab 139 Jan 03, 2023
PyTorch implementation for 3D human pose estimation

Towards 3D Human Pose Estimation in the Wild: a Weakly-supervised Approach This repository is the PyTorch implementation for the network presented in:

Xingyi Zhou 579 Dec 22, 2022
CvT2DistilGPT2 is an encoder-to-decoder model that was developed for chest X-ray report generation.

CvT2DistilGPT2 Improving Chest X-Ray Report Generation by Leveraging Warm-Starting This repository houses the implementation of CvT2DistilGPT2 from [1

The Australian e-Health Research Centre 21 Dec 28, 2022
FairyTailor: Multimodal Generative Framework for Storytelling

FairyTailor: Multimodal Generative Framework for Storytelling

Eden Bens 172 Dec 30, 2022
Security evaluation module with onnx, pytorch, and SecML.

🚀 🐼 🔥 PandaVision Integrate and automate security evaluations with onnx, pytorch, and SecML! Installation Starting the server without Docker If you

Maura Pintor 11 Apr 12, 2022
Object DGCNN and DETR3D, Our implementations are built on top of MMdetection3D.

This repo contains the implementations of Object DGCNN (https://arxiv.org/abs/2110.06923) and DETR3D (https://arxiv.org/abs/2110.06922). Our implementations are built on top of MMdetection3D.

Wang, Yue 539 Jan 07, 2023
One line to host them all. Bootstrap your image search case in minutes.

One line to host them all. Bootstrap your image search case in minutes. Survey NOW gives the world access to customized neural image search in just on

Jina AI 403 Dec 30, 2022
Reproducing-BowNet: Learning Representations by Predicting Bags of Visual Words

Reproducing-BowNet Our reproducibility effort based on the 2020 ML Reproducibility Challenge. We are reproducing the results of this CVPR 2020 paper:

6 Mar 16, 2022