SinaTools 0.1.24__py2.py3-none-any.whl → 0.1.25__py2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SinaTools
3
- Version: 0.1.24
3
+ Version: 0.1.25
4
4
  Summary: Open-source Python toolkit for Arabic Natural Understanding, allowing people to integrate it in their system workflow.
5
5
  Home-page: https://github.com/SinaLab/sinatools
6
6
  License: MIT license
@@ -1,5 +1,5 @@
1
- SinaTools-0.1.24.data/data/sinatools/environment.yml,sha256=OzilhLjZbo_3nU93EQNUFX-6G5O3newiSWrwxvMH2Os,7231
2
- sinatools/VERSION,sha256=S6iCAVLWhyRA7MIGZk5mjvtI6v6w1_bWDqhs5ui2fDk,6
1
+ SinaTools-0.1.25.data/data/sinatools/environment.yml,sha256=OzilhLjZbo_3nU93EQNUFX-6G5O3newiSWrwxvMH2Os,7231
2
+ sinatools/VERSION,sha256=ZC9GuKFeLfVc4onMU4koq0Nk_oc7Tx3zDdE0H4bcUKU,6
3
3
  sinatools/__init__.py,sha256=bEosTU1o-FSpyytS6iVP_82BXHF2yHnzpJxPLYRbeII,135
4
4
  sinatools/environment.yml,sha256=OzilhLjZbo_3nU93EQNUFX-6G5O3newiSWrwxvMH2Os,7231
5
5
  sinatools/install_env.py,sha256=EODeeE0ZzfM_rz33_JSIruX03Nc4ghyVOM5BHVhsZaQ,404
@@ -20,7 +20,7 @@ sinatools/CLI/utils/sentence_tokenizer.py,sha256=Wli8eiDbWSd_Z8UKpu_JkaS8jImowa1
20
20
  sinatools/CLI/utils/text_dublication_detector.py,sha256=dW70O5O20GxeUDDF6zVYn52wWLmJF-HBZgvqIeVL2rQ,1661
21
21
  sinatools/CLI/utils/text_transliteration.py,sha256=vz-3kxWf8pNYVCqNAtBAiA6u_efrS5NtWT-ofN1NX6I,2014
22
22
  sinatools/DataDownload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- sinatools/DataDownload/downloader.py,sha256=sLmVvnr3mG_tqvGCggzxwsi2sixlKlgCbMnZhCclSpg,6390
23
+ sinatools/DataDownload/downloader.py,sha256=F-SV-0mbYMYFSNCx8FoAYXhn0X1j0dF37PTLU0nUBVg,6482
24
24
  sinatools/arabert/__init__.py,sha256=ely2PttjgSv7vKdzskuD1rtK_l_UOpmxJSz8isrveD0,16
25
25
  sinatools/arabert/preprocess.py,sha256=qI0FsuMTOzdRlYGCtLrjpXgikNElUZPv9bnjaKDZKJ4,33024
26
26
  sinatools/arabert/arabert/__init__.py,sha256=KbSAH-XqbRygn0y59m5-ZYOLXgpT1gSgE3F-qd4rKEc,627
@@ -113,10 +113,10 @@ sinatools/wsd/__init__.py,sha256=yV-SQSCzSrjbNkciMbDCqzGZ_EESchL7rlJk56uibVI,309
113
113
  sinatools/wsd/disambiguator.py,sha256=8HrVAGpEQyrzwiuEreLX9X82WSL-U2Aeca0ttrtIw2Y,19998
114
114
  sinatools/wsd/settings.py,sha256=6XflVTFKD8SVySX9Wj7zYQtV26WDTcQ2-uW8-gDNHKE,747
115
115
  sinatools/wsd/wsd.py,sha256=gHIBUFXegoY1z3rRnIlK6TduhYq2BTa_dHakOjOlT4k,4434
