Skip to main content

Convert JSON schemas into dynamic PySide6 GUI forms with no manual UI coding needed.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

JsonToQt

Convert JSON schemas into dynamic PySide6 GUI forms - no manual UI coding needed!


Overview

JsonToQt lets you define Qt-based forms declaratively in JSON. It parses the schema and generates forms with:

  • Buttons, radio buttons, checkboxes
  • Combo boxes, line edits, text edits
  • Spin boxes (int & double), and labels
  • Built-in support for wiring button callbacks by name

Use JsonToQt to speed up GUI prototyping, build dynamic config panels, or integrate with low-code workflows.


Features

  • Supports common PySide6 widgets from a JSON schema
  • Bind button callbacks by name to Python functions
  • Easily extendable for more widgets or custom behaviors
  • Simple to use with minimal dependencies (just PySide6)

Installation

pip install jsontoqt


Usage

Define your form schema (example.json):

{
  "title": "User Registration",
  "type": "object",
  "properties": {
    "username": {
      "type": "string",
      "title": "Username"
    },
    "submit": {
      "widget": "button",
      "text": "Submit",
      "callback": "on_submit"
    }
  }
}

Import JsonToQt and create a form

Usage

Define your form schema (example.json):

{ "title": "User Registration", "type": "object", "properties": { "username": { "type": "string", "title": "Username" }, "submit": { "widget": "button", "text": "Submit", "callback": "on_submit" } } }

Load the schema, create the form, bind callbacks, and run the app:

import json
from pathlib import Path
from PySide6.QtWidgets import QApplication
from jsontoqt import JsonForm

# Load the JSON schema from file
schema_path = Path("example.json")
with schema_path.open("r", encoding="utf-8") as f:
    schema = json.load(f)

def on_submit():
    print("Submit button clicked!")

def on_cancel():
    print("Cancel button clicked!")

app = QApplication([])

# Create the form
form = JsonForm(schema)

# Bind callbacks from JSON to Python functions
form.bind_callbacks({
    "on_submit": on_submit,
    "on_cancel": on_cancel,
})

form.show()

app.exec()

Requirements

  • Python 3.8+
  • jsontoqt

License

MIT License


Contribution

Contributions and issues are welcome! Feel free to open a PR or suggest new features.

Project details


Download files

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

Source Distribution

jsontoqt-0.2.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

jsontoqt-0.2.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file jsontoqt-0.2.0.tar.gz.

File metadata

  • Download URL: jsontoqt-0.2.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for jsontoqt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 57be0c8bcd87e9ae6af42a95a6a3c9be3dc9bb0150fb1377d20aa949972b44db
MD5 ba84f7a0ce86b137a14f6495fd13f313
BLAKE2b-256 e1626fa4e162660836788b6d97c00a6b606d02d1fd73d220f4a057ed6303ebca

See more details on using hashes here.

File details

Details for the file jsontoqt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: jsontoqt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for jsontoqt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb5e42f84a654255751d85edcb1b8f97ec5c519a71ae57e08dee4c4e8d69a309
MD5 70ca945806c2499b56c64fb91e048162
BLAKE2b-256 c8221850c155361e4771392ba38cfce6676a6022e34dea347dfd66f4aabcc19f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page