Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danporter/jupyter_editor
Python code to create, open and edit jupyter notebooks remotely.
https://github.com/danporter/jupyter_editor
Last synced: 12 days ago
JSON representation
Python code to create, open and edit jupyter notebooks remotely.
- Host: GitHub
- URL: https://github.com/danporter/jupyter_editor
- Owner: DanPorter
- License: gpl-3.0
- Created: 2020-01-20T15:13:04.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-21T11:45:12.000Z (almost 4 years ago)
- Last Synced: 2024-12-15T12:42:26.364Z (2 months ago)
- Language: Python
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jupyter Editor
Create, open and edit jupyter notebook files.By Dan Porter, Diamond Light Source Ltd. 2020
### What is this?
jupyter_editor load Jupyter notebook **.ipynb* files (json) and can edit the contents:
- Add new python cells
- Add new markdown cells
- Edit source of current cells
- append to current file or create new *.ipynb files
- give cells a hidden reference so the correct cell will always be changed.**Remember:**
- Only the .ipynb file is changed, it does not update the jupyter server.
- Save the Jupyter notebook before loading the current file
- Refresh the Jupyter notebook page after updating the file### Usage:
```commandline
ipython -i -m jupyter_editor notebook.ipynb
```
Or use the GUI:
```commandline
ipython -m jupyer_editor gui
```
### Example:
```python
import jupyter_editor as je# Create new notebook/ open notebook
notebook = je.NoteBook(r"~/autoNotebook.ipynb")
print(notebook)# Add code cell
notebook.append_code("#This is some new code\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n", name='imports')
notebook.save() # this will overwrite the current notebook file, any unsaved changes on the jupyter server will be lost.
# Now refresh jupyter notebook in the browser to see changes# Edit notebook using 'name' tag
notebook.edit_by_name('imports', 'import sys, os\n')
notebook.save()
```