Skip to main content

Add your description here

Project description

📓 NotebookTester

uv

A fast, reliable, and parallel Jupyter notebook testing tool with caching support! Test your notebooks with confidence.

🌟 Features

  • 🚀 Parallel Execution: Test multiple notebooks simultaneously
  • ⏱️ Configurable Timeouts: Set custom timeouts for notebook execution
  • 💾 Smart Caching: Cache test results to avoid unnecessary re-runs
  • 🎯 Selective Testing: Only test modified notebooks
  • 📊 Detailed Logging: Comprehensive logs with test results and errors
  • 🛠️ CLI Support: Easy to use command-line interface

🔧 Installation

Choose your preferred package manager:

Using pip (slow legacy)

pip install notebooktester

Using uv (10-100x faster)

see uv docs for more info.

uv add notebooktester

🚀 Quick Start

Test a single notebook:

notebooktester path/to/your/notebook.ipynb

Test all notebooks in a directory:

notebooktester path/to/notebooks/directory

🎮 Command Line Options

notebooktester [OPTIONS] PATH

Options:

  • -t, --timeout SECONDS: Timeout in seconds for each notebook (default: 60)
  • -w, --workers NUMBER: Number of parallel workers (default: CPU count)
  • -c, --cache-dir PATH: Cache directory for test results (default: .notebookcache)
  • -v, --verbose: Enable verbose output
  • -f, --force: Ignore cache and force test execution

📋 Example Usage

Basic usage:

notebooktester notebooks/

With custom timeout and workers:

notebooktester notebooks/ -t 120 -w 4

Force re-run all tests:

notebooktester notebooks/ --force

🔍 Cache Behavior

NotebookTester maintains a cache of test results to optimize performance:

  • Only notebooks modified since their last test run are re-tested
  • If the notebook timed out, and the current timeout has not been increased, notebook is skipped
  • Cached results include success/failure status and error messages
  • Force flag (-f) bypasses the cache

📊 Output

The tool provides:

  • Progress bar for test execution
  • Colored console output for test results
  • Detailed logs in the logs/ directory
  • Summary of passed and failed tests

Example output:

>>notebooktester notebooks/ -t 120 -w 4
Running tests with 4 workers
Starting notebook tests - found 10 notebooks
✅ PASSED - notebook1.ipynb: Success
❌ FAILED - notebook2.ipynb: Cell execution error
⏰ TIMEOUT - notebook3.ipynb: A cell timed out

Test Summary: 8 passed, 2 failed

🤝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests

👤 Author

Raoul Grouls (Raoul.Grouls@han.nl)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notebooktester-0.1.0.tar.gz (54.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notebooktester-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file notebooktester-0.1.0.tar.gz.

File metadata

  • Download URL: notebooktester-0.1.0.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.2

File hashes

Hashes for notebooktester-0.1.0.tar.gz
Algorithm Hash digest
SHA256 535bb296c06f3e2b69f56cc43151ba1d7d8af0749494f90e6a3e74351a61dfe4
MD5 45038f4f2794d04a3e06251f16e14eab
BLAKE2b-256 29d670eb0a76e34d678b93b6761c70dd42bd9f2b9988134a3dcdab8cb258c7c1

See more details on using hashes here.

File details

Details for the file notebooktester-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for notebooktester-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0121f24c4c54bbe81108c2892a2d494a9688fa6c27fcb996d89f0765a5cbe6e
MD5 2a8983a16b893e55c7078c520f324eb6
BLAKE2b-256 66e037dfcca1d869222688c0176005bd813914e08adf649b5b5020b91156c84d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page