rm-date-parser 0.1.0__tar.gz → 0.2.2__tar.gz

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.
@@ -1,36 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rm-date-parser
3
- Version: 0.1.0
3
+ Version: 0.2.2
4
4
  Summary: Finds every date in text and returns each one with the detected format
5
5
  Author-email: Vaibhav Singh <admin@rationalminds.net>
6
- License: MIT License
7
-
8
- Copyright (c) 2025 Vaibhav Singh
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
6
+ License-Expression: MIT
28
7
  Project-URL: Homepage, https://github.com/vbhavsingh/DateParserPython
29
8
  Project-URL: Issues, https://github.com/vbhavsingh/DateParserPython/issues
30
9
  Keywords: date,parser,nlp,datetime
31
10
  Classifier: Development Status :: 3 - Alpha
32
11
  Classifier: Intended Audience :: Developers
33
- Classifier: License :: OSI Approved :: MIT License
34
12
  Classifier: Programming Language :: Python
35
13
  Classifier: Programming Language :: Python :: 3
36
14
  Classifier: Programming Language :: Python :: 3.9
@@ -4,20 +4,20 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rm-date-parser"
7
- version = "0.1.0"
7
+ version = "0.2.2"
8
8
  description = "Finds every date in text and returns each one with the detected format"
9
9
  readme = "README.md"
10
10
  authors = [
11
11
  { name = "Vaibhav Singh", email="admin@rationalminds.net" }
12
12
  ]
13
- license = { file = "LICENSE" }
13
+ license = "MIT"
14
+ license-files = ["LICENSE"]
14
15
  requires-python = ">=3.9"
15
16
  dependencies = []
16
17
  keywords = ["date", "parser", "nlp", "datetime"]
17
18
  classifiers = [
18
19
  "Development Status :: 3 - Alpha",
19
20
  "Intended Audience :: Developers",
20
- "License :: OSI Approved :: MIT License",
21
21
  "Programming Language :: Python",
22
22
  "Programming Language :: Python :: 3",
23
23
  "Programming Language :: Python :: 3.9",
@@ -3,7 +3,7 @@
3
3
  from .parser import Parser
4
4
  from .models import DateElement, LocalDateModel
5
5
 
6
- __version__ = "0.1.0"
6
+ __version__ = "0.2.2"
7
7
 
8
8
  __all__ = [
9
9
  "Parser",
@@ -150,19 +150,19 @@ class Parser:
150
150
  tokens: Iterable[str]
151
151
  if "." in s or "," in s:
152
152
  tokens = self._tokenize(s, ":., ")
153
- hour, minute, second, millis = (int(token) for token in tokens)
153
+ hour, minute, second, millis = (int(token) for token in tokens[:4])
154
154
  if "." in s:
155
155
  probable_time_format = format_string + ".SSS"
156
156
  if "," in s:
157
157
  probable_time_format = format_string + ",SSS"
158
158
  else:
159
159
  tokens = self._tokenize(s, ": ")
160
- hour, minute, second = (int(token) for token in tokens)
160
+ hour, minute, second = (int(token) for token in tokens[:3])
161
161
  millis = 0
162
162
  if element.hasAmPm:
163
163
  if "pm" in s.lower():
164
164
  hour = hour + 12
165
- probable_time_format = f"{probable_time_format} aaa"
165
+ probable_time_format = f"{probable_time_format}"
166
166
  format_string = format_string.replace("HH", "hh")
167
167
  probable_time_format = probable_time_format.replace("HH", "hh")
168
168
  if hour < 24 and minute < 60 and second < 60 and millis < 10000:
@@ -533,6 +533,7 @@ class Parser:
533
533
  ampm = f"{possible_time[time_frg_length - 2]}{possible_time[time_frg_length - 1]}"
534
534
  if ampm.lower() in {"am", "pm"}:
535
535
  ele.hasAmPm = True
536
+ ele.endPos = count + 3
536
537
  ele.dateTimeSeprator = date_time_separator
537
538
  return date_groups
538
539
 
@@ -1,36 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rm-date-parser
3
- Version: 0.1.0
3
+ Version: 0.2.2
4
4
  Summary: Finds every date in text and returns each one with the detected format
5
5
  Author-email: Vaibhav Singh <admin@rationalminds.net>
6
- License: MIT License
7
-
8
- Copyright (c) 2025 Vaibhav Singh
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
6
+ License-Expression: MIT
28
7
  Project-URL: Homepage, https://github.com/vbhavsingh/DateParserPython
29
8
  Project-URL: Issues, https://github.com/vbhavsingh/DateParserPython/issues
30
9
  Keywords: date,parser,nlp,datetime
31
10
  Classifier: Development Status :: 3 - Alpha
32
11
  Classifier: Intended Audience :: Developers
33
- Classifier: License :: OSI Approved :: MIT License
34
12
  Classifier: Programming Language :: Python
35
13
  Classifier: Programming Language :: Python :: 3
36
14
  Classifier: Programming Language :: Python :: 3.9
File without changes
File without changes
File without changes