Karim shoair commited on
Commit ·
6988daa
1
Parent(s): 7d01598
style: remove unused code
Browse files- scrapling/core/utils.py +0 -12
scrapling/core/utils.py
CHANGED
|
@@ -2,7 +2,6 @@ import logging
|
|
| 2 |
from itertools import chain
|
| 3 |
from re import compile as re_compile
|
| 4 |
|
| 5 |
-
from orjson import loads as orjson_loads, JSONDecodeError
|
| 6 |
from lxml import html
|
| 7 |
|
| 8 |
from scrapling.core._types import Any, Dict, Iterable, List
|
|
@@ -42,17 +41,6 @@ def setup_logger():
|
|
| 42 |
log = setup_logger()
|
| 43 |
|
| 44 |
|
| 45 |
-
def is_jsonable(content: bytes | str) -> bool:
|
| 46 |
-
if isinstance(content, bytes):
|
| 47 |
-
content = content.decode()
|
| 48 |
-
|
| 49 |
-
try:
|
| 50 |
-
_ = orjson_loads(content)
|
| 51 |
-
return True
|
| 52 |
-
except JSONDecodeError:
|
| 53 |
-
return False
|
| 54 |
-
|
| 55 |
-
|
| 56 |
def flatten(lst: Iterable[Any]) -> List[Any]:
|
| 57 |
return list(chain.from_iterable(lst))
|
| 58 |
|
|
|
|
| 2 |
from itertools import chain
|
| 3 |
from re import compile as re_compile
|
| 4 |
|
|
|
|
| 5 |
from lxml import html
|
| 6 |
|
| 7 |
from scrapling.core._types import Any, Dict, Iterable, List
|
|
|
|
| 41 |
log = setup_logger()
|
| 42 |
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
def flatten(lst: Iterable[Any]) -> List[Any]:
|
| 45 |
return list(chain.from_iterable(lst))
|
| 46 |
|