Integrates fomily to jupyter notebook, which base on anywidget
Project description
jupyter-formily
Use formily in Jupyter.
Installation
pip install jupyter-formily
Usage
from jupyter_formily import Formily
example = Formily(schema, options, default_value)
example.display()
schema
can be constructed with Formily Designer or crafted manually.
options
allows you to tune the form to fit you need.
default_value
allows you to set initial value which follow schema.
options
is dict, and key as follow:
key | Type | Default value |
---|---|---|
show_modal | bool | True |
ok_label | string | "OK" |
cancel_label | string | "Cancel" |
ok_props | ISubmitProps | {} |
cancel_props | ButtonProps | {} |
form_props | IFormLayoutProps | {} |
modal_props | ModalProps | {} |
Check demo.ipynb
for more information.
Custom Components
Currently custom can not be used via Formily Designer, you have to add them manually. A trick to use custom components is to add a similar component in desinger as placeholder. And then replace it to the component you want by patching the generated schema.
File Picker
Select file path interactively.
{
"type": "string",
"name": "input_file",
"title": "Input File",
"x-decorator": "FormItem",
"x-component": "FilePicker",
"x-validator": [],
"x-component-props": {
"init_path": "./"
},
"x-decorator-props": {},
"x-designable-id": "8j01zeibhn3",
"x-index": 1
}
Development
Setup
You need to install dependencies both python and javascript. Please make sure you have installed poetry and yarn.
# python
poetry install
# javascript
cd vendor/formily && yarn
Start Server
cd vendor/formily && npm run dev Formily
Then you can check widget in demo.ipynb
.
Build
./build.sh
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
Built Distribution
Hashes for jupyter_formily-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e9c99a3154fc8bc0b4b6cc7d2802492d8bae3a96d535e0df6c720dd4409a662 |
|
MD5 | ce1e504fb1c05673b938fe7651696c95 |
|
BLAKE2b-256 | 02a007e02c9cc543029a004308170b9bae48ba3ef7813d3764d40d2aeb749c8f |