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
File details
Details for the file jupyter_formily-0.0.7.tar.gz
.
File metadata
- Download URL: jupyter_formily-0.0.7.tar.gz
- Upload date:
- Size: 701.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.12 Linux/5.15.90.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e0fd96178ea2c33fc16d4fe94533e6d219185016d6a4d3cd64ea159d888697e |
|
MD5 | c51d4f01646ed168efa17e3e94677e93 |
|
BLAKE2b-256 | 133e947006bf3e6f1e3f9806aef36f5d9ed8cdfa68f72c88cba76ca3a156484f |
File details
Details for the file jupyter_formily-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: jupyter_formily-0.0.7-py3-none-any.whl
- Upload date:
- Size: 711.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.12 Linux/5.15.90.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71fe2f3b19ba7eff0e271763801c83523b248b5fe069d6516722c00483312892 |
|
MD5 | e8289be28851d50289942e70509d0350 |
|
BLAKE2b-256 | e1aa31dd007e61f51f787ffb3daf3bec4fcda6bb587e0628d88db1fdacdce8cd |