PgsFile 0.5.5__py3-none-any.whl → 0.5.6__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 CHANGED
@@ -3364,7 +3364,7 @@ def get_all_env_variables():
3364
3364
  return dict(env_vars)
3365
3365
 
3366
3366
  import subprocess
3367
- def set_permanent_environment_variable(variable_name, variable_value, system_wide=False):
3367
+ def set_permanent_env_var_win(variable_name, variable_value, system_wide=False):
3368
3368
  """
3369
3369
  Sets a permanent environment variable on Windows using the `setx` command.
3370
3370
 
@@ -3390,7 +3390,7 @@ def set_permanent_environment_variable(variable_name, variable_value, system_wid
3390
3390
  except Exception as e:
3391
3391
  print(f'An error occurred: {e}')
3392
3392
 
3393
- def delete_permanent_environment_variable(variable_name, system_wide=False):
3393
+ def delete_permanent_env_var_win(variable_name, system_wide=False):
3394
3394
  """
3395
3395
  Deletes a permanent environment variable on Windows using the `reg` command.
3396
3396
 
@@ -3421,6 +3421,53 @@ def delete_permanent_environment_variable(variable_name, system_wide=False):
3421
3421
  print(f'An error occurred: {e}')
3422
3422
 
3423
3423
 
3424
+ def set_permanent_env_var_mac(var_name: str, var_value: str, shell_config: str = "~/.zshrc") -> None:
3425
+ """
3426
+ Sets a permanent environment variable by appending it to the specified shell configuration file.
3427
+
3428
+ Args:
3429
+ var_name (str): Name of the environment variable.
3430
+ var_value (str): Value of the environment variable.
3431
+ shell_config (str): Path to the shell configuration file (e.g., "~/.zshrc", "~/.bashrc").
3432
+ Defaults to "~/.zshrc".
3433
+ """
3434
+ shell_config = os.path.expanduser(shell_config)
3435
+
3436
+ # Append the export line to the shell config file
3437
+ with open(shell_config, "a") as f:
3438
+ f.write(f'\nexport {var_name}="{var_value}"\n')
3439
+
3440
+ print(f'Added {var_name} to {shell_config}.')
3441
+ print(f'Restart your shell or run: source {shell_config}')
3442
+
3443
+
3444
+ def delete_permanent_env_var_mac(var_name: str, shell_config: str = "~/.zshrc") -> None:
3445
+ """
3446
+ Deletes a permanent environment variable from the specified shell configuration file.
3447
+
3448
+ Args:
3449
+ var_name (str): Name of the environment variable to delete.
3450
+ shell_config (str): Path to the shell configuration file (e.g., "~/.zshrc", "~/.bashrc").
3451
+ Defaults to "~/.zshrc".
3452
+ """
3453
+ shell_config = os.path.expanduser(shell_config)
3454
+
3455
+ # Read the file and remove the line containing the export statement
3456
+ with open(shell_config, "r") as f:
3457
+ lines = f.readlines()
3458
+
3459
+ # Use regex to find and remove the line
3460
+ pattern = re.compile(rf'^\s*export\s+{var_name}=.*$\n?', re.MULTILINE)
3461
+ new_lines = [line for line in lines if not pattern.match(line)]
3462
+
3463
+ # Write the updated content back to the file
3464
+ with open(shell_config, "w") as f:
3465
+ f.writelines(new_lines)
3466
+
3467
+ print(f'Removed {var_name} from {shell_config}.')
3468
+ print(f'Restart your shell or run: source {shell_config}')
3469
+
3470
+
3424
3471
  def calculate_mean_dependency_distance(spacy_doc):