116
- SinaTools-0.1.24.dist-info/AUTHORS.rst,sha256=aTWeWlIdfLi56iLJfIUAwIrmqDcgxXKLji75_Fjzjyg,174
117
- SinaTools-0.1.24.dist-info/LICENSE,sha256=uwsKYG4TayHXNANWdpfMN2lVW4dimxQjA_7vuCVhD70,1088
118
- SinaTools-0.1.24.dist-info/METADATA,sha256=TS_IfzeMqZsoClo4KPnnhsTHbuo8sWNBXB2ByHkrY_M,953
119
- SinaTools-0.1.24.dist-info/WHEEL,sha256=6T3TYZE4YFi2HTS1BeZHNXAi8N52OZT4O-dJ6-ome_4,116
120
- SinaTools-0.1.24.dist-info/entry_points.txt,sha256=ZwZLolnWog2fjdDrfaHNHob8SE_YtMbD6ayzsOzItxs,1234
121
- SinaTools-0.1.24.dist-info/top_level.txt,sha256=8tNdPTeJKw3TQCaua8IJIx6N6WpgZZmVekf1OdBNJpE,10
122
- SinaTools-0.1.24.dist-info/RECORD,,
116
+ SinaTools-0.1.25.dist-info/AUTHORS.rst,sha256=aTWeWlIdfLi56iLJfIUAwIrmqDcgxXKLji75_Fjzjyg,174
117
+ SinaTools-0.1.25.dist-info/LICENSE,sha256=uwsKYG4TayHXNANWdpfMN2lVW4dimxQjA_7vuCVhD70,1088
118
+ SinaTools-0.1.25.dist-info/METADATA,sha256=0tDl5B000Z0gvhNCSzdlOzfyC0YQrP2uSZSm4OEP_EQ,953
119
+ SinaTools-0.1.25.dist-info/WHEEL,sha256=6T3TYZE4YFi2HTS1BeZHNXAi8N52OZT4O-dJ6-ome_4,116
120
+ SinaTools-0.1.25.dist-info/entry_points.txt,sha256=ZwZLolnWog2fjdDrfaHNHob8SE_YtMbD6ayzsOzItxs,1234
121
+ SinaTools-0.1.25.dist-info/top_level.txt,sha256=8tNdPTeJKw3TQCaua8IJIx6N6WpgZZmVekf1OdBNJpE,10
122
+ SinaTools-0.1.25.dist-info/RECORD,,
@@ -95,37 +95,41 @@ def download_file(url, dest_path=get_appdatadir()):
95
95
  print(filename)
96
96
  headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'}
97
97
 
98
- # try:
99
- with requests.get(url, headers=headers, stream=True) as r:
100
- r.raise_for_status()
101
- with open(file_path, 'wb') as f:
102
- total_size = int(r.headers.get('content-length', 0))
103
- block_size = 8192
104
- progress_bar = tqdm(total=total_size, unit='iB', unit_scale=True)
105
- for chunk in r.iter_content(chunk_size=block_size):
106
- if chunk:
107
- f.write(chunk)
108
- progress_bar.update(len(chunk))
109
- progress_bar.close()
110
- # Check the file type and extract accordingly
111
- file_extension = os.path.splitext(file_path)[1]
112
- extracted_folder_name = os.path.splitext(file_path)[0]
113
-
114
- if file_extension == '.zip':
115
- extract_zip(file_path, extracted_folder_name)
116
- elif file_extension == '.gz':
117
- extract_tar(file_path, extracted_folder_name)
118
- elif file_extension =='.pickle':
119
- print(f'Done: {file_extension}')
120
- else:
121
- print(f'Unsupported file type for extraction: {file_extension}')
122
- return file_path
123
-
124
- # except requests.exceptions.HTTPError as e:
125
- # if e.response.status_code == 403:
126
- # print(f'Error 403: Forbidden. The requested file URL {url} could not be downloaded due to insufficient permissions. Please check the URL and try again.')
127
- # else:
128
- # print('An error occurred while downloading the file:', e)
98
+ try:
99
+ with requests.get(url, headers=headers, stream=True) as r:
100
+ r.raise_for_status()
101
+ with open(file_path, 'wb') as f:
102
+ total_size = int(r.headers.get('content-length', 0))
103
+ block_size = 8192
104
+ progress_bar = tqdm(total=total_size, unit='iB', unit_scale=True)
105
+ for chunk in r.iter_content(chunk_size=block_size):
106
+ if chunk:
107
+ f.write(chunk)
108
+ progress_bar.update(len(chunk))
109
+ progress_bar.close()
110
+
111
+ # Check the file type and extract accordingly
112
+ file_extension = os.path.splitext(file_path)[1]
113
+ extracted_folder_name = os.path.splitext(file_path)[0]
114
+
115
+ if file_extension == '.zip':
116
+ extract_zip(file_path, extracted_folder_name)
117
+ elif file_extension == '.gz':
118
+
119
+ extract_tar(file_path, extracted_folder_name)
120
+ elif file_extension =='.pickle':
121
+ print(f'Done: {file_extension}')
122
+
123
+ else:
124
+ print(f'Unsupported file type for extraction: {file_extension}')
125
+
126
+ return file_path
127
+
128
+ except requests.exceptions.HTTPError as e:
129
+ if e.response.status_code == 403:
130
+ print(f'Error 403: Forbidden. The requested file URL {url} could not be downloaded due to insufficient permissions. Please check the URL and try again.')
131
+ else:
132
+ print('An error occurred while downloading the file:', e)
129
133
 
130
134
  def extract_zip(file_path, extracted_folder_name):
131
135
  """
sinatools/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.24
1
+ 0.1.25