
How do I edit a jupyter notebook ipynb file with python? - bashit
I wrote a simple note taking application that automates a few things for me when writing notes in markdown style. I can share the gitlab link if need be but perhaps a small description of my problem might be enough...<p>My python application which is very dumb and simple (does what I want) accomplishes a few simple tasks like...<p>* Inserting a markdown style timestamp for each new entry which links to a table of contents section name<p>* Logging complex commands from your bash_history at the end of the day<p>* Automatically archiving notes in a file using a markdown style table of contents<p>* Automatically syncing your notes (using git) with a remote repo on a hosting service like GitHub.<p>This all works fine if I&#x27;m taking notes using a simple <i>.md (markdown) file. However, if I want automate this in the same way with a jupyter notebook ipynb file it becomes extremely more complicated. The ipynb file looks like it&#x27;s in a json&#x27;ish format where some of it looks enrypted and apparently i need to have a notebook server running to open it??<p>Much of my text that isn&#x27;t code in my personal jupyter notebook is formatted in markdown. I have a markdown style table of contents very similar to how I mentioned above. Therefore, it would really be nice if I could open a ipynb file like i do with python, sort it, write a line of text to it. How do I accomplish this?<p>Currently, I do something like the following when I want to insert some text into a </i>.md (markdown) file. Which is simple...<p>with open(somefile, &#x27;r&#x27;) as f:<p>lines = f.readlines()<p>lines.insert(lineNumberToInsertAt, someText)<p>with open(somefile, &#x27;w&#x27;) as f:<p>f.writelines(lines)<p>I can&#x27;t just open a ipynb file like this and write to it so how can I accomplish this?<p>Also I&#x27;m new to this site and noticed that there are some links that say &quot;Ask HN: Some question&quot;. How do I appropriately post questions versus clogging up the main page which is more for articles?
======
suff
Install PyCharm then pip (or pip3) install jupyter.

~~~
bashit
thanks suff ~ I'm having a hard time wording this question but I know how to
install jupyter notebook and edit it using the jupyter notebook application.
That is easy. My question was how to automate the tasks of..

Open the notebook file Grabbing the current time and inserting it into the
file at line (x). Saving and closing the file.

I want to automate those three tasks using the python language.

