Skip to content

seelamramesh/NexusViewPro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NexusViewPro

PyPI version Python Version License: MIT

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.

🌟 Features

  • 🌐 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

πŸ“¦ Installation

Install NexusViewPro using pip:

pip install nexusviewpro

πŸš€ Quick Start

Rendering Websites

from 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)

Embedding YouTube Videos

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)

πŸ“– Documentation

render_site(url, width=900, height=600)

Renders a website inside a Jupyter notebook cell.

Parameters:

  • url (str): The URL of the website to render
  • width (int or str, optional): Width of the iframe. Default: 900
  • height (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.


embed_youtube(url, width=800, height=450)

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_ID
    • https://youtu.be/VIDEO_ID
    • VIDEO_ID (just the ID)
  • width (int, optional): Width of the video player in pixels. Default: 800
  • height (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")

🎯 Use Cases

  • 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

πŸ› οΈ Technical Details

Core Rendering Logic

Site Rendering Module (site.py)

  • Leverages IPython.display.IFrame for secure, sandboxed website rendering
  • Supports customizable dimensions for flexible layouts
  • Handles various URL formats and protocols

Smart Video Embedder (youtube.py)

  • 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

Architecture

nexusviewpro/
β”œβ”€β”€ __init__.py          # Package initialization and exports
β”œβ”€β”€ site.py              # Website rendering functionality
└── youtube.py           # YouTube video embedding functionality

βš™οΈ Requirements

  • Python 3.6+
  • IPython
  • Jupyter Notebook or JupyterLab

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ› Bug Reports & Feature Requests

If you encounter any issues or have suggestions for improvements, please open an issue on our GitHub Issues page.

πŸ“§ Contact

For questions or feedback, feel free to reach out:

πŸ™ Acknowledgments

  • 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

πŸ“Š Examples Gallery

Example 1: Learning Dashboard

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)

Example 2: Data Science Workflow

# View dataset documentation
render_site("https://www.kaggle.com/datasets")

# Watch related tutorial
embed_youtube("https://youtu.be/example-data-science-video")

Example 3: API Explorer

# 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!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors