amsico / pyqtschema Goto Github PK
View Code? Open in Web Editor NEWTranslate json schema to QWidgets
License: MIT License
Translate json schema to QWidgets
License: MIT License
the ui_schema dict should support an additional key to hide a widget similar to the ui:widget
:
ui:hidden
: bool (default should be False)ui:disabled
: bool (default is be False)Hello,
Currently this library uses PyQt5, which means that project using PySide2 or 6, and PyQt6 cannot make use of this library. We could use QtPy to be compatible with all bindings.
I'm willing to do it, but I don't know is this project is still being maintained.
the anyOf
keyword should be supported
Generalize the initialization of QWidgets by passing args and kwargs to base-classes.
Follows Arthur Milchior's proposal
introduce a test-structure and an example folder
see also
It appears to fail to generate form, when properties
key is missing. The properties
key is not required for json schema fields of type object. It should not be required by the forms generator. Otherwise it should be made clear that the generator requires it. However, in json schema, a field of type object without a properties field is the same as "properties": { }
or "additionalProperties": true
. Therefore, maybe it should be possible to omit the properties field.
"unit_under_test": {
"type": "object",
"properties": {
"ego_unit": {
"description": "The Ego Unit",
"type": "object"
}
}
}
Error:
groups.py", line 54, in populate_from_schema for name, sub_schema in schema['properties'].items(): KeyError: 'properties'
give users an option - for json schema properties that are arrays of file paths - to allow user to browse and select multiple files as the input mechanism - the current approach (browsing one at a time for each file path in an array) works well for instances where the number of files in array is small, however this does not work well when the number of file paths is large -
i think this could be implemented fairly easily by
class FilesPathSchemaWidget(FilepathSchemaWidget):
def _on_clicked(self, flag):
path = QFileDialog.getOpenFileNames()
self.path_widget.setText(path)
though i suppose you may want to change the qlineedit to a qlistbox and then you may have to parse the input list from the qfiledialog to add each item in the list to the qlistbox..
spin respect min/max and steps
The problem of course is that if multiple of is not satisfied at
initialization, then it can't be satisfied using only up and down. In
this case the user must type the number by hand.Once it's satisfied however, the number will always keep satisfying
the constraint
follow Arthur Milchior's proposal
I am installing pyqtschema version 0.1.9 and I am using pyqt6 as I am on mac m1, so I have to use pyqt6
After installing pyqtschema I am getting following error and it's taking too long to install
/Users/danyalaslam/.zshrc:11: no such file or directory: /Users/danyalaslam/.rbenv/bin/rbenv
/Users/danyalaslam/.zshrc:12: no such file or directory: /Users/danyalaslam/.rbenv/bin/rbenv
(venv_3.11) danyalaslam@Danyals-MacBook-Pro FA4.0 % pip install pyqtschema
Collecting pyqtschema
Using cached pyqtschema-0.1.9-py3-none-any.whl (19 kB)
Collecting jsonschema
Using cached jsonschema-4.17.3-py3-none-any.whl (90 kB)
Collecting PyQt5
Using cached PyQt5-5.15.9.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... -
follow Arthur Milchior's proposal
Show descriptions in all widgets
see also Arthur Milchior's proposal
Referncing appears to require specific format (i.e. #/definition/key), not allowing for arbitrarily deep references:
"$ref": "#/properties/files/items"
Error:
schema.py", line 54, in resolve_schema _first, definition, key = ident.split('/')
ValueError: too many values to unpack (expected 3)
Consider the following schema, generated with the following BaseModel:
class UnionIssue(BaseModel):
output: Union[str, Path] = Field(default=None)
{
'title': 'UnionIssue', 'description': 'Exporter configuration ',
'type': 'object',
'properties': {
'output': {
'title': 'Output',
'anyOf': [{'type': 'string'}, {'type': 'string', 'format': 'path'}]
}
}
}
Both allowed entries are strings, but the second has an additional path-format.
The schema raises an error:
[...]/pyqtschema/widgets/any_of.py", line 119, in state
_widgets[idx].state = _dict
IndexError: list index out of range
Hi,
To which extent is the allOf-keyword supported?
I've come across this code:
pyqtschema/src/pyqtschema/builder.py
Lines 122 to 127 in 1968ce3
Cheers,
Johannes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.