diff options
| author | Scott Gasch <[email protected]> | 2021-07-08 22:25:12 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2021-07-08 22:25:12 -0700 |
| commit | 11eeb8574b7b4620ac6fd440cb251f8aa2458f5b (patch) | |
| tree | 97f8e64eddd4528b01af58df269427814b889929 /string_utils.py | |
| parent | e516059c716537259c601c022cc3bad44025385e (diff) | |
Reduce import scopes, remove cycles.
Diffstat (limited to 'string_utils.py')
| -rw-r--r-- | string_utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/string_utils.py b/string_utils.py index 7ad9c42..740a0b9 100644 --- a/string_utils.py +++ b/string_utils.py @@ -11,9 +11,6 @@ from typing import Any, List, Optional import unicodedata from uuid import uuid4 -import dateparse.dateparse_utils as dp - - logger = logging.getLogger(__name__) NUMBER_RE = re.compile(r"^([+\-]?)((\d+)(\.\d+)?([e|E]\d+)?|\.\d+)$") @@ -815,6 +812,7 @@ def to_bool(in_str: str) -> bool: def to_date(in_str: str) -> Optional[datetime.date]: + import dateparse.dateparse_utils as dp try: d = dp.DateParser() d.parse(in_str) @@ -825,6 +823,7 @@ def to_date(in_str: str) -> Optional[datetime.date]: def valid_date(in_str: str) -> bool: + import dateparse.dateparse_utils as dp try: d = dp.DateParser() _ = d.parse(in_str) @@ -835,6 +834,7 @@ def valid_date(in_str: str) -> bool: def to_datetime(in_str: str) -> Optional[datetime.datetime]: + import dateparse.dateparse_utils as dp try: d = dp.DateParser() dt = d.parse(in_str) |
