Jupyter notebooks runner
Project description
nbr
NBR lets you run local and remote jupyter-notebooks.
Installation
In a terminal, run:
python3 -m pip install nbr
Usage
Launch a Jupyter server:
jupyter server --ServerApp.token='' --ServerApp.password='' --ServerApp.disable_check_xsrf=True
Execution a local notebook, using a remote server:
import nbr
import nbformat
import asyncio
async def main() -> None:
nb_file = nbformat.read("Untitled.ipynb", as_version=4)
async with nbr.NotebookRunner(host="127.0.0.1", port=8888) as runner:
result = await runner.execute(cells=nb_file.cells)
nb_file.cells = result.executed_cells
nbformat.write(nb_file, "executed_notebook.ipynb")
if __name__ == "__main__":
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nbr-0.0.1b0.tar.gz
(5.0 kB
view hashes)
Built Distribution
nbr-0.0.1b0-py3-none-any.whl
(6.2 kB
view hashes)