Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

nbpages

nbpages is a command line tool for managing a collection of Jupyter notebooks published on Github Pages. This project was inspired by the tools included with the Python Data Science Handbook by Jake Vanderplas.

Installation

pip install nbpages

To upgrade a previously installed version to the latest version

pip install nbpages --upgrade

Setting up the notebook repository

The first step in publishing a collection of notebooks on Github Pages is to create a repository on Github.com. Github Pages are enabled under the settings tab for the repository. Scroll down to the Github Pages heading and select master branch for the source. This is also a good time to select a theme for the published collection.

nbpages requires a local copy of the repository that can be created by cloning the remote repository. Then from the command line, navigate to the top level directory of the local repository and issue the command

nbpages --setup

Directories named notebooks and templates will be created if they do not already exist. A configuration file config will be created inside the directory using data read from the .git. Jinja templates README.md.jinja and notebook_header.jinja willed created if they don't already exist. These templates can be edited as required using data fields defined in config.

Notebook organization

Notebooks are maintained within the notebooks directory. Thare are organized into a chapter/section heirarchy using a filename prefix. Filenames have an nn.mm- prefix wherenn refers to the chapter number or, if a letter, to an Appendix. The digits mm refers to the section number. Section 00 is reserved to hold the chapter title and any introductory material. The notebooks must also have the usual .ipynb suffix.

Normal usage

Following setup, the normal use of nbpages is to execute the command line

nbpages

from the top level directory of the notebook repository. Normally this command would be between completing edits or additions to the notebooks and prior to a github commit. The command will

  • add or amend headers and navigation bars in all notebooks,
  • write a table of contents file
  • write a keyword index
  • write README.md using the template file

Utilities

To help achieve a consistent style over a collection of notebooks, use the command

nbpages --lint

to locate some forms of notebook 'lint'. A current list of additional features can be found

nbpages --help

Table of Contents

Keyword Index

Chapter 1.0 Style Guide

Chapter 2.0 Examples

Metadata

Release files for nbpages 0.0.1.dev10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nbpages 0.0.1.dev10
File Size Uploaded
nbpages-0.0.1.dev10.tar.gz 7.6 kB Details

Release files / nbpages-0.0.1.dev10.tar.gz

Download URL nbpages-0.0.1.dev10.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
68998ec7a62e27d60ea952d13bc6538f81929df696d33ab539708ab78b25dd28
BLAKE2b-256 checksum
How to use checksums
988c64d48e02de597697159d2ac2d94765004d6a6e2f102fc840429b9d81f2aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page