PgsFile 0.3.3__py3-none-any.whl → 0.3.4__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 PgsFile might be problematic. Click here for more details.
- PgsFile/PgsFile.py +10 -4
- {PgsFile-0.3.3.dist-info → PgsFile-0.3.4.dist-info}/METADATA +2 -2
- {PgsFile-0.3.3.dist-info → PgsFile-0.3.4.dist-info}/RECORD +6 -6
- {PgsFile-0.3.3.dist-info → PgsFile-0.3.4.dist-info}/LICENSE +0 -0
- {PgsFile-0.3.3.dist-info → PgsFile-0.3.4.dist-info}/WHEEL +0 -0
- {PgsFile-0.3.3.dist-info → PgsFile-0.3.4.dist-info}/top_level.txt +0 -0
PgsFile/PgsFile.py
CHANGED
|
@@ -2101,11 +2101,11 @@ def mhtml2html(input_file_path, output_file_path=None):
|
|
|
2101
2101
|
|
|
2102
2102
|
def get_data_html_offline(file_path):
|
|
2103
2103
|
"""
|
|
2104
|
-
Reads a local HTML file and extracts specific elements.
|
|
2104
|
+
Reads a local HTML/XML file and extracts specific elements.
|
|
2105
2105
|
Parameters:
|
|
2106
2106
|
file_path (str): The path to the local HTML file. my_html="Top 5 Web Scraping Methods_ Including Using LLMs - Comet.mhtml"
|
|
2107
2107
|
|
|
2108
|
-
Returns: html
|
|
2108
|
+
Returns: html/xml
|
|
2109
2109
|
|
|
2110
2110
|
XPath common usages:
|
|
2111
2111
|
rst = html.xpath('//div[@class="image-caption"]/text()') # Get the text content of the specified tag
|
|
@@ -2131,9 +2131,15 @@ def get_data_html_offline(file_path):
|
|
|
2131
2131
|
html_content = possible_html
|
|
2132
2132
|
# Parse the HTML content
|
|
2133
2133
|
html = etree.HTML(html_content)
|
|
2134
|
-
|
|
2134
|
+
return html
|
|
2135
|
+
elif file_path.endswith(".html"): #.html
|
|
2135
2136
|
html=etree.parse(file_path,etree.HTMLParser())
|
|
2136
|
-
|
|
2137
|
+
return html
|
|
2138
|
+
elif file_path.endswith(".xml"):
|
|
2139
|
+
xml=etree.parse(file_path, etree.XMLParser())
|
|
2140
|
+
return xml
|
|
2141
|
+
else:
|
|
2142
|
+
print("Only supports mhtml, html, and xml file format!")
|
|
2137
2143
|
|
|
2138
2144
|
def get_data_html_online(url, html=True, timeout=None, headers=None, cookies=None, params=None, proxies=None):
|
|
2139
2145
|
'''
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PgsFile
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: This module simplifies Python package management, script execution, file handling, web scraping, and multimedia downloads. The module supports LLM-based NLP tasks such as tokenization, lemmatization, POS tagging, NER, dependency parsing, MDD, WSD, and MIP analysis. It also generates word lists and plots data, aiding literary students. Ideal for scraping data, cleaning text, and analyzing language, it offers user-friendly tools to streamline workflows.
|
|
5
5
|
Home-page: https://mp.weixin.qq.com/s/12-KVLfaPszoZkCxuRd-nQ?token=1589547443&lang=zh_CN
|
|
6
6
|
Author: Pan Guisheng
|
|
@@ -29,7 +29,7 @@ Purpose: This module is designed to make complex tasks accessible and convenient
|
|
|
29
29
|
Key Features:
|
|
30
30
|
1. **Web Scraping:** Easily scrape data from websites and download multimedia content.
|
|
31
31
|
2. **Package Management:** Install, uninstall, and manage Python packages with simple commands.
|
|
32
|
-
3. **Data Retrieval:** Extract data from various file formats like text, JSON, TSV, Excel, and HTML (both online and offline).
|
|
32
|
+
3. **Data Retrieval:** Extract data from various file formats like text, JSON, TSV, Excel, XML, and HTML (both online and offline).
|
|
33
33
|
4. **Data Storage:** Write and append data to text files, Excel, JSON, and JSON lines.
|
|
34
34
|
5. **File and Folder Processing:** Manage file paths, create directories, move or copy files, and search for files with specific keywords.
|
|
35
35
|
6. **Data Cleaning:** Clean text, handle punctuation, remove stopwords, and prepare data for analysis, utilizing valuable corpora and dictionaries such as CET-4/6 vocabulary and BNC-COCA word lists.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
PgsFile/PgsFile.py,sha256=
|
|
1
|
+
PgsFile/PgsFile.py,sha256=mq3cwVaEjd9XA5XrG0GlG-kCxqcKUr2fafxmNGTl1fk,119019
|
|
2
2
|
PgsFile/__init__.py,sha256=SBlK-h4BPeSIbG7W9fpTROctl4PVmiPs0PVC-OkLq4A,3343
|
|
3
3
|
PgsFile/Corpora/Idioms/English_Idioms_8774.txt,sha256=qlsP0yI_XGECBRiPZuLkGZpdasc77sWSKexANu7v8_M,175905
|
|
4
4
|
PgsFile/Corpora/Monolingual/Chinese/People's Daily 20130605/Raw/00000000.txt,sha256=SLGGSMSb7Ff1RoBstsTW3yX2wNZpqEUchFNpcI-mrR4,1513
|
|
@@ -2613,8 +2613,8 @@ PgsFile/models/fonts/博洋行书3500.TTF,sha256=VrgeHr8cgOL6JD05QyuD9ZSyw4J2aIV
|
|
|
2613
2613
|
PgsFile/models/fonts/陆柬之行书字体.ttf,sha256=Zpd4Z7E9w-Qy74yklXHk4vM7HOtHuQgllvygxZZ1Hvs,1247288
|
|
2614
2614
|
PgsFile/models/prompts/1. MIP prompt.txt,sha256=4lHlHmleayRytqr1n9jtt6vn1rQvyf4BKeThpbwI8o8,1638
|
|
2615
2615
|
PgsFile/models/prompts/2. WSD prompt.txt,sha256=o-ZFtCRUCDrXgm040WTQch9v2Y_r2SIlrZaquilJjgQ,2348
|
|
2616
|
-
PgsFile-0.3.
|
|
2617
|
-
PgsFile-0.3.
|
|
2618
|
-
PgsFile-0.3.
|
|
2619
|
-
PgsFile-0.3.
|
|
2620
|
-
PgsFile-0.3.
|
|
2616
|
+
PgsFile-0.3.4.dist-info/LICENSE,sha256=cE5c-QToSkG1KTUsU8drQXz1vG0EbJWuU4ybHTRb5SE,1138
|
|
2617
|
+
PgsFile-0.3.4.dist-info/METADATA,sha256=OdAYFUyZZOO2M1VYayJKPlmuLrpmd-o-ec_vrULlUEw,2892
|
|
2618
|
+
PgsFile-0.3.4.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
|
2619
|
+
PgsFile-0.3.4.dist-info/top_level.txt,sha256=028hCfwhF3UpfD6X0rwtWpXI1RKSTeZ1ALwagWaSmX8,8
|
|
2620
|
+
PgsFile-0.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|