plexflow 0.0.136__py3-none-any.whl → 0.0.138__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.
- plexflow/utils/strings/sanitize.py +11 -5
- plexflow/utils/tasks/decorators.py +1 -1
- {plexflow-0.0.136.dist-info → plexflow-0.0.138.dist-info}/METADATA +1 -1
- {plexflow-0.0.136.dist-info → plexflow-0.0.138.dist-info}/RECORD +6 -6
- {plexflow-0.0.136.dist-info → plexflow-0.0.138.dist-info}/WHEEL +0 -0
- {plexflow-0.0.136.dist-info → plexflow-0.0.138.dist-info}/entry_points.txt +0 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
import string
|
2
|
+
import re
|
2
3
|
|
3
4
|
def remove_punctuation(text):
|
4
5
|
"""Removes all punctuation from a given string."""
|
@@ -8,27 +9,32 @@ def remove_punctuation(text):
|
|
8
9
|
translator = str.maketrans('', '', string.punctuation)
|
9
10
|
return text.translate(translator)
|
10
11
|
|
11
|
-
def clean_string(input_string, remove_spaces: bool = False):
|
12
|
+
def clean_string(input_string, remove_spaces: bool = False, remove_years: bool = False):
|
12
13
|
"""
|
13
|
-
Strips all punctuation and
|
14
|
+
Strips all punctuation, spaces, and optionally years from a string and converts it to lowercase.
|
14
15
|
|
15
16
|
Args:
|
16
17
|
input_string (str): The string to clean.
|
18
|
+
remove_spaces (bool): If True, all spaces are removed. Defaults to False.
|
19
|
+
remove_years (bool): If True, all 4-digit numbers are removed. Defaults to False.
|
17
20
|
|
18
21
|
Returns:
|
19
22
|
str: The cleaned string.
|
20
23
|
"""
|
21
24
|
# Create a translation table to remove punctuation
|
22
|
-
# string.punctuation contains all standard punctuation characters
|
23
25
|
translator = str.maketrans('', '', string.punctuation)
|
24
26
|
|
25
27
|
# Remove punctuation using the translation table
|
26
28
|
no_punctuation = input_string.translate(translator)
|
27
29
|
|
28
|
-
# Remove all
|
30
|
+
# Remove all 4-digit numbers if requested
|
31
|
+
if remove_years:
|
32
|
+
no_punctuation = re.sub(r'\b\d{4}\b', '', no_punctuation)
|
33
|
+
|
34
|
+
# Remove all spaces if requested
|
29
35
|
no_spaces = no_punctuation.replace(" ", "") if remove_spaces else no_punctuation
|
30
36
|
|
31
37
|
# Convert to lowercase
|
32
38
|
cleaned_string = no_spaces.lower()
|
33
39
|
|
34
|
-
return cleaned_string
|
40
|
+
return cleaned_string.strip()
|
@@ -7,7 +7,7 @@ import json
|
|
7
7
|
def plexflow(task_func):
|
8
8
|
def wrapper(*args, **kwargs):
|
9
9
|
task_mode = os.getenv("TASK_MODE", "default")
|
10
|
-
default_ttl = 3600
|
10
|
+
default_ttl = int(os.getenv("DEFAULT_CONTEXT_TTL", 3600 * 24 * 7 * 2)) # 2 weeks
|
11
11
|
|
12
12
|
if task_mode == "k8s":
|
13
13
|
dag_run_id = os.getenv("AIRFLOW_RUN_ID", None)
|
@@ -665,12 +665,12 @@ plexflow/utils/strings/__pycache__/sanitize.cpython-312.pyc,sha256=al-VD4Gphby-b
|
|
665
665
|
plexflow/utils/strings/filesize.py,sha256=mLVd0xqIEzAif5Tn_PyCddFmUPXPNnEbLhBNJTsgOvs,1547
|
666
666
|
plexflow/utils/strings/json_extract.py,sha256=590oY1LMnbe9COm3fD6z74OtOzxeXd3Hrf06afhHOvc,14884
|
667
667
|
plexflow/utils/strings/language.py,sha256=J9-wqmCdxf9Ws5_X1tV4vX4d7AGkKci0eaBE4Lit0j0,269
|
668
|
-
plexflow/utils/strings/sanitize.py,sha256=
|
668
|
+
plexflow/utils/strings/sanitize.py,sha256=KVc-1eLgIk5WK8QtCNFWMA6y_K3-E0ahH0kuQ6MkSlY,1354
|
669
669
|
plexflow/utils/subtitle/__pycache__/search.cpython-312.pyc,sha256=RiMTyALG74DJn67xhCvZ2ofXBOTyetMOU3Tq_bVdbts,3554
|
670
670
|
plexflow/utils/subtitle/search.py,sha256=HW_JOrj-cpRrVnxWh56XjRWhb98E73V1V5QHCq2y7CM,2441
|
671
671
|
plexflow/utils/tasks/__pycache__/decorators.cpython-311.pyc,sha256=8zuAsEfYLEBQQ4DGKqkx-JFCjd73kGhAiPblBNFa2cQ,1675
|
672
672
|
plexflow/utils/tasks/__pycache__/tasks.cpython-311.pyc,sha256=8RRMTHAy-t6yW0rlDX9wpZyO-9Cg4SQoD-NVasL94SQ,1670
|
673
|
-
plexflow/utils/tasks/decorators.py,sha256=
|
673
|
+
plexflow/utils/tasks/decorators.py,sha256=ViXNX7Sl1Voh9lOGzwz0OBlzGjbfFc9lr1fTQpOVYJM,3113
|
674
674
|
plexflow/utils/tasks/k8s/task.py,sha256=oCfOBjitZ48D1M52w2dpf7HaHZTmvYV9YS_ccixLs0w,2709
|
675
675
|
plexflow/utils/thread_safe/__pycache__/safe_list.cpython-312.pyc,sha256=v5skxCDKmE_T4Ggodqcc5o44GySq05dU0m08OdslANo,4032
|
676
676
|
plexflow/utils/thread_safe/__pycache__/safe_set.cpython-312.pyc,sha256=z0FdFIU076Mv4lTGkcoxn1IOo5HIfwcwj4oWiPj5oAc,4858
|
@@ -715,7 +715,7 @@ plexflow/utils/video/__pycache__/audio.cpython-312.pyc,sha256=kmzGDCHSC1hWyHwRut
|
|
715
715
|
plexflow/utils/video/__pycache__/subtitle.cpython-312.pyc,sha256=PCjpCLydGXaRsQy6cikhgsEs8WlComfOoYPiLFqfVMA,2515
|
716
716
|
plexflow/utils/video/audio.py,sha256=Pd8OuQHX2QN-lc5iYkB0Vo1OEHmTcvDYH-uKud1f1q4,5262
|
717
717
|
plexflow/utils/video/subtitle.py,sha256=qPvvBjlPj0fynJJvGJgGeKt9ey26R-cF6EoLaYt9iXU,1333
|
718
|
-
plexflow-0.0.
|
719
|
-
plexflow-0.0.
|
720
|
-
plexflow-0.0.
|
721
|
-
plexflow-0.0.
|
718
|
+
plexflow-0.0.138.dist-info/METADATA,sha256=3eylt_jlbNFf7XSiM4Hz_7SLXJZO_z3GZZFv4P9mcmY,2971
|
719
|
+
plexflow-0.0.138.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
720
|
+
plexflow-0.0.138.dist-info/entry_points.txt,sha256=9RJC3ikOQORHNOn573EdwJOBUnFU_4EGHbtNUM5pjjY,1557
|
721
|
+
plexflow-0.0.138.dist-info/RECORD,,
|
File without changes
|
File without changes
|