GithubHelp home page GithubHelp logo

jsoneditor's Introduction

Json Editor

A python script for editing `.json` file based on Qt framework
Demo

About The Project


json-editor

.json files are heavily dependent in production environment and there are many benefits of creating a standalone editor instead of editing the text file directly. Not everyone is fan of working with a text editor (like artists) and no one can be confident to avoid syntax error in their edits. Moreover, a standalone tool supports features like version control, validation, schema and more.

The goal of this tool initially serves as my model view programming practice in PyQt, but then I thought, why not iterate on it and make it user-friendly, portable and minimal? My goal now is to make this modular and easily embeddable, so to create a standardized way for displaying and editing .json file across applications.

Getting Started

Prerequisites

  • Qt: a module that supports different python qt bindings

    or alternatively, change the code below to whatever qt binding you have on your machine.

    from Qt import QtWidgets, QtCore, QtGui
    from Qt import _loadUi

Launch

  1. Unzip the json-editor package and rename is to something like jsonViewer

  2. You can either run main.py directly or:

    from jsonViewer import main
    main.show()

Features

Validation, sort and filtering

  • Data validation is a built-in feature that comes with the model/view architecture as type is preserved during setData() and data() methods. It then gets translated into qt element: str as QLineEdit; int as QSpinBox; float as QDoubleSpinBox

  • list and dict type data fully utilized the hierarchical support of QAbstractItemModel.

  • Sorting and Filtering are enabled with the help of QSortFilterProxyModel.

Serialization

Serialization and de-serialization in the QJsonModel enables functionalities like copy/paste (left) and drag/drop (right).

Copy and Paste Drag and Drop
copy/paste drag/drop

Raw View

The tool also has a built-in text editor with syntax highlighting known as the raw view.

As shown, the data between the tree view and the raw view are interchangeable.

Roadmap

  • Json text view with syntax highlight
  • Json schema support
  • File drop
  • Custom stylesheet
  • Scripting interface for modular support
  • Web deployment (maybe?)

Reference

Model View Programming

QJsonModel

jsoneditor's People

Contributors

leixingyu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.