runpynb

Run Jupyter notebooks in command-line and Makefiles.

https://github.com/lsys/runpynb

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.9%) to scientific vocabulary

Keywords

cli jupyter jupyter-notebook makefile notebook-jupyter python
Last synced: 4 months ago · JSON representation ·

Repository

Run Jupyter notebooks in command-line and Makefiles.

Basic Info
Statistics
  • Stars: 3
  • Watchers: 3
  • Forks: 1
  • Open Issues: 0
  • Releases: 8
Topics
cli jupyter jupyter-notebook makefile notebook-jupyter python
Created over 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Run Jupyter notebooks quietly from command-line

PyPI GitHub release (latest by date)
PyPI - Python Version
DOI

runPyNB is a quick and dirty utility to run (and time) Jupyter notebooks from command-line and makefiles.

Quickstart

Install from PyPI bash pip install runpynb

General usage: runpynb <notebook(s)> [options] (".ipynb" not required)

  • runpynb: Run all notebooks in directory.

    $ runpynb

(back to top)

Usage

  • runpynb <notebook(s)> -q: Run quietly (-q).

    $ runpynb hello.ipynb -q

  • runpynb <notebook(s)> -qs: Run quietly (-q) as a sequence of workflow (-s). Errors (eg in error.ipynb) will break the workflow.

    $ runpynb error.ipynb hello.ipynb -qs

  • runpynb <notebook(s)> -o: Save output as separate notebook (-o), instead of overwriting existing notebook(s).

    $ runpynb hello.ipynb -o

(back to top)

Options

```bash usage: runpynb [-h] [-t TIMEOUT] [-s] [-o] [-v VERSION] [-q] [notebooks ...]

Run (and time) Jupyter notebooks silently in command-line.

positional arguments: notebooks List of Jupyter notebooks (*.ipynb) to be run (default=all notebooks in path).

optional arguments: -h, --help show this help message and exit -t TIMEOUT, --timeout TIMEOUT Seconds until a cell in the notebook timesout, which raises a Timeouterror exception (default is 3000=5 mins). -s, --sequence Sequence implicit in notebook lists. If error occurs somewhere, stop entire pipeline. -o, --output Save output as a separate notebook with "-out"-suffix (e.g. *-out.ipynb) instead of overwriting existing file. -v VERSION, --version VERSION Version of notebook to return (Default=No conversion). Notebook will be converted if necessary. -q, --quiet Be quiet and don't print messages (including run time). Caution: Does not suppress error messages. ```

(back to top)

Status

Documentation Status
Build Status
Tests codecov
CI
CLI
Doclinks

(back to top)


More on this package

This is a lightweight package that wraps around the official Jupyter nbformat and nbconvert modules.

My workflow involves using Jupyter notebooks to clean, and analyze data. I use this utility to run notebooks silently from the command-line and Makefiles (without converting from .ipynb files to .py files).

Related packages are guoquan/runnb and vinayak-mehta/nbcommands with a planned enhancement nbtime to run Jupyter notebooks from command-line.

(back to top)

Usage with Makefiles

A minimal workflow where get-data.ipynb takes 5000 seconds to prepare data.csv. And where analyze.ipynb uses data.csv to produce output.png. ```makefile .DEFAULT_GOAL := output.png

data.csv: get-data.ipynb runpynb $^ -t 5000

output.png: analyze.ipynb data.csv runpynb $< ```

(back to top)

License

This package is licensed under the MIT License.

Owner

  • Name: Lucas Shen Y. S.
  • Login: LSYS
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If found this software useful for your work and wish to cite it, please cite as below."
preferred-citation:
  authors:
  - family-names: "Shen"
    given-names: "Lucas"
  title: "runPyNB: Run Jupyter notebooks in command-line and Makefiles"
  year: 2022
  url: "https://pypi.org/project/runpynb/"
  repository-code: "https://github.com/LSYS/runpynb"
  license:  MIT license
  identifiers:
  - description: "This is from the archived snapshot of the code, supported by Zenodo."
    type: doi
    value: 10.5281/zenodo.6956486
  doi: 10.5281/zenodo.6956486

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 60
  • Total Committers: 1
  • Avg Commits per committer: 60.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Lucas Shen Y. S l****s@l****m 60
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 5
  • Total pull requests: 7
  • Average time to close issues: 7 days
  • Average time to close pull requests: about 2 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.71
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • LSYS (5)
Pull Request Authors
  • LSYS (7)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 50 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 3
    (may contain duplicates)
  • Total versions: 10
  • Total maintainers: 1
pypi.org: runpynb

Run (and time) Jupyter Notebooks for command-line and makefile

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 3
  • Downloads: 50 Last month
Rankings
Dependent repos count: 9.0%
Dependent packages count: 10.1%
Average: 20.1%
Forks count: 22.6%
Stargazers count: 25.0%
Downloads: 34.0%
Maintainers (1)
Last synced: 4 months ago
conda-forge.org: runpynb
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Average: 50.2%
Dependent packages count: 51.2%
Forks count: 57.4%
Stargazers count: 58.4%
Last synced: 4 months ago

Dependencies

docs/requirements.txt pypi
  • furo *
  • myst_parser *
requirements.txt pypi
  • nbconvert *
  • nbformat *
setup.py pypi
  • nbconvert *
  • nbformat *
tests/requirements_dev.txt pypi
  • black * development
  • coverage * development
  • mypy * development
  • pyflakes * development
  • pytest * development
.github/workflows/build.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/cli-dev.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/cli-pkg.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/cli.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/doclinks.yml actions
  • actions/checkout master composite
  • gaurav-nelson/github-action-markdown-link-check v1 composite
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • codecov/codecov-action v2 composite