bioguider 0.2.25__py3-none-any.whl → 0.2.26__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 bioguider might be problematic. Click here for more details.

bioguider/utils/utils.py CHANGED
@@ -53,10 +53,14 @@ def run_command(command: list, cwd: str = None, timeout: int = None):
53
53
  return e.stdout or "", e.stderr or f"Command timed out after {timeout} seconds", -1
54
54
 
55
55
  def escape_braces(text: str) -> str:
56
- # First replace single } not part of }} with }}
57
- text = re.sub(r'(?<!})}(?!})', '}}', text)
58
- # Then replace single { not part of {{
59
- text = re.sub(r'(?<!{){(?!{)', '{{', text)
56
+ def fix_braces(m):
57
+ s = m.group(0)
58
+ # If odd number of braces, double the last one
59
+ if len(s) % 2 == 1:
60
+ return s + s[-1]
61
+ return s
62
+ # Handle both { and } sequences
63
+ text = re.sub(r'{+|}+', fix_braces, text)
60
64
  return text
61
65
 
62
66
  def increase_token_usage(
@@ -105,7 +109,7 @@ def convert_to_serializable(obj):
105
109
  else:
106
110
  return obj
107
111
 
108
- def convert_html_to_text(html_path: str | Path, exclude_tags: list[str] | None = None) -> str:
112
+ def convert_html_to_text(html_path: str | Path, exclude_tags: list[str] = ["script", "style", "img", "svg", "meta", "link"]) -> str:
109
113
  """
110
114
  This function is used to convert html string to text, that is,
111
115
  extract text from html content, including tables.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bioguider
3
- Version: 0.2.25
3
+ Version: 0.2.26
4
4
  Summary: An AI-Powered package to help biomedical developers to generate clear documentation
5
5
  License: MIT
6
6
  Author: Cankun Wang
@@ -73,8 +73,8 @@ bioguider/utils/notebook_utils.py,sha256=SfU1iLuwgbDzNN-TUh_qbnfUSgn-PI6NrK6Qfmd
73
73
  bioguider/utils/pyphen_utils.py,sha256=cdZc3qphkvMDeL5NiZ8Xou13M_uVNP7ifJ-FwxO-0BE,2680
74
74
  bioguider/utils/python_file_handler.py,sha256=BERiE2RHxpu3gAzv26jr8ZQetkrtnMZOv9SjpQ7WIdg,2650
75
75
  bioguider/utils/r_file_handler.py,sha256=8HpFaYKP8N1nItwr9tOx49m99pcLSt8EUtTNTJ7xNoE,19564
76
- bioguider/utils/utils.py,sha256=_JOaAtLiQRq5Z1jb6Hb5KIbkYxCvX07qeRN21gKkt_o,4307
77
- bioguider-0.2.25.dist-info/LICENSE,sha256=qzkvZcKwwA5DuSuhXMOm2LcO6BdEr4V7jwFZVL2-jL4,1065
78
- bioguider-0.2.25.dist-info/METADATA,sha256=s54DzbxBT5IaNrWZyTwv63-8LV4iciTaK_wC8C34xAs,1962
79
- bioguider-0.2.25.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
80
- bioguider-0.2.25.dist-info/RECORD,,
76
+ bioguider/utils/utils.py,sha256=h8OhCjzLpHkb3ndnjRBUOBHD7csbHdEVNXf75SRN8Zc,4413
77
+ bioguider-0.2.26.dist-info/LICENSE,sha256=qzkvZcKwwA5DuSuhXMOm2LcO6BdEr4V7jwFZVL2-jL4,1065
78
+ bioguider-0.2.26.dist-info/METADATA,sha256=3wyoq1tcOVWAMH8Es4MfWGMYIHfIe8aWKU6rTYG9PD0,1962
79
+ bioguider-0.2.26.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
80
+ bioguider-0.2.26.dist-info/RECORD,,