davidbrochart / nbterm

Jupyter Notebooks in the terminal.
MIT License
756 stars 37 forks source link

Use pathlib internally and accept Paths as arguments #34

Closed JoshKarpel closed 3 years ago

JoshKarpel commented 3 years ago

I am playing with embedding nbterm in another application (https://github.com/JoshKarpel/spiel/pull/22 if you're interested) and noticed that Notebook expects strings for paths, but that all the internal usages can be covered by pathlib Paths. For my own purposes I just want my tooling to not complain when I pass a Path instead of a str (my application uses pathlib internally), but I figured that pathlib has a convenient API for doing some of the things you're doing, especially in main, so here's a PR that converts all of the internals to use pathlib.

JoshKarpel commented 3 years ago

Updated based on your recent changes on main - I think I preserved the logic.

davidbrochart commented 3 years ago

Thanks for rebasing. When I use your branch, and open an existing notebook with nbterm nb.ipynb, I can only see nb in the upper-left corner, instead of nb.ipynb.