runningbirds
runningbirds

Reputation: 6615

save a juptyer notebook with specific name within the code

I have a Jupyter notebook that is more or a less a 'template' of how things are done. For example the notebook is a template of say each country's economic data. All of the plots, and analysis is standardized.

I'm looking for a way to have this saving done in a coded way rather than manually naming it myself. Is there anyway so that if I have a variable labeled as:

  my_assignment = 'india'

I could save the notebook name as

  file_name =   my_assignment + todays_date

 save(file_name)

I code in python.

Upvotes: 2

Views: 915

Answers (1)

AChampion
AChampion

Reputation: 30268

You may have to jump to %%javascript to interact with Jupyter, which is different to the ipython kernel that the python code is sent to, e.g.:

%%javascript
Jupyter.notebook.copy_notebook()

Not sure you can copy with a specific name.
You can programmaticly rename the current notebook with:

Jupyter.notebook.rename(<new_name>)

Upvotes: 2

Related Questions