https://github.com/m-wells/jupyterparameters.jl

Enable passing of arguments to Julia Jupyter Notebooks from the command line.

https://github.com/m-wells/jupyterparameters.jl

Science Score: 10.0%

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

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary

Keywords

julia julia-jupyter-notebooks julia-package jupyter jupyter-notebook
Last synced: 9 months ago · JSON representation

Repository

Enable passing of arguments to Julia Jupyter Notebooks from the command line.

Basic Info
  • Host: GitHub
  • Owner: m-wells
  • License: agpl-3.0
  • Language: Julia
  • Default Branch: master
  • Size: 61.5 KB
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • Open Issues: 2
  • Releases: 0
Topics
julia julia-jupyter-notebooks julia-package jupyter jupyter-notebook
Created about 8 years ago · Last pushed over 6 years ago
Metadata Files
Readme License

README.md

JupyterParameters

Build Status codecov Coverage Status

Treat Jupyter notebooks as visual scripts which can be executed from the command line or from a script. JupyterParameters creates and executes a new copy of the notebook with the parameters that have been passed and preserves the original.

My main use case for JupyterParameters is for batch processes that I also want to generate inline sophiscated plots. This essentially creates log files of my data analysis along with plots. Running Jupyter notebooks from the command line is already possible using jupyter nbconvert --to notebook --execute mynotebook.ipynb The issue with using nbconvert in this fashion, is you can not pass arguments to the notebook.

Using jjnbparam provided by JupyterParameters you are able to pass variables to a notebook. julia using JupyterParameters jjnbparam(["notebook_orig.ipynb","notebook_new.ipynb","--varname1","varvalue1","--varname2","varvalue2",...]

How to call jjnbparam from the shell

We can create an alias in .bashrc as alias jjnbparam='julia -e "using JupyterParameters; jjnbparam()"' or add the following executable script (named jjnbparam) to your PATH. julia --color=yes -e ' try using JupyterParameters catch import Pkg; Pkg.add("JupyterParameters") using JupyterParameters end jjnbparam()' "$@" The command (from the shell) becomes jjnbparam notebook_orig.ipynb notebook_new.ipynb --varname1 varvalue1 --varname2 varvalue2 ...

The command above creates and executes a new copy of the notebook with the parameters that have been passed and preserves the original. If one wants to overwrite the original then jjnbparam notebook.ipynb notebook.ipynb --varname1 varvalue1 --varname2 varvalue2 ...

The target notebook needs to include a parameters cell (this does not have to be the first cell): Example of a tagged parameters cell

To create a parameters cell simply edit the cell's metadata to include the following: json { "tags": [ "parameters" ] } It is also helpful (for the user) to have a comment inside of the cell like so ```julia

this is the parameters cell

foo = 10 bar = "hi" `` In the cell abovefooandbar` are defined with what can be thought of as default values which will be used if the user does not replace them.

This project was inspired by papermill

Customizing Notebook Execution

The execution of the notebook can be customized with sh jjnbparam refnote.ipynb outnote.ipynb \ --kernel_name julia-nodeps-1.1 \ --timeout -1 \ --var1 1234 \ --var2 "abcd" where kernel_name specifies the IJulia kernel and timeout defines the maximum time (in seconds) each notebook cell is allowed to run. These values are passed under-the-hood to jupyter nbconvert as traitlets. If not passed the default values for jupyter nbconvert are used (again, see traitlets).

Owner

  • Name: Mark Wells
  • Login: m-wells
  • Kind: user
  • Location: Villanova, PA
  • Company: Penn State

GitHub Events

Total
Last Year

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 78
  • Total Committers: 1
  • Avg Commits per committer: 78.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
m-wells m****1@p****u 78
Committer Domains (Top 20 + Academic)
psu.edu: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 4
  • Total pull requests: 1
  • Average time to close issues: about 1 month
  • Average time to close pull requests: N/A
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 5.75
  • Average comments per pull request: 1.0
  • Merged pull requests: 0
  • 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
  • m-wells (3)
  • diegozea (1)
Pull Request Authors
  • JuliaTagBot (1)
Top Labels
Issue Labels
feature_request (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • julia 1 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
juliahub.com: JupyterParameters

Enable passing of arguments to Julia Jupyter Notebooks from the command line.

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1 Total
Rankings
Dependent repos count: 9.9%
Average: 34.4%
Dependent packages count: 38.9%
Forks count: 40.4%
Stargazers count: 48.5%
Last synced: 9 months ago