Skip to content

Instantly share code, notes, and snippets.

@horvatha
Created April 18, 2024 14:40
Show Gist options
  • Save horvatha/55dc793f2d4cb92671991b2d01ff6057 to your computer and use it in GitHub Desktop.
Save horvatha/55dc793f2d4cb92671991b2d01ff6057 to your computer and use it in GitHub Desktop.
I've just returned from EuroPython Conference, and there was a good presentation: "From Jupyter Notebooks to a Python Package: The Best of Both Worlds". If I'm correct the video is not (yet?) on youtube, but the repo and the slides are here.
https://github.com/sesise0307/europython2023-package
I've used to use a similar setup, but I'll do the same (just w/ PyCharm instead of VSCode).
Creating packag(es) from frequently used functionalities.
%load_ext autoreload%autoreload 2
in Jupyter, and then from Jupyter (starting with !) or from commandline
pip install --editable <path>
And then I can use and even modify the package.
I think you can solve your problem using this setup:
you use the two functions in the same cell
or maintain a list of loaded files.
In the professional version of PyCharm you can handle Notebooks easily. You can use professional version for one month for free.
I am planning to experiment with it, when I'll have much time. Notebook can be refactored more easily if I'm right, and also you can debug it with breakpoints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment