LinkInCell 0.0.1__tar.gz → 0.0.4__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.4
4
4
  Summary: A small python package
5
5
  Home-page: https://github.com/readwanur19/LinkInCell
6
6
  Author: readwanur19
@@ -10,6 +10,8 @@ Project-URL: Bug Tracker, https://github.com/readwanur19/LinkInCell/issues
10
10
  Classifier: Programming Language :: Python :: 3.8
11
11
  Classifier: Programming Language :: Python :: 3.9
12
12
  Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
13
15
  License-File: LICENSE
14
16
  Requires-Dist: ensure==1.0.2
15
17
  Requires-Dist: py-youtube==1.1.7
@@ -44,6 +46,18 @@ You can install `LinkInCell` directly from PyPI using pip:
44
46
  pip install LinkInCell
45
47
  ```
46
48
 
49
+ ```python
50
+ from LinkInCell.youtube import render_youtube
51
+
52
+ render_youtube("https://www.youtube.com/watch?v=h25pePMdoPA&t=712s")
53
+ ```
54
+
55
+ ```python
56
+ from LinkInCell.web import render_web
57
+
58
+ render_web("https://www.google.com/")
59
+ ```
60
+
47
61
  # How to install this package in your system
48
62
 
49
63
  ```bash
@@ -65,25 +79,26 @@ Using `LinkInCell` is incredibly simple. Import the package and pass your target
65
79
 
66
80
  ### 1. Rendering a Website
67
81
 
68
- python
69
- from linkincell import render_web
82
+ ```python
83
+ from LinkInCell.web import render_web
70
84
 
71
85
  # Render a full webpage inside your notebook cell
72
86
  render_web("https://en.wikipedia.org/wiki/Python_(programming_language)", width="100%", height="500px")
73
-
87
+ ```
74
88
 
75
89
  ### 2. Rendering a YouTube Video
76
90
 
77
- python
78
- from linkincell import render_youtube
91
+ ```python
92
+ from LinkInCell.youtube import render_youtube
79
93
 
80
94
  # Pass the standard YouTube URL or the video ID
81
95
  render_youtube("https://www.youtube.com/watch?v=dQw4w9WgXcQ", width=800, height=450)
96
+ ```
82
97
 
83
98
 
84
99
  ## 🛠️ Requirements
85
100
 
86
- * Python 3.6+
101
+ * Python 3.8+
87
102
  * Jupyter Notebook or JupyterLab
88
103
  * `IPython` (Usually comes pre-installed with Jupyter)
89
104
 
@@ -23,6 +23,18 @@ You can install `LinkInCell` directly from PyPI using pip:
23
23
  pip install LinkInCell
24
24
  ```
25
25
 
26
+ ```python
27
+ from LinkInCell.youtube import render_youtube
28
+
29
+ render_youtube("https://www.youtube.com/watch?v=h25pePMdoPA&t=712s")
30
+ ```
31
+
32
+ ```python
33
+ from LinkInCell.web import render_web
34
+
35
+ render_web("https://www.google.com/")
36
+ ```
37
+
26
38
  # How to install this package in your system
27
39
 
28
40
  ```bash
@@ -44,25 +56,26 @@ Using `LinkInCell` is incredibly simple. Import the package and pass your target
44
56
 
45
57
  ### 1. Rendering a Website
46
58
 
47
- python
48
- from linkincell import render_web
59
+ ```python
60
+ from LinkInCell.web import render_web
49
61
 
50
62
  # Render a full webpage inside your notebook cell
51
63
  render_web("https://en.wikipedia.org/wiki/Python_(programming_language)", width="100%", height="500px")
52
-
64
+ ```
53
65
 
54
66
  ### 2. Rendering a YouTube Video
55
67
 
56
- python
57
- from linkincell import render_youtube
68
+ ```python
69
+ from LinkInCell.youtube import render_youtube
58
70
 
59
71
  # Pass the standard YouTube URL or the video ID
60
72
  render_youtube("https://www.youtube.com/watch?v=dQw4w9WgXcQ", width=800, height=450)
73
+ ```
61
74
 
