Package: kernel-run
kernel-run🔥🚀Instantly create and run a Kaggle kernel from any Jupyter notebook (local file or URL).$ pip install kernel-run --upgrade

$ kernel-run path/to/notebook.ipynb
Kernel created successfully: https://www.kaggle.com/aakashns/kr-notebook/edit

$ kernel-run http://cs231n.stanford.edu/notebooks/pytorch_tutorial.ipynb
Kernel created successfully: https://www.kaggle.com/aakashns/kr-pytorch-tutorial/editkernel-runuploads the Jupyter notebook to a private kernel in your Kaggle account, and launches a browser window so you can start editing/executing the code immediately.Installationpip install kernel-run --upgradeThe above command install a command-line tool calledkernel-runwhich can be invoked from the terminal/command prompt.Note: To allowkaggle-runto upload the notebook to your Kaggle account, you need to download theKaggle API credentials filekaggle.json. To download thekaggle.jsonfile:Go tohttps://kaggle.comLog in and go to your account pageClick the "Create New API Token" button in the "API" sectionMove the downloadedkaggle.jsonfile to the folder~/.kaggle/CLI Usage & OptionsRun thekernel-runcommand on your terminal/command prompt with a Jupyter notebook's path (or URL) as the argument:$ kernel-run path/to/notebook.ipynb
Kernel created successfully: https://www.kaggle.com/aakashns/kr-notebook/edit

$ kernel-run http://cs231n.stanford.edu/notebooks/pytorch_tutorial.ipynb
Kernel created successfully: https://www.kaggle.com/aakashns/kr-pytorch-tutorial/editThere are various options you can configure. Runkernel-run -hto see the options:usage: kernel-run notebook_path_or_url [-h] [--public] [--new] [--no-browser] [--strip-output] [--prefix PREFIX]

positional arguments:
  notebook_path_or_url  Path/URL of the Jupyter notebook

optional arguments:
  -h, --help            show this help message and exit
  --public              Create a public kernel
  --new                 Create a new kernel, if a kernel with the same name exists
  --no-browser          Don't open a browser window automatically
  --strip-output        Clear output cells before uploading notebook (useful for large files)
  --prefix PREFIX       Prefix added to kernel title to easy identification (defaults to 'kr/')Python APIYou can also use the library form a Python script or Jupyter notebook. It can be imported askernel_run.fromkernel_runimportcreate_kernelcreate_kernel('path/to/notebook.ipynb',public=True,no_browser=True)# Kernel created successfully: https://www.kaggle.com/aakashns/kr-notebook/editThe arguments tocreate_kernelare identical to the CLI options:defcreate_kernel(path_or_url,public=False,no_browser=False,new=False,strip_output=False,prefix='kr/',creds_path=None):"""Instantly create and run a Kaggle kernel from a Jupyter notebook (local file or URL)Arguments:path_or_url (string): Path/URL to the Jupyter notebookpublic (bool, optional): If true, creates a public kernel. A private kernelis created by default.no_browser (bool, optional): If true, does not attempt to automatically opena browser tab to edit the created Kernelnew (bool, optional): If true, creates a new Kernel by adding a random5-letter string at the end of the titleprefix (string, optional): A prefix added to the Kernel title, to indicate thatthe Kernel was created using kernel-runcreds_path (string, optional): Path to the 'kaggle.json' credentials file(defaults to '~/.kaggle/kaggle.json')strip_output (bool, optional): Clear output cells before uploading notebook."""CreditsDeveloped with love by the Jovian team (https://www.jvn.io)! Contributions welcome.