Skip to content

ytnb-embed

PyPI version Python Version License: MIT Downloads Code style: black CI

A lightweight, privacy-focused Python package for embedding YouTube videos in Jupyter Notebooks


Overview

ytnb-embed provides a simple and elegant way to embed YouTube videos directly in Jupyter Notebooks. Built with privacy and simplicity in mind, it uses YouTube's privacy-enhanced mode (youtube-nocookie.com) to protect user privacy while maintaining full video functionality.

Perfect for data scientists, educators, and researchers who want to enrich their notebooks with video content without compromising on privacy or simplicity.

Features

  • ๐ŸŽฅ One-line embedding - Embed any YouTube video with a single function call
  • ๐Ÿ”’ Privacy-first - Uses youtube-nocookie.com for enhanced privacy protection
  • ๐Ÿ“ Fully customizable - Adjust video player dimensions to fit your needs
  • ๐Ÿ›ก๏ธ Smart URL parsing - Handles all YouTube URL formats automatically
  • ๐Ÿ“ Built-in logging - Comprehensive logging for debugging and monitoring
  • โœ… Type hints - Full type annotation support for better IDE integration
  • ๐Ÿงช Well tested - Includes unit and integration tests
  • ๐Ÿš€ Lightweight - Minimal dependencies, maximum performance

Quick Installation

pip install ytnb-embed

Quick Example

from ytnb_embed import embed_yt

# Embed a YouTube video
embed_yt("https://www.youtube.com/watch?v=dQw4w9WgXcQ")

Next Steps