abstract-utilities 0.2.2.462__py3-none-any.whl → 0.2.2.464__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 abstract-utilities might be problematic. Click here for more details.

@@ -1,6 +1,4 @@
1
- from pathlib import Path
2
- from typing import *
3
- import fnmatch, os, glob
1
+
4
2
  from .filter_params import *
5
3
  from .imports import *
6
4
 
@@ -0,0 +1,5 @@
1
+ from .constants import *
2
+
3
+ from .file_functions import *
4
+ from .imports import *
5
+ from ..imports import *
@@ -0,0 +1,39 @@
1
+ from .imports import *
2
+ from .module_imports import *
3
+ @dataclass
4
+ class ScanConfig:
5
+ allowed_exts: Set[str]
6
+ unallowed_exts: Set[str]
7
+ exclude_types: Set[str]
8
+ exclude_dirs: List[str] = field(default_factory=list)
9
+ exclude_patterns: List[str] = field(default_factory=list)
10
+ DEFAULT_ALLOWED_EXTS: Set[str] = {
11
+ ".py", ".pyw", # python
12
+ ".js", ".jsx", ".ts", ".tsx", ".mjs", # JS/TS
13
+ ".html", ".htm", ".xml", # markup
14
+ ".css", ".scss", ".sass", ".less", # styles
15
+ ".json", ".yaml", ".yml", ".toml", ".ini", # configs
16
+ ".cfg", ".md", ".markdown", ".rst", # docs
17
+ ".sh", ".bash", ".env", # scripts/env
18
+ ".txt" # plain text
19
+ }
20
+
21
+ DEFAULT_EXCLUDE_TYPES: Set[str] = {
22
+ "image", "video", "audio", "presentation",
23
+ "spreadsheet", "archive", "executable"
24
+ }
25
+
26
+ # never want these—even if they sneak into ALLOWED
27
+ _unallowed = set(get_media_exts(DEFAULT_EXCLUDE_TYPES)) | {'.bak', '.shp', '.cpg', '.dbf', '.shx','.geojson',".pyc",'.shx','.geojson','.prj','.sbn','.sbx'}
28
+ DEFAULT_UNALLOWED_EXTS = {e for e in _unallowed if e not in DEFAULT_ALLOWED_EXTS}
29
+
30
+ DEFAULT_EXCLUDE_DIRS: Set[str] = {
31
+ "node_modules", "old","__pycache__", "backups", "backup", "backs", "trash", "depriciated", "old", "__init__"
32
+ }
33
+
34
+ DEFAULT_EXCLUDE_PATTERNS: Set[str] = {
35
+ "__init__*", "*.tmp", "*.log", "*.lock", "*.zip","*~"
36
+ }
37
+ REMOTE_RE = re.compile(r"^(?P<host>[^:\s]+@[^:\s]+):(?P<path>/.*)$")
38
+ AllowedPredicate = Optional[Callable[[str], bool]]
39
+ DEFAULT_EXCLUDE_FILE_PATTERNS=DEFAULT_EXCLUDE_PATTERNS
@@ -0,0 +1,10 @@
1
+ from .imports import *
2
+ def get_caller_path():
3
+ i = i or 1
4
+ frame = inspect.stack()[i]
5
+ return os.path.abspath(frame.filename)
6
+ def get_caller_dir(i=None):
7
+ i = i or 1
8
+ frame = inspect.stack()[i]
9
+ abspath = os.path.abspath(frame.filename)
10
+ return os.path.dirname(abspath)
@@ -0,0 +1,39 @@
1
+ # ============================================================
2
+ # abstract_utilities/imports/imports.py
3
+ # Global imports hub — everything imported here will be
4
+ # automatically available to any module that does:
5
+ # from ..imports import *
6
+ # ============================================================
7
+ # ---- Core standard library modules -------------------------
8
+ import os, sys, re, shlex, glob, platform, textwrap, subprocess, inspect, json, time
9
+ import tempfile, shutil, logging, pathlib, fnmatch, importlib, importlib.util, types
10
+ from pathlib import Path
11
+ from datetime import datetime
12
+ from types import ModuleType
13
+
14
+ # ---- Dataclasses and typing --------------------------------
15
+ from dataclasses import dataclass, field
16
+ from typing import (
17
+ Any, Optional, List, Dict, Set, Tuple,
18
+ Iterable, Callable, Literal, Union, TypeVar
19
+ )
20
+
21
+ # ---- Common 3rd-party dependencies --------------------------
22
+ import pandas as pd
23
+ import geopandas as gpd
24
+ import pytesseract
25
+ import pdfplumber
26
+ import PyPDF2
27
+ import ezodf
28
+ from pdf2image import convert_from_path
29
+ from werkzeug.utils import secure_filename
30
+ from werkzeug.datastructures import FileStorage
31
+
32
+ # ---- Helpers ------------------------------------------------
33
+ import textwrap as tw
34
+ from pprint import pprint
35
+
36
+ # ============================================================
37
+ # AUTO-EXPORT ALL NON-PRIVATE NAMES
38
+ # ============================================================
39
+ __all__ = [name for name in globals() if not name.startswith("_")]
@@ -0,0 +1,13 @@
1
+ from .imports import *
2
+ from ....string_clean import eatAll
3
+ from ....list_utils import make_list
4
+ from ....type_utils import get_media_exts, is_media_type, MIME_TYPES, is_str
5
+ from ....ssh_utils import *
6
+ from ....env_utils import *
7
+ from ....read_write_utils import *
8
+ from ....abstract_classes import SingletonMeta
9
+
10
+ from ....class_utils import get_caller, get_caller_path, get_caller_dir
11
+
12
+
13
+ __all__ = [name for name in globals() if not name.startswith("_")]
@@ -1,5 +1,6 @@
1
1
  from ..imports import *
