joouha / euporie

Jupyter notebooks in the terminal
https://euporie.readthedocs.io
MIT License
1.54k stars 36 forks source link

[Feature Request] Load percent python scripts as Notebook #68

Closed danielcs88 closed 1 year ago

danielcs88 commented 1 year ago

Eupories is an amazing alternative to load Jupyter Notebooks. It would be amazing if there was a way to load as notebooks files that have cells in percent format, e.g.:

# %% [markdown]
# # Example

# %%
import pandas as pd

# %%
df = pd.DataFrame({"A": [1, 2, 3, 4]})
joouha commented 1 year ago

Thanks!

Yes I think this is a great idea.

I'd like to implement support for all of the formats supported by Jupytext, which include the percent format you mention.

joouha commented 1 year ago

I've got this working locally - jupytext makes this very easy to implement.

I just need to add some interface which allows you to choose whether to open text files as notebooks or text files, and to choose whether to save notebooks as notebooks or text files.

This should make it into the next release.

joouha commented 1 year ago

Hi - this is now implemented this in the dev branch.

You need to install the optional jupytext dependency. Then Python scripts with percentage format cells will be opened as notebooks by default:

Jupytext demo video