62
75
 
63
76
  ## 🛠️ Requirements
64
77
 
65
- * Python 3.6+
78
+ * Python 3.8+
66
79
  * Jupyter Notebook or JupyterLab
67
80
  * `IPython` (Usually comes pre-installed with Jupyter)
68
81
 
@@ -10,7 +10,7 @@ classifiers =
10
10
  install_requires =
11
11
  ensure == 1.0.2
12
12
  py-youtube == 1.1.7
13
- pyhton_requires = >= 3.8
13
+ python_requires = >= 3.8
14
14
 
15
15
  [options.extras_require]
16
16
  testing =
@@ -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.4"
8
8
 
9
9
  REPO_NAME = "LinkInCell"
10
10
  AUTHOR_USER_NAME = "readwanur19"
@@ -18,7 +18,7 @@ setuptools.setup(
18
18
  author_email= AUTHOR_EMAIL,
19
19
  description= "A small python package",
20
20
  long_description= long_description,
21
- long_description_content = "text/markdown",
21
+ long_description_content_type = "text/markdown",
22
22
  url = f"https://github.com/{AUTHOR_USER_NAME}/{REPO_NAME}",
23
23
  project_urls = {
24
24
  "Bug Tracker": f"https://github.com/{AUTHOR_USER_NAME}/{REPO_NAME}/issues",
@@ -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.4
4
4
  Summary: A small python package
5
5
  Home-page: https://github.com/readwanur19/LinkInCell
6
6
  Author: readwanur19
@@ -10,6 +10,8 @@ Project-URL: Bug Tracker, https://github.com/readwanur19/LinkInCell/issues
10
10
  Classifier: Programming Language :: Python :: 3.8
11
11
  Classifier: Programming Language :: Python :: 3.9
12
12
  Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
13
15
  License-File: LICENSE
14
16
  Requires-Dist: ensure==1.0.2
15
17
  Requires-Dist: py-youtube==1.1.7
@@ -44,6 +46,18 @@ You can install `LinkInCell` directly from PyPI using pip:
44
46
  pip install LinkInCell
45
47
  ```
46
48
 
49
+ ```python
50
+ from LinkInCell.youtube import render_youtube
51
+
52
+ render_youtube("https://www.youtube.com/watch?v=h25pePMdoPA&t=712s")
53
+ ```
54
+
55
+ ```python
56
+ from LinkInCell.web import render_web
57
+
58
+ render_web("https://www.google.com/")
59
+ ```
60
+
47
61
  # How to install this package in your system
48
62
 
49
63
  ```bash
@@ -65,25 +79,26 @@ Using `LinkInCell` is incredibly simple. Import the package and pass your target
65
79
 
66
80
  ### 1. Rendering a Website
67
81
 
68
- python
69
- from linkincell import render_web
82
+ ```python
83
+ from LinkInCell.web import render_web
70
84
 
71
85
  # Render a full webpage inside your notebook cell
72
86
  render_web("https://en.wikipedia.org/wiki/Python_(programming_language)", width="100%", height="500px")
73
-
87
+ ```
74
88
 
75
89
  ### 2. Rendering a YouTube Video
76
90
 
77
- python
78
- from linkincell import render_youtube
91
+ ```python
92
+ from LinkInCell.youtube import render_youtube
79
93
 
80
94
  # Pass the standard YouTube URL or the video ID
81
95
  render_youtube("https://www.youtube.com/watch?v=dQw4w9WgXcQ", width=800, height=450)
96
+ ```
82
97
 
83
98
 
84
99
  ## 🛠️ Requirements
85
100
 
86
- * Python 3.6+
101
+ * Python 3.8+
87
102
  * Jupyter Notebook or JupyterLab
88
103
  * `IPython` (Usually comes pre-installed with Jupyter)
89
104
 
@@ -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