Skip to main content

No project description provided

Project description

NexusView

NexusView is a lightweight Python package for rendering websites and YouTube videos directly inside Jupyter and IPython notebooks.

It helps notebook users preview external web pages and embedded videos without leaving their notebook environment.

PyPI version Python versions License


Features

  • Render websites inside Jupyter notebooks using an IPython IFrame.
  • Render YouTube videos using a privacy-friendly youtube-nocookie.com embed URL.
  • Validate URLs before rendering.
  • Raise a custom exception for invalid or unsupported URLs.
  • Simple API for notebook-based workflows.

Installation

Install from PyPI:

pip install nexusview-package

For local development:

git clone https://github.com/deep1305/NexusView.git
cd NexusView
pip install -e .

Requirements

  • Python 3.12+
  • Jupyter Notebook, JupyterLab, Google Colab, or another IPython-compatible environment

Quick Start

Render a website

from NexusView.site import render_site

render_site("https://www.python.org")

Render a YouTube video

from NexusView.youtube import render_youtube_video

render_youtube_video("https://www.youtube.com/watch?v=dQw4w9WgXcQ")

API Overview

render_site(URL: str, width: str = "100%", height: str = "600") -> str

Renders a web page inside the notebook using an IPython IFrame.

Parameters

  • URL: Website URL to render.
  • width: Width of the iframe. Default is "100%".
  • height: Height of the iframe. Default is "600".

Returns

  • "success" if the page is rendered successfully.

Raises

  • InvalidURLException if the URL is invalid or unreachable.

Example

from NexusView.site import render_site

status = render_site("https://pandas.pydata.org", width="100%", height="500")
print(status)

render_youtube_video(url: str, width: int = 780, height: int = 440)

Renders a YouTube video inside the notebook.

Parameters

  • url: YouTube video URL.
  • width: Width of the embedded player.
  • height: Height of the embedded player.

Returns

  • "success" if the video is rendered successfully.

Raises

  • InvalidURLException if the URL does not contain a valid YouTube video ID.

Example

from NexusView.youtube import render_youtube_video

render_youtube_video("https://www.youtube.com/watch?v=ysz5S6PUM-U")

Error Handling

NexusView provides a custom exception for invalid URLs:

from NexusView.custom_exception import InvalidURLException

If an invalid or unsupported URL is provided, the package raises InvalidURLException.


Supported Environments

NexusView is intended for use in:

  • Jupyter Notebook
  • JupyterLab
  • Google Colab
  • Other IPython-compatible notebook environments

It may not behave as expected in plain Python terminal scripts because rendering depends on IPython display utilities.


Project Structure

NexusView/
├── src/
│   └── NexusView/
│       ├── __init__.py
│       ├── custom_exception.py
│       ├── logger.py
│       ├── site.py
│       └── youtube.py
├── tests/
├── README.md
└── pyproject.toml

Notes

  • Website rendering depends on whether the target site allows iframe embedding.
  • Some websites block iframe rendering through browser security headers such as X-Frame-Options or Content-Security-Policy.
  • YouTube rendering extracts the video ID from the provided URL and embeds it using youtube-nocookie.com.

Development

To install in editable mode:

pip install -e .

To run tests:

pytest

To run linting and type checks:

flake8 .
mypy src/

Contributing

Contributions, bug reports, and feature requests are welcome.

  1. Fork the repository.
  2. Create a feature branch.
  3. Make your changes.
  4. Submit a pull request.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.


Links

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

nexusview_package-0.0.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

nexusview_package-0.0.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file nexusview_package-0.0.2.tar.gz.

File metadata

  • Download URL: nexusview_package-0.0.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nexusview_package-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3f97c6d8e91dde6eeea903f4123db56f36c4eb41ac55260bd8251cf5cfd2828c
MD5 af56a494c7b09e6441f9907e6073dc11
BLAKE2b-256 c7a5aa2536818ccbce5ae06f84b82bc50eb169288b6d6c2ff9777225985f59f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexusview_package-0.0.2.tar.gz:

Publisher: python-publish.yml on deep1305/NexusView

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexusview_package-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nexusview_package-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4d23893bd66b40ae11c57ea90a33c2dc201a1126508bfa694fee007ea713260e
MD5 23cf47000ddfa6bd974304d9b3885b8d
BLAKE2b-256 484cc9fb80ce7abc3f2a89d787c50ba0c81accaad29d487027c061179ee5836b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexusview_package-0.0.2-py3-none-any.whl:

Publisher: python-publish.yml on deep1305/NexusView

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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