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