Cross-platform, modular, quality-of-life tool kit for working with Jupyter notebooks
Project description
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: Apply custom CSS styling to your notebooks (Currently supports VS Code)
Installation
pip install nbqol
Or with Hatch:
hatch add nbqol
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
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 development dependencies
hatch env create
# Use development environment
hatch shell
# Install documentation dependencies (optional)
hatch env create docs
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nbqol-0.1.0.tar.gz.
File metadata
- Download URL: nbqol-0.1.0.tar.gz
- Upload date:
- Size: 40.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d0014016f73c62d8bd4929b2ed067e63423f4018b2a6cfb04ee55b96b5aef92
|
|
| MD5 |
3d82b17ef938f0b40bc44de55d2f8f49
|
|
| BLAKE2b-256 |
d41b84c3a2c00df380cdb6d37d4f541b905b3193efeefdf16c75ef56246e6499
|
File details
Details for the file nbqol-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nbqol-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
084980853cfe82eef029676f493b3597863d6c69cc7e45e567889bcff22063ba
|
|
| MD5 |
44fb80678ddb8de6dc5b8bffb41f33ac
|
|
| BLAKE2b-256 |
50a4dfce3daae3389b2246424f72ff243c911efa34a15878cdc3292d84497c99
|