Skip to main content

NB-QOL

Cross-platform, modular, quality-of-life tool kit for working with Jupyter notebooks wherever you work with them.

Features

  • CUDA Device Management: Easily configure, monitor, and select CUDA devices for your notebook
  • Output Capture: Capture stdout, stderr, and logging in a clean, organized way
  • Path Operations: Utilities for working with notebook paths and Git repositories
  • IPython Configuration: Quickly configure IPython settings like autoreload
  • Notebook Styling: Auto-detect environment and apply appropriate CSS styling (VS Code, Jupyter Lab, etc.)
  • Notebook Processing: Convert, clean, analyze, and execute notebooks programmatically
  • Environment Detection: Detect notebook execution environment (VS Code, Jupyter, etc.)

Installation

From PyPI:

pip install nbqol

Latest development version:

pip install git+https://github.com/ColinConwell/NB-QOL.git

Quick Start

Here are some examples of what you can do with NB-QOL:

# Import the library
import nbqol

# Configure IPython
nbqol.set_autoreload('complete')  # Auto-reload modules
nbqol.hide_warnings()  # Hide warning messages

# Get environment settings
env_info = nbqol.get_main_env_settings()

# Manage CUDA devices
nbqol.count_cuda_devices()  # Count available CUDA devices
nbqol.cuda_device_report()  # Get detailed info about CUDA devices
nbqol.set_cuda_visibles(0)  # Make only device 0 visible

# Path operations
notebook_dir = nbqol.notebook_path()
git_root = nbqol.path_to_git_root()

# Capture output
with nbqol.capture_output() as captured:
    print("This will be captured")
    import logging
    logging.warning("This warning will be captured")
print(captured)

# Apply styling
nbqol.auto_style()  # Apply appropriate styling based on environment

Command Line Interface

NB-QOL also provides a command-line interface for common tasks:

# Show version
nbqol --version

# Show help
nbqol --help

# Get CUDA device information
nbqol device-info

# Apply styling to current environment
nbqol style

Documentation

For full documentation, visit docs/build/html/index.html after building the documentation:

# Recommended approach (includes tests)
./scripts/build_docs.sh

# Alternative approaches
cd docs && hatch run docs:build
cd docs && make html
cd docs && sphinx-build -b html source build/html

The build_docs.sh script runs tests to verify the package installation and documentation build before generating the HTML docs.

Development

# Clone the repository
git clone https://github.com/ColinConwell/NB-QOL.git
cd NB-QOL

# Install in development mode
pip install -e .

# Install development dependencies
pip install -e .[dev]

# Run tests
pytest tests/

# Install documentation dependencies
pip install -e .[docs]

# Build documentation
cd docs && sphinx-build -b html source build/html

Other Resources

Related Tools

  • nbdime - A tool from the Jupyter team for comparing and diffing Jupyter notebooks.
  • nb-clean - A tool for cleaning and compression Jupyter notebooks in GitHub and other version control systems.
  • nbstripout - A tool for stripping output from Jupyter notebooks for compression or presentation purposes.

Dependency Source Repos

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Metadata

Release files for nbqol 0.1.1

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

Source distribution (sdist)

Source distribution for nbqol 0.1.1
File Size Uploaded Provenance Actions
nbqol-0.1.1.tar.gz 70.9 kB Without provenance Details for nbqol-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nbqol 0.1.1
File Interpreter ABI Platform Actions
nbqol-0.1.1-py3-none-any.whl Python 3 none any Details for nbqol-0.1.1-py3-none-any.whl

Total release size: 111.7 kB

Release files / nbqol-0.1.1.tar.gz

Download URL nbqol-0.1.1.tar.gz
Size 70.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d37e3e13a3860aac34ff763adcda44a300a9bfc2f695f9faa32d3803d110bda7
BLAKE2b-256 checksum
How to use checksums
6ec9bd1c40f6bfa9b6883f87a450831923f2a8de0ce15313e5fb939295a4e426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / nbqol-0.1.1-py3-none-any.whl

Download URL nbqol-0.1.1-py3-none-any.whl
Size 40.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d1e2176c86dc05d7f2aa79d06baba953f2fe009cc7b0f74227bfd3af076e7be
BLAKE2b-256 checksum
How to use checksums
dfa40970dc323e46c3763889ab9250dbd45a042e9d2e05e7a970177f9ac3b9e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Security for nbqol 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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