ViewMatrixPro 0.0.2__tar.gz → 0.0.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ViewMatrixPro
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: A small python package
5
5
  Home-page: https://github.com/Shubhamsharma1930/ViewMatrixPro
6
6
  Author: Shubhamsharma1930
@@ -4,7 +4,7 @@ with open("README.md", "r", encoding="UTF-8") as f:
4
4
  long_description = f.read()
5
5
 
6
6
 
7
- __version__ = "0.0.2"
7
+ __version__ = "0.0.3"
8
8
 
9
9
  REPO_NAME = "ViewMatrixPro"
10
10
  AUTHOR_USER_NAME = "Shubhamsharma1930"
@@ -0,0 +1,28 @@
1
+ from IPython import display
2
+ import urllib.request
3
+ from ViewMatrixPro.custom_exception import InvalidURLException
4
+ from ViewMatrixPro.logger import logger
5
+
6
+
7
+
8
+ def is_valid(URL: str) -> bool:
9
+ try:
10
+ response_status = urllib.request.urlopen(URL).getcode()
11
+ assert response_status == 200
12
+ logger.debug(f"response_status: {response_status}")
13
+ return True
14
+ except Exception as e:
15
+ logger.exception(e)
16
+ return False
17
+
18
+
19
+ def render_site(URL: str, width: str = "100%", height: str = "600") -> str:
20
+ try:
21
+ if is_valid(URL):
22
+ response = display.IFrame(src=URL, width=width, height=height)
23
+ display.display(response)
24
+ return "success"
25
+ else:
26
+ raise InvalidURLException
27
+ except Exception as e:
28
+ raise e
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ViewMatrixPro
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: A small python package
5
5
  Home-page: https://github.com/Shubhamsharma1930/ViewMatrixPro
6
6
  Author: Shubhamsharma1930
@@ -6,6 +6,7 @@ setup.py
6
6
  src/ViewMatrixPro/__init__.py
7
7
  src/ViewMatrixPro/custom_exception.py
8
8
  src/ViewMatrixPro/logger.py
9
+ src/ViewMatrixPro/site.py
9
10
  src/ViewMatrixPro/youtube.py
10
11
  src/ViewMatrixPro.egg-info/PKG-INFO
11
12
  src/ViewMatrixPro.egg-info/SOURCES.txt
File without changes
File without changes
File without changes