Package: open-notebook
open-notebookA python cli program to openjupyternotebooks from a central server.OverviewI typically run a singlejupyternotebook server, and want to launch notebooks
from several locations in the file system. This can be done from thetreeview
of jupyter notebook, but I want to quickly open notebooks from the command line
using the central server.open-notebookwill open notebooks from anywhere
relative to a central server.FeaturesCan specify options likehost, andportfrom the command lineDefaults can be configured using the configuration file(s).open-notebook.toml.Open bothjupyternotebooks, and directories (in tree view).StatusThis package is actively used by the author. Please feel free to create a pull
request for wanted features and suggestions!Quick startUse one of the followingpipinstallopen-notebookorcondainstall-cwpk-nistopen-notebookExample usageOptionsThe main command-line program isopen-notebookwith the following options:$open-notebook--help
usage:open-notebook[-h][--hostHOST][-pPORT][-rROOT][--dir-prefixDIR_PREFIX][--file-prefixFILE_PREFIX][--reset][-cCONFIG][--create-config][--overwrite][--version][-v][--dry][paths...]Programtoopenjupyternotebooksfromcentralnotebookserver.

positionalarguments:pathsfileorpathstoopen

options:-h,--helpshowthishelpmessageandexit--hostHOSTHostname(default='localhost')-pPORT,--portPORTPort(default='8888')-rROOT,--rootROOTDirectoryserverswasstartedin.Defaultstocurrentworkingdirectory.--dir-prefixDIR_PREFIXDirectoryprefix(default='tree')--file-prefixFILE_PREFIXFileprefix(default='notebooks')--reset-cCONFIG,--configCONFIGConfigstyletouse.Thisisthenameofaheaderinoneoftheconfigfiles.--create-configIfpassed,create.open-notebook.ini--overwritePasstooverwrite`~/.open-notebook.toml`ifitexistswith`--create-config`--versionPrintoutprogramversion-v,--verboseSetverbositylevel.Canpassmultipletimes.--dryDryrun.

Youcansetoptionswiththeconfigurationfiles".open-notebook.toml".Configuration
filesarefoundinthecurrentdirectory,gitroot(ifinagittrackedtree),andthe
homedirectory.Notethatallthesefilesareconsidered,inorder.Thatis,youcould
overrideasinglevalueinthecurrentdirectory,andtherestwouldbeinheritedfrom,inorder,gitrootandthenthehomedirectory.Equivalently, you can use the short namenopen, or usepython -m open_notebook.Basic usageTo open directory tree view:open-notebook.To open a jupyter notebook (here using the short namenopen):nopenpath/to/notebook.ipynbTo specify where the central server is running, use the-r/--rootoption. For
example, if the server is started in the directory "~/test", then you'd pass--root ~/test. For example:# start servercd~/test
jupyternotebook# cd to some other directory under where notebook was startedcd~/test/a/different/directory
open-notebook-r~/testexample.ipynbConfiguration fileIf you always start a notebook in the same place, you can configureopen-notebookas follows:# ~/.open-notebook.tomlroot="~/test"port="8888"Options name in the configuration file.open-notebook.tomlare the same as the
command-line options above (replacing dashes with underscores, so, e.g., instead
of--dir-prefix value, you'd seddir_prefix = "value"in the configuration
file).If you use more than one server, you can have multiple notebook configurations.
For example, you can specify that the configurationaltuses port8889and
is run in the home directory using:# ~/.open-notebook.tomlroot="~/test"port="8888"[alt]root="~/"port="8889"The default behavior is the same as above. To use thealtconfig, then use:# will use root="~/" and port="8889".  Other options inherited.open-notebook-calt...Multiple configuration filesopen-notebooksearches for configuration files.open-notebook.tomlin the
current directory, the root of a git repo (if you're currently in a git repo),
and finally in the home directory. Options are read, in order, from command-line
options, current directory config, git root config, and home directory config
file. This means that you can specify common configurations at the home level,
and then override single options at higher levels. For example, if we have:# ~/.open-notebook.tomlroot="~/"host="8889"# ~/a/b/.open-notebook.tomlhost="9999"cda/b# this will open notebook with root="~/" and host="9999"open-notebookexample.ipynbDocumentationSee thedocumentationfor further details.LicenseThis is free software. SeeLICENSE.ContactThe author can be reached atwpk@nist.gov.CreditsThis package was created usingCookiecutterwith theusnistgov/cookiecutter-nist-pythontemplate.ChangelogChangelog foropen-notebookUnreleasedSee the fragment files inchangelog.dThis software was developed by employees of the National Institute of Standards
and Technology (NIST), an agency of the Federal Government. Pursuant to title 17
United States Code Section 105, works of NIST employees are not subject to
copyright protection in the United States and are considered to be in the public
domain. Permission to freely use, copy, modify, and distribute this software and
its documentation without fee is hereby granted, provided that this notice and
disclaimer of warranty appears in all copies.THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, EITHER
EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY
THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND FREEDOM FROM
INFRINGEMENT, AND ANY WARRANTY THAT THE DOCUMENTATION WILL CONFORM TO THE
SOFTWARE, OR ANY WARRANTY THAT THE SOFTWARE WILL BE ERROR FREE. IN NO EVENT
SHALL NIST BE LIABLE FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR
IN ANY WAY CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
CONTRACT, TORT, OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY PERSONS OR
PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED FROM, OR AROSE OUT
OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR SERVICES PROVIDED HEREUNDER.Distributions of NIST software should also include copyright and licensing
statements of any third-party software that are legally bundled with the code in
compliance with the conditions of those licenses.