scrapling 0.2.95__py3-none-any.whl → 0.2.96__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.
scrapling/__init__.py CHANGED
@@ -5,7 +5,7 @@ from scrapling.fetchers import (AsyncFetcher, CustomFetcher, Fetcher,
5
5
  from scrapling.parser import Adaptor, Adaptors
6
6
 
7
7
  __author__ = "Karim Shoair (karim.shoair@pm.me)"
8
- __version__ = "0.2.95"
8
+ __version__ = "0.2.96"
9
9
  __copyright__ = "Copyright (c) 2024 Karim Shoair"
10
10
 
11
11
 
scrapling/cli.py CHANGED
@@ -12,13 +12,14 @@ def get_package_dir():
12
12
 
13
13
  def run_command(command, line):
14
14
  print(f"Installing {line}...")
15
- _ = subprocess.check_call(command, shell=True)
15
+ _ = subprocess.check_call(' '.join(command), shell=True)
16
16
  # I meant to not use try except here
17
17
 
18
18
 
19
19
  @click.command(help="Install all Scrapling's Fetchers dependencies")
20
- def install():
21
- if not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
20
+ @click.option('-f', '--force', 'force', is_flag=True, default=False, type=bool, help="Force Scrapling to reinstall all Fetchers dependencies")
21
+ def install(force):
22
+ if force or not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
22
23
  run_command([sys.executable, "-m", "playwright", "install", 'chromium'], 'Playwright browsers')
23
24
  run_command([sys.executable, "-m", "playwright", "install-deps", 'chromium', 'firefox'], 'Playwright dependencies')
24
25
  run_command([sys.executable, "-m", "camoufox", "fetch", '--browserforge'], 'Camoufox browser and databases')
@@ -23,19 +23,8 @@ class TextHandler(str):
23
23
  return super().__new__(cls, string)
24
24
  return super().__new__(cls, '')
25
25
 
26
- @typing.overload
27
- def __getitem__(self, key: SupportsIndex) -> 'TextHandler':
28
- pass
29
-
30
- @typing.overload
31
- def __getitem__(self, key: slice) -> "TextHandlers":
32
- pass
33
-
34
- def __getitem__(self, key: Union[SupportsIndex, slice]) -> Union["TextHandler", "TextHandlers"]:
26
+ def __getitem__(self, key: Union[SupportsIndex, slice]) -> "TextHandler":
35
27
  lst = super().__getitem__(key)
36
- if isinstance(key, slice):
37
- lst = [TextHandler(s) for s in lst]
38
- return TextHandlers(typing.cast(List[_TextHandlerType], lst))
39
28
  return typing.cast(_TextHandlerType, TextHandler(lst))
40
29
 
41
30
  def split(self, sep: str = None, maxsplit: SupportsIndex = -1) -> 'TextHandlers':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: scrapling
3
- Version: 0.2.95
3
+ Version: 0.2.96
4
4
  Summary: Scrapling is an undetectable, powerful, flexible, high-performance Python library that makes Web Scraping easy again! In an internet filled with complications,
5
5
  Home-page: https://github.com/D4Vinci/Scrapling
6
6
  Author: Karim Shoair
@@ -53,7 +53,7 @@ Dynamic: requires-dist
53
53
  Dynamic: requires-python
54
54
  Dynamic: summary
55
55
 
56
- # 🕷️ Scrapling: Undetectable, Lightning-Fast, and Adaptive Web Scraping for Python
56
+ # 🕷️ Scrapling: Undetectable, Lightning-Fast, and Easy Web Scraping with Python
57
57
  [![Tests](https://github.com/D4Vinci/Scrapling/actions/workflows/tests.yml/badge.svg)](https://github.com/D4Vinci/Scrapling/actions/workflows/tests.yml) [![PyPI version](https://badge.fury.io/py/Scrapling.svg)](https://badge.fury.io/py/Scrapling) [![Supported Python versions](https://img.shields.io/pypi/pyversions/scrapling.svg)](https://pypi.org/project/scrapling/) [![PyPI Downloads](https://static.pepy.tech/badge/scrapling)](https://pepy.tech/project/scrapling)
58
58
 
59
59
  Dealing with failing web scrapers due to anti-bot protections or website changes? Meet Scrapling.
@@ -1,12 +1,12 @@
1
- scrapling/__init__.py,sha256=7gthgq0LYOWqlly_w1GnesFh1WzPmkXwXJyjXB3JvVY,500
2
- scrapling/cli.py,sha256=njPdJKmbLFHeWjtSiGEm9ALBdSyfUp0IaJvxQL5C31Q,1125
1
+ scrapling/__init__.py,sha256=5r6_yxrfXbeoh8UqUaCdmmbWH9TQxBivP9cLWUXPI5g,500
2
+ scrapling/cli.py,sha256=7yTsMhVAqqS8Z27T5dFKrR9_X8vuFjBlwYgAF22W7T8,1292
3
3
  scrapling/defaults.py,sha256=sdXeZjXEX7PmCtaa0weK0nRrAUzqZukNNqipZ_sltYE,469
4
4
  scrapling/fetchers.py,sha256=qmiJ6S-bnPWvP48Z6rKxBnSuR-tdwHlJwlIsYxGxFM0,35405
5
5
  scrapling/parser.py,sha256=b_1eHxRwHRCidyvm3F6ST6qIYvVEVU6GhTTCI1LblVk,54330
6
6
  scrapling/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
7
7
  scrapling/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  scrapling/core/_types.py,sha256=dKVi_dUxdxNtTr7sj7ySkHXDfrsmjFTfpCQeO5tGuBY,670
9
- scrapling/core/custom_types.py,sha256=X5fNOS3E7BDkvoUxrRZpEoPlzbLMlibGhZVGbHb2E74,13393
9
+ scrapling/core/custom_types.py,sha256=tejeLYmWa_aLaLtMSymG4z7h6rxO-9EvmiRWEWcW54s,13022
10
10
  scrapling/core/mixins.py,sha256=sozbpaGL1_O_x3U-ABM5aYWpnxpCLfdbcA9SG3P7weY,3532
11
11
  scrapling/core/storage_adaptors.py,sha256=l_ZYcdn1y69AcoPuRrPoaxqKysN62pMExrwJWYdu5MA,6220
12
12
  scrapling/core/translator.py,sha256=hFSc3mxG5pYhbwRgingeFbD_E73U799vCsvVv0uFEXw,5237
@@ -41,9 +41,9 @@ tests/fetchers/sync/test_playwright.py,sha256=MEyDRaMyxDIWupG7f_xz0f0jd9Cpbd5rXC
41
41
  tests/parser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  tests/parser/test_automatch.py,sha256=SxsNdExE8zz8AcPRQFBUjZ3Q_1-tPOd9dzVvMSZpOYQ,4908
43
43
  tests/parser/test_general.py,sha256=dyfOsc8lleoY4AxcfDUBUaD1i95xecfYuTUhKBsYjwo,12100
44
- scrapling-0.2.95.dist-info/LICENSE,sha256=XHgu8DRuT7_g3Hb9Q18YGg8eShp6axPBacbnQxT_WWQ,1499
45
- scrapling-0.2.95.dist-info/METADATA,sha256=PTTxxxijblkcumiCbowId3Xy5I64lF9DvH3nAMPhEHQ,69066
46
- scrapling-0.2.95.dist-info/WHEEL,sha256=nn6H5-ilmfVryoAQl3ZQ2l8SH5imPWFpm1A5FgEuFV4,91
47
- scrapling-0.2.95.dist-info/entry_points.txt,sha256=DHyt2Blxy0P5OE2HRcP95Wz9_xo2ERCDcNqrJjYS3o8,49
48
- scrapling-0.2.95.dist-info/top_level.txt,sha256=ub7FkOEXeYmmYTUxd4pCrwXfBfAMIpZ1sCGmXCc14tI,16
49
- scrapling-0.2.95.dist-info/RECORD,,
44
+ scrapling-0.2.96.dist-info/LICENSE,sha256=XHgu8DRuT7_g3Hb9Q18YGg8eShp6axPBacbnQxT_WWQ,1499
45
+ scrapling-0.2.96.dist-info/METADATA,sha256=yNRmjMR5qmJyH_6ob-6nwLuqD6iXIegMI-d-xQ95ZpA,69063
46
+ scrapling-0.2.96.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
47
+ scrapling-0.2.96.dist-info/entry_points.txt,sha256=DHyt2Blxy0P5OE2HRcP95Wz9_xo2ERCDcNqrJjYS3o8,49
48
+ scrapling-0.2.96.dist-info/top_level.txt,sha256=ub7FkOEXeYmmYTUxd4pCrwXfBfAMIpZ1sCGmXCc14tI,16
49
+ scrapling-0.2.96.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.1)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5