NexusViewPro is a powerful Python package that brings interactive web content directly into your Jupyter notebooks. Seamlessly render websites and embed YouTube videos without leaving your notebook environment.
- π Website Rendering: Display any secure website inside notebook cells using IFrame technology
- π₯ YouTube Video Embedding: Smart parser that handles multiple YouTube URL formats
- π± Responsive Design: Customizable width and height for optimal viewing
- π Secure: Leverages IPython.display for safe content rendering
- β‘ Simple API: Intuitive functions that just work
Install NexusViewPro using pip:
pip install nexusviewprofrom nexusviewpro import render_site
# Render a website with default settings
render_site("https://www.python.org")
# Customize dimensions
render_site("https://www.github.com", width=800, height=600)
# Full-width responsive rendering
render_site("https://www.stackoverflow.com", width="100%", height=700)from nexusviewpro import embed_youtube
# Support for various YouTube URL formats
embed_youtube("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
embed_youtube("https://youtu.be/dQw4w9WgXcQ")
embed_youtube("dQw4w9WgXcQ") # Just the video ID works too!
# Customize video player size
embed_youtube("https://www.youtube.com/watch?v=dQw4w9WgXcQ", width=800, height=450)Renders a website inside a Jupyter notebook cell.
Parameters:
url(str): The URL of the website to renderwidth(int or str, optional): Width of the iframe. Default: 900height(int, optional): Height of the iframe in pixels. Default: 600
Example:
render_site("https://www.wikipedia.org", width="100%", height=800)Note: Some websites may restrict iframe embedding due to security policies (X-Frame-Options). If a site doesn't render, this is likely the reason.
Embeds a YouTube video player inside a Jupyter notebook cell.
Parameters:
url(str): YouTube video URL or video ID. Supports multiple formats:https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDVIDEO_ID(just the ID)
width(int, optional): Width of the video player in pixels. Default: 800height(int, optional): Height of the video player in pixels. Default: 450
Example:
# All of these work!
embed_youtube("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
embed_youtube("https://youtu.be/dQw4w9WgXcQ")
embed_youtube("dQw4w9WgXcQ")- Educational Content: Display documentation and tutorials alongside your code
- Data Source Exploration: Preview web APIs and data sources in your analysis workflow
- Presentation Enhancement: Create rich, interactive notebooks with embedded media
- Research Notebooks: Reference and display online resources without context switching
- Tutorial Creation: Build comprehensive guides with live examples
- Leverages
IPython.display.IFramefor secure, sandboxed website rendering - Supports customizable dimensions for flexible layouts
- Handles various URL formats and protocols
- Intelligent URL parser supporting multiple YouTube URL formats
- Automatically extracts video IDs from various URL structures
- Generates standard YouTube embed HTML with privacy-enhanced mode
- Provides clean, responsive video player integration
nexusviewpro/
βββ __init__.py # Package initialization and exports
βββ site.py # Website rendering functionality
βββ youtube.py # YouTube video embedding functionality
- Python 3.6+
- IPython
- Jupyter Notebook or JupyterLab
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have suggestions for improvements, please open an issue on our GitHub Issues page.
For questions or feedback, feel free to reach out:
- GitHub: @yourusername
- Email: [email protected]
- Built with β€οΈ using IPython's display capabilities
- Inspired by the need for seamless content integration in Jupyter notebooks
- Thanks to all contributors and users of NexusViewPro
from nexusviewpro import render_site, embed_youtube
# Display Python documentation
render_site("https://docs.python.org/3/", width="100%", height=500)
# Embed a Python tutorial video
embed_youtube("https://www.youtube.com/watch?v=_uQrJ0TkZlc", width=700)# View dataset documentation
render_site("https://www.kaggle.com/datasets")
# Watch related tutorial
embed_youtube("https://youtu.be/example-data-science-video")# Display API documentation
render_site("https://api.example.com/docs", height=700)Made with π» for the Jupyter community
Star β this repo if you find it useful!