execsql2 2.15.2__py3-none-any.whl → 2.15.5__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.
- execsql/utils/datetime.py +12 -0
- {execsql2-2.15.2.dist-info → execsql2-2.15.5.dist-info}/METADATA +11 -2
- {execsql2-2.15.2.dist-info → execsql2-2.15.5.dist-info}/RECORD +22 -22
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/README.md +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/config_settings.sqlite +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/example_config_prompt.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/execsql.conf +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/make_config_db.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/md_compare.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/md_glossary.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/md_upsert.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/pg_compare.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/pg_glossary.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/pg_upsert.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/script_template.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/ss_compare.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/ss_glossary.sql +0 -0
- {execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/ss_upsert.sql +0 -0
- {execsql2-2.15.2.dist-info → execsql2-2.15.5.dist-info}/WHEEL +0 -0
- {execsql2-2.15.2.dist-info → execsql2-2.15.5.dist-info}/entry_points.txt +0 -0
- {execsql2-2.15.2.dist-info → execsql2-2.15.5.dist-info}/licenses/LICENSE.txt +0 -0
- {execsql2-2.15.2.dist-info → execsql2-2.15.5.dist-info}/licenses/NOTICE +0 -0
execsql/utils/datetime.py
CHANGED
|
@@ -25,12 +25,22 @@ __all__ = ["parse_datetime", "parse_datetimetz"]
|
|
|
25
25
|
# misidentified as timestamps.
|
|
26
26
|
_NUMERIC_ONLY = re.compile(r"^[+-]?\d+\.?\d*$")
|
|
27
27
|
|
|
28
|
+
# Match time-only strings like "13:15:45", "9:30", "1:15:45.123", "09:30 AM".
|
|
29
|
+
# dateutil parses these by filling in today's date, which causes DT_Timestamp
|
|
30
|
+
# to claim the column before DT_Time gets a chance.
|
|
31
|
+
_TIME_ONLY = re.compile(r"^\d{1,2}:\d{2}(?::\d{2}(?:\.\d+)?)?\s*(?:[AaPp][Mm])?$")
|
|
32
|
+
|
|
28
33
|
|
|
29
34
|
def _looks_numeric(s: str) -> bool:
|
|
30
35
|
"""Return True if *s* is a bare number that should not be parsed as a date."""
|
|
31
36
|
return bool(_NUMERIC_ONLY.match(s.strip()))
|
|
32
37
|
|
|
33
38
|
|
|
39
|
+
def _looks_time_only(s: str) -> bool:
|
|
40
|
+
"""Return True if *s* is a time-only string (no date component)."""
|
|
41
|
+
return bool(_TIME_ONLY.match(s.strip()))
|
|
42
|
+
|
|
43
|
+
|
|
34
44
|
def parse_datetime(datestr: Any) -> datetime.datetime | None:
|
|
35
45
|
"""Parse a date/time string into a :class:`datetime.datetime`.
|
|
36
46
|
|
|
@@ -53,6 +63,8 @@ def parse_datetime(datestr: Any) -> datetime.datetime | None:
|
|
|
53
63
|
return None
|
|
54
64
|
if _looks_numeric(datestr):
|
|
55
65
|
return None
|
|
66
|
+
if _looks_time_only(datestr):
|
|
67
|
+
return None
|
|
56
68
|
try:
|
|
57
69
|
return _dateutil_parser.parse(datestr)
|
|
58
70
|
except (ValueError, OverflowError, TypeError):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: execsql2
|
|
3
|
-
Version: 2.15.
|
|
3
|
+
Version: 2.15.5
|
|
4
4
|
Summary: Runs a SQL script against a PostgreSQL, SQLite, MariaDB/MySQL, DuckDB, Firebird, MS-Access, MS-SQL-Server, or Oracle database, or an ODBC DSN. Provides metacommands to import and export data, copy data between databases, conditionally execute SQL and metacommands, and dynamically alter SQL and metacommands with substitution variables.
|
|
5
5
|
Project-URL: Homepage, https://execsql2.readthedocs.io
|
|
6
6
|
Project-URL: Repository, https://github.com/geocoug/execsql
|
|
@@ -69,6 +69,13 @@ Requires-Dist: pymysql; extra == 'all-db'
|
|
|
69
69
|
Requires-Dist: pyodbc; extra == 'all-db'
|
|
70
70
|
Provides-Extra: auth
|
|
71
71
|
Requires-Dist: keyring; extra == 'auth'
|
|
72
|
+
Provides-Extra: auth-encrypted
|
|
73
|
+
Requires-Dist: keyring; extra == 'auth-encrypted'
|
|
74
|
+
Requires-Dist: keyrings-alt; extra == 'auth-encrypted'
|
|
75
|
+
Requires-Dist: pycryptodome; extra == 'auth-encrypted'
|
|
76
|
+
Provides-Extra: auth-plaintext
|
|
77
|
+
Requires-Dist: keyring; extra == 'auth-plaintext'
|
|
78
|
+
Requires-Dist: keyrings-alt; extra == 'auth-plaintext'
|
|
72
79
|
Provides-Extra: dev
|
|
73
80
|
Requires-Dist: build>=1.2.2.post1; extra == 'dev'
|
|
74
81
|
Requires-Dist: bump-my-version>=1.2.7; extra == 'dev'
|
|
@@ -167,7 +174,9 @@ pip install execsql2[odbc] # ODBC DSN (pyodbc)
|
|
|
167
174
|
|
|
168
175
|
# Feature bundles
|
|
169
176
|
pip install execsql2[formats] # ODS, Excel, Jinja2, Feather, Parquet, HDF5
|
|
170
|
-
pip install execsql2[auth]
|
|
177
|
+
pip install execsql2[auth] # OS keyring integration
|
|
178
|
+
pip install execsql2[auth-plaintext] # Keyring + plaintext file backend (headless Linux)
|
|
179
|
+
pip install execsql2[auth-encrypted] # Keyring + encrypted file backend (headless Linux)
|
|
171
180
|
|
|
172
181
|
# Convenience
|
|
173
182
|
pip install execsql2[all-db] # All database drivers
|
|
@@ -84,7 +84,7 @@ execsql/script/variables.py,sha256=gTCCWY64LFmQUna-63CM1GAbupcaOTSS4cn6HDaHk9Q,1
|
|
|
84
84
|
execsql/utils/__init__.py,sha256=0uR6JwVJQRX3vceByNBduCAf5dd5assKjeqJUWvpZoA,278
|
|
85
85
|
execsql/utils/auth.py,sha256=onXzNkNZQZxGC5w7eey06sjvAIAX_Lf9g7nUJtcsel0,7009
|
|
86
86
|
execsql/utils/crypto.py,sha256=2OnBWwn9bCBGc1ZkyRv16TvhottoCNYtXqgbE3mG3Sg,2960
|
|
87
|
-
execsql/utils/datetime.py,sha256=
|
|
87
|
+
execsql/utils/datetime.py,sha256=rMCXAbvj6bxKCYzC97vrludO6PU5DYQ39buZ0smDC5A,3573
|
|
88
88
|
execsql/utils/errors.py,sha256=cIYU7mKgjrRy5D2D4aDFHsH__lToz4Nv3fLQ62R1V2M,7786
|
|
89
89
|
execsql/utils/fileio.py,sha256=U8ZtACgaynO5FchixhwZ3KOux337u_crwh4B4NJzra4,23864
|
|
90
90
|
execsql/utils/gui.py,sha256=eZeFJm8EaWnzeHIw_O-tn9hO8sxGjZRX_aUFDtGQp4w,18396
|
|
@@ -93,24 +93,24 @@ execsql/utils/numeric.py,sha256=xh02ANSRk3nUpQ-rtm66ILoMqoi7HtzCoRMIOT9U8QI,1570
|
|
|
93
93
|
execsql/utils/regex.py,sha256=diEzTZqU_HHwVMadPAvN1Vgzhl7I03eVaEFGCXyGGL8,3770
|
|
94
94
|
execsql/utils/strings.py,sha256=5Dvzrk-9SIw2lpxXZQkiJbNyo1sy7iXXAtSULlZ0KG8,8488
|
|
95
95
|
execsql/utils/timer.py,sha256=eDYf5VzCNFk7oo90InJucUm3XcBdhYMogjZMqeg9xzc,1899
|
|
96
|
-
execsql2-2.15.
|
|
97
|
-
execsql2-2.15.
|
|
98
|
-
execsql2-2.15.
|
|
99
|
-
execsql2-2.15.
|
|
100
|
-
execsql2-2.15.
|
|
101
|
-
execsql2-2.15.
|
|
102
|
-
execsql2-2.15.
|
|
103
|
-
execsql2-2.15.
|
|
104
|
-
execsql2-2.15.
|
|
105
|
-
execsql2-2.15.
|
|
106
|
-
execsql2-2.15.
|
|
107
|
-
execsql2-2.15.
|
|
108
|
-
execsql2-2.15.
|
|
109
|
-
execsql2-2.15.
|
|
110
|
-
execsql2-2.15.
|
|
111
|
-
execsql2-2.15.
|
|
112
|
-
execsql2-2.15.
|
|
113
|
-
execsql2-2.15.
|
|
114
|
-
execsql2-2.15.
|
|
115
|
-
execsql2-2.15.
|
|
116
|
-
execsql2-2.15.
|
|
96
|
+
execsql2-2.15.5.data/data/execsql2_extras/README.md,sha256=sxwVyU0ZahCfANv56LahkyuM505kFjrMhe-1SvWE69E,4845
|
|
97
|
+
execsql2-2.15.5.data/data/execsql2_extras/config_settings.sqlite,sha256=aY5cxR7Q7J6zJ4bC9lu5mHUrhy211Cq3MNKPQVCt02E,20480
|
|
98
|
+
execsql2-2.15.5.data/data/execsql2_extras/example_config_prompt.sql,sha256=SY3Jxn1qcVm4kPW9xmmTfknHfvURXmeEYTbRjYrjGSw,7487
|
|
99
|
+
execsql2-2.15.5.data/data/execsql2_extras/execsql.conf,sha256=_45iJ-KWZnB8uMW_gEg067MM5pmGJ-dVl7VbAZMunAE,9530
|
|
100
|
+
execsql2-2.15.5.data/data/execsql2_extras/make_config_db.sql,sha256=WwyC6dK-Eh5CAVppiBCDHqiI1_wEI9U95Ytpr4lsZkg,8726
|
|
101
|
+
execsql2-2.15.5.data/data/execsql2_extras/md_compare.sql,sha256=B8Wd7LZ0vnMY2qvA139JIEBkPObgRH2i5xj6PejTQt8,24092
|
|
102
|
+
execsql2-2.15.5.data/data/execsql2_extras/md_glossary.sql,sha256=DJRHcU5NbFpxTTX-IwH3yRlsboj1q6BBGrUAHKn4Cuo,10796
|
|
103
|
+
execsql2-2.15.5.data/data/execsql2_extras/md_upsert.sql,sha256=v_7GbWh_N1mBTmw3gvTrkagOVp2q0KmXvM8hE-DlFxY,112524
|
|
104
|
+
execsql2-2.15.5.data/data/execsql2_extras/pg_compare.sql,sha256=9dWa8hnfy5dVJI-z2iGpd9JzQmI4j2ziMlEdpnr66ro,24352
|
|
105
|
+
execsql2-2.15.5.data/data/execsql2_extras/pg_glossary.sql,sha256=pKjIIDsROAgJq2H-1qNEcRMAWManivcZ_AEVHzUUlic,9908
|
|
106
|
+
execsql2-2.15.5.data/data/execsql2_extras/pg_upsert.sql,sha256=k7AFiGTLBy3nf-qO5QIaZrEYTAKvdxxU3JDLx9jqkzs,108315
|
|
107
|
+
execsql2-2.15.5.data/data/execsql2_extras/script_template.sql,sha256=1Estacb_vm1FgK41k_G9nuduP1yiA-fQ1Kn4Z4mv5Ao,11153
|
|
108
|
+
execsql2-2.15.5.data/data/execsql2_extras/ss_compare.sql,sha256=TsVxWm3cEpR5-EiMYXNhtaY0arSNeKZhsJdHdLA7xeI,24833
|
|
109
|
+
execsql2-2.15.5.data/data/execsql2_extras/ss_glossary.sql,sha256=cLM7nN8JOIu9ZVP9oY9qdSK3hrnWJiDcX6nZmQQbQWI,13065
|
|
110
|
+
execsql2-2.15.5.data/data/execsql2_extras/ss_upsert.sql,sha256=BCqmBykXBF-BpCgOFeG1qhf2XfScKsxPD17wd1hYfHw,120647
|
|
111
|
+
execsql2-2.15.5.dist-info/METADATA,sha256=_3p9ZiyzNpBE7mXSqJn1ksqqTvpGLimI86pkXFTabm4,18114
|
|
112
|
+
execsql2-2.15.5.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
113
|
+
execsql2-2.15.5.dist-info/entry_points.txt,sha256=sUOxkM-dN1eBGGpSpDLsAaE0yNXYQKWZAfxPOlMkQyk,90
|
|
114
|
+
execsql2-2.15.5.dist-info/licenses/LICENSE.txt,sha256=LBdhuxejF8_bLCHZ2kWfmDXpDGUu914Gbd6_3JjCRe0,676
|
|
115
|
+
execsql2-2.15.5.dist-info/licenses/NOTICE,sha256=sqVrM73Ys9zfvWC_P797lHfTnoPW_ETeBSrUTFaob0A,339
|
|
116
|
+
execsql2-2.15.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{execsql2-2.15.2.data → execsql2-2.15.5.data}/data/execsql2_extras/example_config_prompt.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|