ipykernel-helper 0.0.9__py3-none-any.whl → 0.0.11__py3-none-any.whl
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.
Potentially problematic release.
This version of ipykernel-helper might be problematic. Click here for more details.
- ipykernel_helper/__init__.py +1 -1
- ipykernel_helper/core.py +14 -3
- {ipykernel_helper-0.0.9.dist-info → ipykernel_helper-0.0.11.dist-info}/METADATA +3 -1
- ipykernel_helper-0.0.11.dist-info/RECORD +9 -0
- ipykernel_helper-0.0.9.dist-info/RECORD +0 -9
- {ipykernel_helper-0.0.9.dist-info → ipykernel_helper-0.0.11.dist-info}/WHEEL +0 -0
- {ipykernel_helper-0.0.9.dist-info → ipykernel_helper-0.0.11.dist-info}/entry_points.txt +0 -0
- {ipykernel_helper-0.0.9.dist-info → ipykernel_helper-0.0.11.dist-info}/licenses/LICENSE +0 -0
- {ipykernel_helper-0.0.9.dist-info → ipykernel_helper-0.0.11.dist-info}/top_level.txt +0 -0
ipykernel_helper/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.11"
|
|
2
2
|
from .core import *
|
ipykernel_helper/core.py
CHANGED
|
@@ -164,15 +164,26 @@ def read_url(
|
|
|
164
164
|
from bs4 import BeautifulSoup
|
|
165
165
|
|
|
166
166
|
res = httpx.get(url, follow_redirects=True).raise_for_status().text
|
|
167
|
+
soup = BeautifulSoup(res, "html.parser")
|
|
168
|
+
|
|
167
169
|
if selector:
|
|
168
|
-
sections =
|
|
170
|
+
sections = soup.select(selector)
|
|
169
171
|
if sections: res = '\n\n'.join(str(section) for section in sections)
|
|
170
172
|
else: res = ''
|
|
171
173
|
elif extract_section:
|
|
172
174
|
parsed = urlparse(url)
|
|
173
175
|
if parsed.fragment:
|
|
174
|
-
section =
|
|
175
|
-
if section:
|
|
176
|
+
section = soup.find(id=parsed.fragment)
|
|
177
|
+
if section:
|
|
178
|
+
tag_name = section.name
|
|
179
|
+
elements = [section]
|
|
180
|
+
current = section.next_sibling
|
|
181
|
+
while current:
|
|
182
|
+
if hasattr(current, 'name') and current.name == tag_name: break
|
|
183
|
+
elements.append(current)
|
|
184
|
+
current = current.next_sibling
|
|
185
|
+
res = ''.join(str(el) for el in elements)
|
|
186
|
+
else: res = ''
|
|
176
187
|
if as_md: return get_md(res)
|
|
177
188
|
return res
|
|
178
189
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ipykernel-helper
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
4
4
|
Summary: Helpers for ipykernel and friends
|
|
5
5
|
Home-page: https://github.com/AnswerDotAI/ipykernel-helper
|
|
6
6
|
Author: Jeremy Howard
|
|
@@ -23,6 +23,8 @@ Requires-Dist: toolslm>=0.2.0
|
|
|
23
23
|
Requires-Dist: jedi
|
|
24
24
|
Requires-Dist: ipython
|
|
25
25
|
Requires-Dist: ipykernel
|
|
26
|
+
Requires-Dist: beautifulsoup4
|
|
27
|
+
Requires-Dist: html2text
|
|
26
28
|
Provides-Extra: dev
|
|
27
29
|
Dynamic: author
|
|
28
30
|
Dynamic: author-email
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
ipykernel_helper/__init__.py,sha256=pot8RlG0U4OhR3W-uFE3FF_SkXBM1i-NXq4JI4v6zdU,43
|
|
2
|
+
ipykernel_helper/_modidx.py,sha256=INE9z1o4nb_NMRepxbiF5fBE5Il5BeKJZFTLmdxUGLw,3577
|
|
3
|
+
ipykernel_helper/core.py,sha256=bj1WbWiEhE7ilTnI5gQB-hirT4jEBRI_cyPfQGWGpPM,8073
|
|
4
|
+
ipykernel_helper-0.0.11.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
5
|
+
ipykernel_helper-0.0.11.dist-info/METADATA,sha256=wb-C6qaKm7IeXrz04-GiRjbHCkt1ZTR6XiueGbzz7es,2681
|
|
6
|
+
ipykernel_helper-0.0.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
ipykernel_helper-0.0.11.dist-info/entry_points.txt,sha256=HWiK9xz75QtZUaPaYrwpyH5B8MbW0Ea_vi11UmwBImM,54
|
|
8
|
+
ipykernel_helper-0.0.11.dist-info/top_level.txt,sha256=_diD--64d9MauLE0pTxzZ58lkI8DvCrVc1hVAJsyc_Q,17
|
|
9
|
+
ipykernel_helper-0.0.11.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
ipykernel_helper/__init__.py,sha256=8v08jLbD8mgo8kbkFtp9fIlkDQsiovYgy2xWvMrgXWY,42
|
|
2
|
-
ipykernel_helper/_modidx.py,sha256=INE9z1o4nb_NMRepxbiF5fBE5Il5BeKJZFTLmdxUGLw,3577
|
|
3
|
-
ipykernel_helper/core.py,sha256=hf7ml7uXFjzllCvwuiRVfu8NQlq9AQ3Xdfd3trkY0sk,7650
|
|
4
|
-
ipykernel_helper-0.0.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
5
|
-
ipykernel_helper-0.0.9.dist-info/METADATA,sha256=u2k58GJKbgSlpUYLSSGM_b5JCWnxkAAse7e91pAKVSs,2625
|
|
6
|
-
ipykernel_helper-0.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
ipykernel_helper-0.0.9.dist-info/entry_points.txt,sha256=HWiK9xz75QtZUaPaYrwpyH5B8MbW0Ea_vi11UmwBImM,54
|
|
8
|
-
ipykernel_helper-0.0.9.dist-info/top_level.txt,sha256=_diD--64d9MauLE0pTxzZ58lkI8DvCrVc1hVAJsyc_Q,17
|
|
9
|
-
ipykernel_helper-0.0.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|