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.
Features
- Render websites inside Jupyter notebooks using an IPython
IFrame. - Render YouTube videos using a privacy-friendly
youtube-nocookie.comembed 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
InvalidURLExceptionif 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
InvalidURLExceptionif 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-OptionsorContent-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.
- Fork the repository.
- Create a feature branch.
- Make your changes.
- Submit a pull request.
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Links
- GitHub Repository: deep1305/NexusView
- PyPI: nexusview-package
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f97c6d8e91dde6eeea903f4123db56f36c4eb41ac55260bd8251cf5cfd2828c
|
|
| MD5 |
af56a494c7b09e6441f9907e6073dc11
|
|
| BLAKE2b-256 |
c7a5aa2536818ccbce5ae06f84b82bc50eb169288b6d6c2ff9777225985f59f8
|
Provenance
The following attestation bundles were made for nexusview_package-0.0.2.tar.gz:
Publisher:
python-publish.yml on deep1305/NexusView
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nexusview_package-0.0.2.tar.gz -
Subject digest:
3f97c6d8e91dde6eeea903f4123db56f36c4eb41ac55260bd8251cf5cfd2828c - Sigstore transparency entry: 1928243552
- Sigstore integration time:
-
Permalink:
deep1305/NexusView@d5b264a8244b7e5c31984e4ffa998446fc2c8b39 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/deep1305
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d5b264a8244b7e5c31984e4ffa998446fc2c8b39 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nexusview_package-0.0.2-py3-none-any.whl.
File metadata
- Download URL: nexusview_package-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d23893bd66b40ae11c57ea90a33c2dc201a1126508bfa694fee007ea713260e
|
|
| MD5 |
23cf47000ddfa6bd974304d9b3885b8d
|
|
| BLAKE2b-256 |
484cc9fb80ce7abc3f2a89d787c50ba0c81accaad29d487027c061179ee5836b
|
Provenance
The following attestation bundles were made for nexusview_package-0.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on deep1305/NexusView
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nexusview_package-0.0.2-py3-none-any.whl -
Subject digest:
4d23893bd66b40ae11c57ea90a33c2dc201a1126508bfa694fee007ea713260e - Sigstore transparency entry: 1928243683
- Sigstore integration time:
-
Permalink:
deep1305/NexusView@d5b264a8244b7e5c31984e4ffa998446fc2c8b39 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/deep1305
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d5b264a8244b7e5c31984e4ffa998446fc2c8b39 -
Trigger Event:
release
-
Statement type: