renderer-pypi 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Navin Md, Nawshin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.1
2
+ Name: renderer_pypi
3
+ Version: 0.0.1
4
+ Summary: A simple Python package
5
+ Home-page: https://github.com/navinxqz/Renderer-PyPI-Package
6
+ Author: navinxqz
7
+ Author-email: navinmdnawshin@gmail.com
8
+ License: MIT
9
+ Project-URL: Bug Tracker, https://github.com/navinxqz/Renderer-PyPI-Package/issues
10
+ Classifier: Programming Language :: Python :: 3.8
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: ensure==1.0.2
21
+ Requires-Dist: py-youtube==1.1.7
22
+
23
+ # Renderer-PyPI-Package
24
+
25
+ This repo contains the source code for the Renderer package, which is available on PyPI. The Renderer package provides tools and utilities for rendering youtube videos and any web page over the jupyter notebook/colab and visualization in Python applications.
26
+
27
+ # How to run the package
28
+ 1. Create a virtual environment:
29
+ ```bash
30
+ conda create -n renderer python=3.8 -y
31
+ ```
32
+ or to create in a specific path:
33
+ ```bash
34
+ conda create -p ./envs/renderer python=3.8 -y
35
+ ```
36
+ 2. Activate the virtual environment:
37
+ ```bash
38
+ conda activate renderer
39
+ ```
40
+ or if created in a specific path:
41
+ ```bash
42
+ conda activate ./envs/renderer
43
+ ```
44
+ 3. Install the required packages:
45
+ ```bash
46
+ pip install -r requirements_dev.txt
47
+ ```
@@ -0,0 +1,25 @@
1
+ # Renderer-PyPI-Package
2
+
3
+ This repo contains the source code for the Renderer package, which is available on PyPI. The Renderer package provides tools and utilities for rendering youtube videos and any web page over the jupyter notebook/colab and visualization in Python applications.
4
+
5
+ # How to run the package
6
+ 1. Create a virtual environment:
7
+ ```bash
8
+ conda create -n renderer python=3.8 -y
9
+ ```
10
+ or to create in a specific path:
11
+ ```bash
12
+ conda create -p ./envs/renderer python=3.8 -y
13
+ ```
14
+ 2. Activate the virtual environment:
15
+ ```bash
16
+ conda activate renderer
17
+ ```
18
+ or if created in a specific path:
19
+ ```bash
20
+ conda activate ./envs/renderer
21
+ ```
22
+ 3. Install the required packages:
23
+ ```bash
24
+ pip install -r requirements_dev.txt
25
+ ```
@@ -0,0 +1,12 @@
1
+ [build-system]
2
+ requires = ['setuptools>=42.0', "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [tool.pytest.ini_options]
6
+ testpaths = [
7
+ "tests"
8
+ ]
9
+
10
+ [tool.mypy]
11
+ mypy_path = "src"
12
+ ignore_missing_imports = true
@@ -0,0 +1,36 @@
1
+ [metadata]
2
+ license = MIT
3
+ license_file = LICENSE
4
+ classifiers =
5
+ Programming Language :: Python :: 3.8
6
+ Programming Language :: Python :: 3.9
7
+ Programming Language :: Python :: 3.10
8
+ Programming Language :: Python :: 3.11
9
+ Programming Language :: Python :: 3.12
10
+ License :: OSI Approved :: MIT License
11
+ Operating System :: OS Independent
12
+
13
+ [options]
14
+ install_requires =
15
+ ensure==1.0.2
16
+ py-youtube==1.1.7
17
+ python_requires = >=3.8
18
+
19
+ [options.packages.find]
20
+ testing =
21
+ pytest>=7.1.3
22
+ mypy>=0.971
23
+ flake8>=5.0.4 #code format checking
24
+ tox>=3.25.1
25
+
26
+ [options.package_data]
27
+ renderer_pypi = py.typed
28
+
29
+ [flake8]
30
+ max-line-length = 160
31
+ exclude = __init__.py
32
+
33
+ [egg_info]
34
+ tag_build =
35
+ tag_date = 0
36
+
@@ -0,0 +1,25 @@
1
+ import setuptools
2
+ with open("README.md", "r", encoding="utf-8") as fh:
3
+ long_description = fh.read()
4
+
5
+ __version__ = "0.0.1"
6
+ REPO_NAME = "Renderer-PyPI-Package"
7
+ AUTHOR_USER_NAME = "navinxqz"
8
+ AUTHOR_EMAIL = "navinmdnawshin@gmail.com"
9
+ SRC_REPO = "renderer_pypi"
10
+
11
+ setuptools.setup(
12
+ name=SRC_REPO,
13
+ version=__version__,
14
+ author=AUTHOR_USER_NAME,
15
+ author_email=AUTHOR_EMAIL,
16
+ description="A simple Python package",
17
+ long_description=long_description,
18
+ long_description_content_type="text/markdown",
19
+ url=f"https://github.com/{AUTHOR_USER_NAME}/{REPO_NAME}",
20
+ project_urls={
21
+ "Bug Tracker": f"https://github.com/{AUTHOR_USER_NAME}/{REPO_NAME}/issues",
22
+ },
23
+ package_dir={"": "src"},
24
+ packages=setuptools.find_packages(where="src")
25
+ )
File without changes
@@ -0,0 +1,6 @@
1
+ class InvalidURLException(Exception):
2
+ """Exception raised for invalid URLs."""
3
+
4
+ def __init__(self, message: str = "The provided URL is invalid."):
5
+ self.message = message
6
+ super().__init__(self.message)
@@ -0,0 +1,18 @@
1
+ import os
2
+ import logging
3
+ import sys
4
+
5
+ logging_str = "[%(asctime)s - %(levelname)s: %(module)s]: %(message)s"
6
+ log_dir = "./logs"
7
+ log_filepath = os.path.join(log_dir, "running_logs.log")
8
+ os.makedirs(log_dir, exist_ok=True)
9
+
10
+ logging.basicConfig(
11
+ level=logging.INFO,
12
+ format=logging_str,
13
+ handlers=[
14
+ logging.FileHandler(log_filepath),
15
+ logging.StreamHandler(sys.stdout)
16
+ ],
17
+ )
18
+ logger = logging.getLogger("renderer_pypi")
@@ -0,0 +1,29 @@
1
+ from renderer_pypi.custom_exception import InvalidURLException
2
+ from renderer_pypi.logger import logger
3
+ import re
4
+ from IPython.display import HTML, display
5
+
6
+ def render_youtube_video(url: str, width: int = 780, height: int = 315):
7
+ try:
8
+ # pass
9
+ regex = r"(?:v=|\/)([0-9A-Za-z_-]{11}).*"
10
+ match = re.search(regex, url)
11
+ if not match:
12
+ raise InvalidURLException("The provided YouTube URL is invalid.")
13
+ video_id = match.group(1)
14
+
15
+ embed_url = f"https://www.youtube-nocookie.com/embed/{video_id}"
16
+
17
+ iframe = f"""
18
+ <iframe width="{width}" height="{height}"
19
+ src="{embed_url}" frameborder="0"
20
+ title="YouTube video player"
21
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
22
+ allowfullscreen></iframe>
23
+ """
24
+ display(HTML(iframe))
25
+ logger.info(f"Successfully rendered YouTube video for URL: {url}")
26
+ return "success"
27
+
28
+ except Exception as e:
29
+ raise e
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.1
2
+ Name: renderer_pypi
3
+ Version: 0.0.1
4
+ Summary: A simple Python package
5
+ Home-page: https://github.com/navinxqz/Renderer-PyPI-Package
6
+ Author: navinxqz
7
+ Author-email: navinmdnawshin@gmail.com
8
+ License: MIT
9
+ Project-URL: Bug Tracker, https://github.com/navinxqz/Renderer-PyPI-Package/issues
10
+ Classifier: Programming Language :: Python :: 3.8
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: ensure==1.0.2
21
+ Requires-Dist: py-youtube==1.1.7
22
+
23
+ # Renderer-PyPI-Package
24
+
25
+ This repo contains the source code for the Renderer package, which is available on PyPI. The Renderer package provides tools and utilities for rendering youtube videos and any web page over the jupyter notebook/colab and visualization in Python applications.
26
+
27
+ # How to run the package
28
+ 1. Create a virtual environment:
29
+ ```bash
30
+ conda create -n renderer python=3.8 -y
31
+ ```
32
+ or to create in a specific path:
33
+ ```bash
34
+ conda create -p ./envs/renderer python=3.8 -y
35
+ ```
36
+ 2. Activate the virtual environment:
37
+ ```bash
38
+ conda activate renderer
39
+ ```
40
+ or if created in a specific path:
41
+ ```bash
42
+ conda activate ./envs/renderer
43
+ ```
44
+ 3. Install the required packages:
45
+ ```bash
46
+ pip install -r requirements_dev.txt
47
+ ```
@@ -0,0 +1,14 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.cfg
5
+ setup.py
6
+ src/renderer_pypi/__init__.py
7
+ src/renderer_pypi/custom_exception.py
8
+ src/renderer_pypi/logger.py
9
+ src/renderer_pypi/youtube.py
10
+ src/renderer_pypi.egg-info/PKG-INFO
11
+ src/renderer_pypi.egg-info/SOURCES.txt
12
+ src/renderer_pypi.egg-info/dependency_links.txt
13
+ src/renderer_pypi.egg-info/requires.txt
14
+ src/renderer_pypi.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ ensure==1.0.2
2
+ py-youtube==1.1.7
@@ -0,0 +1 @@
1
+ renderer_pypi