Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output generated code from low code UI directly into notebook cell #302

Open
1 task done
paddymul opened this issue Oct 16, 2024 · 0 comments
Open
1 task done

Output generated code from low code UI directly into notebook cell #302

paddymul opened this issue Oct 16, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers lowcode-UI python

Comments

@paddymul
Copy link
Owner

Checks

  • I have checked that this enhancement has not already been requested

How would you categorize this request. You can select multiple if not sure

Low Code UI

Enhancement Description

When you add commands to the low code UI, the python code should be injected into the next notebook cell from where the widget was embedded.

  • Changing the lowcode UI should update the same cell (not create a new cell)
    • If this is too difficult, add a button to inject the code into the next cell that can be manually clicked

Pseudo Code Implementation

This code creates a new cell in a place related to the current cursor position

from IPython.core.getipython import get_ipython

def create_new_cell(contents):
    shell = get_ipython()
    payload = dict(
        source='set_next_input',
        text=contents,
        replace=False,
    )
    return shell.payload_manager.write_payload(payload, single=False)

Prior Art

https://discourse.jupyter.org/t/im-trying-to-figure-out-a-couple-of-cell-operations-from-python/29276

https://github.com/jtpio/ipylab
jupyterlab/jupyterlab#13080
jupyterlab/jupyterlab#5789

@paddymul paddymul added enhancement New feature or request good first issue Good for newcomers python lowcode-UI labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers lowcode-UI python
Projects
None yet
Development

No branches or pull requests

1 participant