2
2
  from typing import *
3
+ from dataclasses import dataclass, field
3
4
  @dataclass
4
5
  class ScanConfig:
5
6
  allowed_exts: Set[str]
@@ -1,6 +1,5 @@
1
1
  from .imports import *
2
- import subprocess, os
3
- from typing import Optional
2
+
4
3
 
5
4
  # --- Base remote checker -----------------------------------------------------
6
5
  def _remote_test(path: str, test_flag: str, user_at_host: str, timeout: int = 5) -> bool:
@@ -50,7 +49,7 @@ def is_file(path: str,*args, user_at_host: Optional[str] = None,**kwargs) -> boo
50
49
  return is_local_file(path)
51
50
 
52
51
 
53
- def is_dir(path: str, *args,user_at_host: Optional[str] = None,**kwargs)) -> bool:
52
+ def is_dir(path: str, *args,user_at_host: Optional[str] = None,**kwargs) -> bool:
54
53
  """Determine if path is a directory (works local or remote)."""
55
54
  if user_at_host:
56
55
  return is_remote_dir(path, user_at_host)
@@ -1,5 +1,5 @@
1
1
  from .constants import *
2
- from .imports import *
3
2
  from .module_imports import *
4
3
  from .classes import *
5
4
  from .file_functions import *
5
+ from .imports import *
@@ -1,13 +1,40 @@
1
- import pandas as pd
2
- from typing import *
3
- import geopandas as gpd
1
+ # ============================================================
2
+ # abstract_utilities/imports/imports.py
3
+ # Global imports hub — everything imported here will be
4
+ # automatically available to any module that does:
5
+ # from ..imports import *
6
+ # ============================================================
7
+
8
+ # ---- Core standard library modules -------------------------
9
+ import os, sys, re, shlex, glob, platform, textwrap, subprocess, inspect, json, time
10
+ import tempfile, shutil, logging, pathlib, fnmatch, importlib, importlib.util, types
4
11
  from pathlib import Path
5
- from types import ModuleType
6
12
  from datetime import datetime
7
- from pdf2image import convert_from_path
13
+ from types import ModuleType
14
+
15
+ # ---- Dataclasses and typing --------------------------------
8
16
  from dataclasses import dataclass, field
17
+ from typing import (
18
+ Any, Optional, List, Dict, Set, Tuple,
19
+ Iterable, Callable, Literal, Union, TypeVar
20
+ )
21
+
22
+ # ---- Common 3rd-party dependencies --------------------------
23
+ import pandas as pd
24
+ import geopandas as gpd
25
+ import pytesseract
26
+ import pdfplumber
27
+ import PyPDF2
28
+ import ezodf
29
+ from pdf2image import convert_from_path
9
30
  from werkzeug.utils import secure_filename
10
31
  from werkzeug.datastructures import FileStorage
11
- import fnmatch, fnmatch,shlex, os, glob, platform, textwrap, pkgutil,time
12
- import tempfile,shutil,logging,ezodf,fnmatch,pytesseract,pdfplumber,re
13
- import textwrap, sys, types, importlib, importlib.util, inspect,PyPDF2
32
+
33
+ # ---- Helpers ------------------------------------------------
34
+ import textwrap as tw
35
+ from pprint import pprint
36
+
37
+ # ============================================================
38
+ # AUTO-EXPORT ALL NON-PRIVATE NAMES
39
+ # ============================================================
40
+ __all__ = [name for name in globals() if not name.startswith("_")]
@@ -1,10 +1,13 @@
1
+ from .imports import *
1
2
  from ...string_clean import eatAll