3425
3472
  """
3426
3473
  Calculate the mean dependency distance for tokens in a spaCy Doc object.
PgsFile/__init__.py CHANGED
@@ -29,8 +29,8 @@ from .PgsFile import source_path, next_folder_names, get_directory_tree_with_met
29
29
  from .PgsFile import remove_empty_folders, remove_empty_txts, remove_empty_lines, remove_empty_last_line
30
30
  from .PgsFile import move_file, copy_file, remove_file
31
31
  from .PgsFile import concatenate_excel_files
32
- from .PgsFile import set_permanent_environment_variable
33
- from .PgsFile import delete_permanent_environment_variable
32
+ from .PgsFile import set_permanent_env_var_win, set_permanent_env_var_mac
33
+ from .PgsFile import delete_permanent_env_var_win, delete_permanent_env_var_mac
34
34
  from .PgsFile import get_env_variable, get_all_env_variables
35
35
  from .PgsFile import get_system_info
36
36
  from .PgsFile import csv_to_json_append
@@ -1,32 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PgsFile
3
- Version: 0.5.5
3
+ Version: 0.5.6
4
4
  Summary: This module streamlines Python package management, script execution, file handling, web scraping, and multimedia downloads. It supports LLM-based NLP tasks like OCR, tokenization, lemmatization, POS tagging, NER, ATE, dependency parsing, MDD, WSD, LIWC, MIP analysis, text classification, and Chinese-English sentence alignment. Additionally, it generates word lists and data visualizations, making it a practical tool for data scraping and analysis—ideal for literary students and researchers.
5
- Author-email: Pan Guisheng <panguisheng@sufe.edu.cn>
6
- License: License :: Free For Educational Use
7
-
8
- Copyright (c) 2021-present, GIIT, Shanghai International Studies University.
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Homepage, https://github.com/Petercusin/PgsFile
29
- Project-URL: Repository, https://github.com/Petercusin/PgsFile
5
+ Home-page: https://github.com/Petercusin/PgsFile
6
+ Author: Pan Guisheng
7
+ Author-email: panguisheng@sufe.edu.cn
8
+ License: Educational free
30
9
  Classifier: Programming Language :: Python :: 3
31
10
  Classifier: License :: Free For Educational Use
32
11
  Classifier: Operating System :: OS Independent
@@ -45,7 +24,17 @@ Requires-Dist: pysbd
45
24
  Requires-Dist: nlpir-python
46
25
  Requires-Dist: pillow
47
26
  Requires-Dist: liwc
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: license
48
34
  Dynamic: license-file
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
49
38
 
50
39
  Purpose: This module is designed to make complex tasks accessible and convenient, even for beginners. By providing a unified set of tools, it simplifies the workflow for data collection, processing, and analysis. Whether you're scraping data from the web, cleaning text, or performing LLM-based NLP tasks, this module ensures you can focus on your research without getting bogged down by technical challenges.
51
40
 
@@ -1,5 +1,5 @@
1
- PgsFile/PgsFile.py,sha256=8mIa_OHIT54liiLafv4Z69qMKa2gU2pQQNpWe5VAsoo,178679
2
- PgsFile/__init__.py,sha256=g37kKJxGqD61TQCWg6tDhUr27u-XRuMTIYNUjzRLPQ8,3801
1
+ PgsFile/PgsFile.py,sha256=OGbj8eYkXdAyWs2Or7TtHYrBgCiaeT1wwxcNUvLMUnA,180569
2
+ PgsFile/__init__.py,sha256=4AMmYVzDAr2Zy1r8WuN32lqgCxPaERTu5g6lnax4B9o,3840
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
5
5
  PgsFile/Corpora/Monolingual/Chinese/People's Daily 20130605/Raw/00000001.txt,sha256=imOa6UoCOIZoPXT4_HNHgCUJtd4FTIdk2FZNHNBgJyg,3372
@@ -2596,8 +2596,8 @@ PgsFile/models/prompts/6. ATE3 prompt.txt,sha256=VnaXpPa6BgZHUcm8PxmP_qgU-8xEoTB
2596
2596
  PgsFile/models/prompts/7. SentAlign prompt.txt,sha256=hXpqqC-CAgo8EytkJ0MaLhevLefALazWriY-ew39jxs,1537
2597
2597
  PgsFile/models/prompts/8. TitleCase prompt.txt,sha256=4p-LfGy0xAj2uPi9amyMm41T6Z17VNpFFsGZOgWhROs,1136
2598
2598
  PgsFile/models/prompts/9. TextClassification prompt.txt,sha256=JhQJu3rQSstNtkIkxPR1K-QmH9sGBEhbVKHAi7ItMUA,1066
2599
- pgsfile-0.5.5.dist-info/licenses/LICENSE,sha256=cE5c-QToSkG1KTUsU8drQXz1vG0EbJWuU4ybHTRb5SE,1138
2600
- pgsfile-0.5.5.dist-info/METADATA,sha256=PsHJZ2RATXCH_kd7HSoCzuPU8HGgjI_P4a2Z1viIyXA,4555
2601
- pgsfile-0.5.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2602
- pgsfile-0.5.5.dist-info/top_level.txt,sha256=028hCfwhF3UpfD6X0rwtWpXI1RKSTeZ1ALwagWaSmX8,8
2603
- pgsfile-0.5.5.dist-info/RECORD,,
2599
+ pgsfile-0.5.6.dist-info/licenses/LICENSE,sha256=cE5c-QToSkG1KTUsU8drQXz1vG0EbJWuU4ybHTRb5SE,1138
2600
+ pgsfile-0.5.6.dist-info/METADATA,sha256=mpdG5cKeYpf0jkEc0yKcRi-j_pLnL2s_52skr0SI2u0,3399
2601
+ pgsfile-0.5.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2602
+ pgsfile-0.5.6.dist-info/top_level.txt,sha256=028hCfwhF3UpfD6X0rwtWpXI1RKSTeZ1ALwagWaSmX8,8
2603
+ pgsfile-0.5.6.dist-info/RECORD,,