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.1.1.tar.gz (4.5 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.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for jsontoqt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f904db2339777c9865b0654eb5626c0fbc0d4b10ba818d8fec4ffb982bf688c9
MD5 adf61014ef4288c3cbc8066dc0dbda3f
BLAKE2b-256 72b82c2b2c5d48f46101811e1080470dd6b24453b3a1c8604b525e1572b338c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jsontoqt-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23e9acc49eac843173f08b6c05791550d797e1f16d8af9906e73698c68c70f34
MD5 6ac0a3aa15a4f8491e856444de06bedf
BLAKE2b-256 9a601baa14d3bd39eb8f201d3afe5cec7d01b7afaaed4b7ee2540e9813dce744

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