2
3
  from ...list_utils import make_list
3
- from ...type_utils import get_media_exts, is_media_type,MIME_TYPES,is_str
4
+ from ...type_utils import get_media_exts, is_media_type, MIME_TYPES, is_str
4
5
  from ...ssh_utils import *
5
6
  from ...env_utils import *
6
7
  from ...read_write_utils import *
7
8
  from ...abstract_classes import SingletonMeta
8
9
  from ...log_utils import get_logFile
9
- from ...class_utils import get_caller,get_caller_path,get_caller_dir
10
- from ...ssh_utils import run_cmd
10
+ from ...class_utils import get_caller, get_caller_path, get_caller_dir
11
+ from ...ssh_utils import run_cmd
12
+
13
+ __all__ = [name for name in globals() if not name.startswith("_")]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: abstract_utilities
3
- Version: 0.2.2.462
3
+ Version: 0.2.2.464
4
4
  Summary: abstract_utilities is a collection of utility modules providing a variety of functions to aid in tasks such as data comparison, list manipulation, JSON handling, string manipulation, mathematical computations, and time operations.
5
5
  Home-page: https://github.com/AbstractEndeavors/abstract_utilities
6
6
  Author: putkoff
@@ -44,19 +44,24 @@ abstract_utilities/file_utils/req.py,sha256=CsdGHAWIHOLqjzyoOSZ7XYbNciVYnTgaUs5q
44
44
  abstract_utilities/file_utils/file_utils/__init__.py,sha256=WOsWvRf7lomRoS80xT1n-R0jvbyHsxPXMsdoPAN62cc,215
45
45
  abstract_utilities/file_utils/file_utils/file_filters.py,sha256=khfbonAPEAhW1wxfFo0I4dawYPCrIKEjNc7VKb1RvzA,3437
46
46
  abstract_utilities/file_utils/file_utils/file_reader.py,sha256=2MRj2PGKq4C-iKL8dmhHwWnhmA8GPVsNaWkTREOF9vo,24545
47
- abstract_utilities/file_utils/file_utils/file_utils.py,sha256=yS-C1q31pkOHAKO-B-IFECOck0CEgehSTIfbdNpeWU8,7775
47
+ abstract_utilities/file_utils/file_utils/file_utils.py,sha256=tVBhh1ZQYK-Iq-x5JL4ScS8rYQ7AOP8ezIDFgYs86Ds,7705
48
48
  abstract_utilities/file_utils/file_utils/filter_params.py,sha256=NF692W0cBhEsbtmaVzb8EKMAasasHDElSRaC9fnzYwE,3382
49
49
  abstract_utilities/file_utils/file_utils/find_collect.py,sha256=bPM7EDrNHlvwZx7CP3AWPNNybzE3AXCSfoMwh6uDHWo,4703
50
- abstract_utilities/file_utils/file_utils/imports.py,sha256=_YwqiYhJLQ4WOXpWXWjExdvMGNmBeSZy9Dsf4NCz2T8,278
50
+ abstract_utilities/file_utils/file_utils/imports.py,sha256=rF3zdWY98UKuSPwzEzhG0H4cfIVjLqCW3FwsGqFeakE,319
51
51
  abstract_utilities/file_utils/file_utils/map_utils.py,sha256=B_MlkLP8s-o0yU0R3Y2LcTpBntBzysJO18qq181xz9c,1043
52
52
  abstract_utilities/file_utils/file_utils/pdf_utils.py,sha256=D_wg8h-SapCvqinxRIKxMri1jWZNpr5jGvKq9EJePfY,10335
