mljar / mercury

Convert Jupyter Notebooks to Web Apps
https://RunMercury.com
GNU Affero General Public License v3.0
4.02k stars 255 forks source link

Add delete command #18

Closed pplonski closed 2 years ago

pplonski commented 2 years ago

There is add command to add notebook to Mercury. Please add delete command to remove unwanted notebook.

propainter commented 2 years ago

I can look into it, though I have very little django knowledge 😅

pplonski commented 2 years ago

The delete command should have a one parameter: the notebook path.

@propainter please take a look at the code and let me know if you can start with it.

MarvinKweyu commented 2 years ago

@pplonski Observed here, I can add the notebook multiple times. How would this work exactly? Would it use a timestamp? @propainter I could help if you need any assistance on the task.

MarvinKweyu commented 2 years ago

@pplonski So, mercury add my_notebook.ipynb adds a notebook. You run the command again, it adds the same notebook to the list and so forth. Should this be possible?

As well, before a delete command, should we have a listing of notebooks added? This command should be similar to add. List those notebooks in my current directory that have been added to the web then delete a specific one.

Feasibility? Or will this add complexity

pplonski commented 2 years ago

@MarvinKweyu thank you for pointing out the problem with notebook duplicates, I've added a ticket for this https://github.com/mljar/mercury/issues/36

pplonski commented 2 years ago

@MarvinKweyu @propainter @aplonska it is possible to delete a notebook from the Mercury.

The command is:

mercury delete notebook_path.ipynb

The changes are now in the master branch. It will go to the version 0.3.0 (probably in the end of this week). To install package with new changes:

pip install -q -U git+https://github.com/mljar/mercury.git@master

Additionally, I've added list command to print out all notebooks. Example:

mercury list