ipykernel-helper 0.0.12__tar.gz → 0.0.14__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.
- {ipykernel_helper-0.0.12/ipykernel_helper.egg-info → ipykernel_helper-0.0.14}/PKG-INFO +1 -1
- ipykernel_helper-0.0.14/ipykernel_helper/__init__.py +2 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper/core.py +10 -4
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14/ipykernel_helper.egg-info}/PKG-INFO +1 -1
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/settings.ini +1 -1
- ipykernel_helper-0.0.12/ipykernel_helper/__init__.py +0 -2
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/LICENSE +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/MANIFEST.in +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/README.md +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper/_modidx.py +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper.egg-info/SOURCES.txt +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper.egg-info/dependency_links.txt +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper.egg-info/entry_points.txt +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper.egg-info/not-zip-safe +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper.egg-info/requires.txt +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper.egg-info/top_level.txt +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/pyproject.toml +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/setup.cfg +0 -0
- {ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/setup.py +0 -0
|
@@ -15,6 +15,7 @@ from collections.abc import Mapping
|
|
|
15
15
|
from textwrap import dedent
|
|
16
16
|
from cloudscraper import create_scraper
|
|
17
17
|
from toolslm.funccall import *
|
|
18
|
+
from ast import literal_eval
|
|
18
19
|
|
|
19
20
|
import typing,warnings,re
|
|
20
21
|
|
|
@@ -102,10 +103,13 @@ def sig_help(self:InteractiveShell, code, line_no=None, col_no=None):
|
|
|
102
103
|
|
|
103
104
|
# %% ../nbs/00_core.ipynb
|
|
104
105
|
@patch
|
|
105
|
-
def get_vars(self:InteractiveShell, vs:list):
|
|
106
|
+
def get_vars(self:InteractiveShell, vs:list, literal=True):
|
|
106
107
|
"Get variables from namespace."
|
|
107
108
|
ns = self.user_ns
|
|
108
|
-
|
|
109
|
+
def _maybe_eval(o):
|
|
110
|
+
try: literal_eval(repr(o)); return o
|
|
111
|
+
except: return str(o)
|
|
112
|
+
return {v:_maybe_eval(ns[v]) if literal else str(ns[v]) for v in vs if v in ns}
|
|
109
113
|
|
|
110
114
|
# %% ../nbs/00_core.ipynb
|
|
111
115
|
def _get_schema(ns: dict, t):
|
|
@@ -166,7 +170,9 @@ def read_url(
|
|
|
166
170
|
from urllib.parse import urlparse
|
|
167
171
|
from bs4 import BeautifulSoup
|
|
168
172
|
|
|
169
|
-
|
|
173
|
+
o = scrape_url(url)
|
|
174
|
+
res, ctype = o.text, o.headers.get('content-type').split(';')[0]
|
|
175
|
+
|
|
170
176
|
soup = BeautifulSoup(res, "html.parser")
|
|
171
177
|
|
|
172
178
|
if selector:
|
|
@@ -187,7 +193,7 @@ def read_url(
|
|
|
187
193
|
current = current.next_sibling
|
|
188
194
|
res = ''.join(str(el) for el in elements)
|
|
189
195
|
else: res = ''
|
|
190
|
-
if as_md: return get_md(res)
|
|
196
|
+
if as_md and ctype == 'text/html': return get_md(res)
|
|
191
197
|
return res
|
|
192
198
|
|
|
193
199
|
# %% ../nbs/00_core.ipynb
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{ipykernel_helper-0.0.12 → ipykernel_helper-0.0.14}/ipykernel_helper.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|