53
- abstract_utilities/file_utils/file_utils/type_checks.py,sha256=g5-Pwham8Ax6axfwkv4JA6hNdkz7I-Gf2H0YaIbW5ew,2626
54
- abstract_utilities/file_utils/imports/__init__.py,sha256=VWN_3t0gRSYCalXI0nRLEUB3O2kbqA_Y8wnFq_m5F7A,131
53
+ abstract_utilities/file_utils/file_utils/type_checks.py,sha256=S1k5lDM1Qd5g1FE_KqIE1aWexsFI0Af9droRI6qVb30,2576
54
+ abstract_utilities/file_utils/file_utils/imports/__init__.py,sha256=HfwhvZsAnwy9J5jF1QXsxhN60v9EzMBSZXZx7H9PR6Q,103
55
+ abstract_utilities/file_utils/file_utils/imports/constants.py,sha256=eIeSj48vtfa8CTYKuuZXbgJQepBrMracfVguaSuN41U,1626
56
+ abstract_utilities/file_utils/file_utils/imports/file_functions.py,sha256=25yta20DDsdgenXYjpm4Ma3Fd6WK9Q16EjyhcZubDFg,291
57
+ abstract_utilities/file_utils/file_utils/imports/imports.py,sha256=nLtDCj-E9htQ1rbbISevHSqviUGCxgCoTZ7KTAQrCpU,1488
58
+ abstract_utilities/file_utils/file_utils/imports/module_imports.py,sha256=pvRkjtWxQ9R4TisCKMQ9asDak63Y9eMGbpCB7DsEyqs,453
59
+ abstract_utilities/file_utils/imports/__init__.py,sha256=T-vdIj87HUj6H9tWMA67gNoEwLjnkMmEJpX5fN144fI,131
55
60
  abstract_utilities/file_utils/imports/classes.py,sha256=zw16D_h5AxJiks4ydbqkWkXVfvgmE-BpiC4eKInY_KI,12259
56
61
  abstract_utilities/file_utils/imports/constants.py,sha256=eIeSj48vtfa8CTYKuuZXbgJQepBrMracfVguaSuN41U,1626
57
62
  abstract_utilities/file_utils/imports/file_functions.py,sha256=25yta20DDsdgenXYjpm4Ma3Fd6WK9Q16EjyhcZubDFg,291
58
- abstract_utilities/file_utils/imports/imports.py,sha256=e1G_ssLBvhde0DDVXnUhqG5TCOMY2z_bKDcFXjWLoLM,537
59
- abstract_utilities/file_utils/imports/module_imports.py,sha256=25jhS0ZZL4y3h47yy5vNjxDqhusgSAIePCy5N-busl0,419
63
+ abstract_utilities/file_utils/imports/imports.py,sha256=5nl5jkDXSzYkTzT4kvNEwkNEU9VKrKk_GILArAOehv8,1489
64
+ abstract_utilities/file_utils/imports/module_imports.py,sha256=BROjglIl217zEuU0kwRilkK9vLrYC9e44AS5HS8HwD0,513
60
65
  abstract_utilities/robust_reader/__init__.py,sha256=4i6qW4lwhdYuoO5-p9Xbt8Lpmr3hzCh9Rgb9y19QJwk,28
61
66
  abstract_utilities/robust_reader/file_reader2.py,sha256=U-5opkLu-bct091Eb-5CiNBTf0UFoSITYi8zR-Sz38w,25077
62
67
  abstract_utilities/robust_reader/file_readers.py,sha256=U-5opkLu-bct091Eb-5CiNBTf0UFoSITYi8zR-Sz38w,25077
@@ -79,7 +84,7 @@ abstract_utilities/ssh_utils/classes.py,sha256=3Q9BfLpyagNFYyiF4bt-5UCezeUJv9NK9
79
84
  abstract_utilities/ssh_utils/imports.py,sha256=oX8WAv-pkhizzko_h3fIUp9Vhsse4nR7RN2vwONxIx0,317
80
85
  abstract_utilities/ssh_utils/pexpect_utils.py,sha256=JBdOIXBTXAqE5TrsFjmPWJgwSaWyRJN8rbJ6y3_zKPY,10556
81
86
  abstract_utilities/ssh_utils/utils.py,sha256=smUWAx3nW1h0etTndJ_te9bkUX5YzQ8kYd9_gD1TXLk,4882
82
- abstract_utilities-0.2.2.462.dist-info/METADATA,sha256=r835CTWz_2QHAO-Dll9ikrWh9aM4bW06iGCDOiSFQk8,28108
83
- abstract_utilities-0.2.2.462.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
84
- abstract_utilities-0.2.2.462.dist-info/top_level.txt,sha256=BF0GZ0xVFfN1K-hFIWPO3viNsOs1sSF86n1vHBg39FM,19
85
- abstract_utilities-0.2.2.462.dist-info/RECORD,,
87
+ abstract_utilities-0.2.2.464.dist-info/METADATA,sha256=siVnXIESyvKNYl9pjVjUOa4DZbR9dLizJpNFr4rJlBc,28108
88
+ abstract_utilities-0.2.2.464.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
89
+ abstract_utilities-0.2.2.464.dist-info/top_level.txt,sha256=BF0GZ0xVFfN1K-hFIWPO3viNsOs1sSF86n1vHBg39FM,19
90
+ abstract_utilities-0.2.2.464.dist-info/RECORD,,