unique_toolkit 1.45.1__py3-none-any.whl → 1.45.2__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.
- unique_toolkit/_common/utils/files.py +13 -4
- {unique_toolkit-1.45.1.dist-info → unique_toolkit-1.45.2.dist-info}/METADATA +4 -1
- {unique_toolkit-1.45.1.dist-info → unique_toolkit-1.45.2.dist-info}/RECORD +5 -5
- {unique_toolkit-1.45.1.dist-info → unique_toolkit-1.45.2.dist-info}/LICENSE +0 -0
- {unique_toolkit-1.45.1.dist-info → unique_toolkit-1.45.2.dist-info}/WHEEL +0 -0
|
@@ -9,10 +9,14 @@ class FileMimeType(StrEnum):
|
|
|
9
9
|
PDF = "application/pdf"
|
|
10
10
|
DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
11
11
|
DOC = "application/msword"
|
|
12
|
+
# TODO: clean up duplicates and make the monolith compatible with this.
|
|
12
13
|
XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
14
|
+
MSEXCEL = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
13
15
|
XLS = "application/vnd.ms-excel"
|
|
16
|
+
EXCEL = "application/vnd.ms-excel"
|
|
14
17
|
PPT = "application/vnd.ms-powerpoint"
|
|
15
18
|
PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
19
|
+
MSPPT = "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
16
20
|
CSV = "text/csv"
|
|
17
21
|
HTML = "text/html"
|
|
18
22
|
MD = "text/markdown"
|
|
@@ -42,12 +46,12 @@ class FileMimeType(StrEnum):
|
|
|
42
46
|
@classmethod
|
|
43
47
|
def is_xlsx_mime(cls, filepath: Path) -> bool:
|
|
44
48
|
mime_type = cls.get_mime_from_file_path(filepath)
|
|
45
|
-
return mime_type in {cls.XLSX, cls.XLS}
|
|
49
|
+
return mime_type in {cls.XLSX, cls.XLS, cls.MSEXCEL, cls.EXCEL}
|
|
46
50
|
|
|
47
51
|
@classmethod
|
|
48
52
|
def is_pptx_mime(cls, filepath: Path) -> bool:
|
|
49
53
|
mime_type = cls.get_mime_from_file_path(filepath)
|
|
50
|
-
return mime_type in {cls.PPTX, cls.PPT}
|
|
54
|
+
return mime_type in {cls.PPTX, cls.PPT, cls.MSPPT}
|
|
51
55
|
|
|
52
56
|
@classmethod
|
|
53
57
|
def is_json_mime(cls, filepath: Path) -> bool:
|
|
@@ -64,9 +68,14 @@ def get_common_name(extension: FileMimeType) -> str:
|
|
|
64
68
|
match extension:
|
|
65
69
|
case FileMimeType.DOCX | FileMimeType.DOC:
|
|
66
70
|
return "docx"
|
|
67
|
-
case
|
|
71
|
+
case (
|
|
72
|
+
FileMimeType.XLSX
|
|
73
|
+
| FileMimeType.XLS
|
|
74
|
+
| FileMimeType.MSEXCEL
|
|
75
|
+
| FileMimeType.EXCEL
|
|
76
|
+
):
|
|
68
77
|
return "excel"
|
|
69
|
-
case FileMimeType.PPT | FileMimeType.PPTX:
|
|
78
|
+
case FileMimeType.PPT | FileMimeType.PPTX | FileMimeType.MSPPT:
|
|
70
79
|
return "powerpoint"
|
|
71
80
|
case FileMimeType.PDF:
|
|
72
81
|
return "pdf"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_toolkit
|
|
3
|
-
Version: 1.45.
|
|
3
|
+
Version: 1.45.2
|
|
4
4
|
Summary:
|
|
5
5
|
License: Proprietary
|
|
6
6
|
Author: Cedric Klinkert
|
|
@@ -125,6 +125,9 @@ All notable changes to this project will be documented in this file.
|
|
|
125
125
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
126
126
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
127
127
|
|
|
128
|
+
## [1.45.2] - 2026-01-26
|
|
129
|
+
- Make FileMimeType backwards compatible with legacy extensions
|
|
130
|
+
|
|
128
131
|
## [1.45.1] - 2026-01-26
|
|
129
132
|
- Add FileMimeType utility helpers
|
|
130
133
|
|
|
@@ -55,7 +55,7 @@ unique_toolkit/_common/tests/test_string_utilities.py,sha256=J2HYZ1fniOfJWI149wl
|
|
|
55
55
|
unique_toolkit/_common/token/image_token_counting.py,sha256=VpFfZyY0GIH27q_Wy4YNjk2algqvbCtJyzuuROoFQPw,2189
|
|
56
56
|
unique_toolkit/_common/token/token_counting.py,sha256=gM4B_aUqKqEPvmStFNcvCWNMNNNNKbVaywBDxlbgIps,7121
|
|
57
57
|
unique_toolkit/_common/utils/__init__.py,sha256=qHrEy-3zkbFPdGFriRscPbGKuQfOuPi3O7tE5Zw5VHY,37
|
|
58
|
-
unique_toolkit/_common/utils/files.py,sha256=
|
|
58
|
+
unique_toolkit/_common/utils/files.py,sha256=GLfbk-gcLIh5J1nlWMa2hWx0IDzrCvSNDTfjMa9ktbU,3905
|
|
59
59
|
unique_toolkit/_common/utils/image/encode.py,sha256=IJhtTcIT_azhiDsPp15oYs2LPze2l-sGlZrJASHrDVI,658
|
|
60
60
|
unique_toolkit/_common/utils/jinja/helpers.py,sha256=UQWj0hFMtnuUFYDJ8NKbEblvYE8DrWX1o7fKQU3H9IQ,262
|
|
61
61
|
unique_toolkit/_common/utils/jinja/render.py,sha256=J5UBIWoljl-Us7SjZIap9wewcLTzpXjQpOgas_YTf3Y,482
|
|
@@ -244,7 +244,7 @@ unique_toolkit/short_term_memory/service.py,sha256=5PeVBu1ZCAfyDb2HLVvlmqSbyzBBu
|
|
|
244
244
|
unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
245
245
|
unique_toolkit/smart_rules/compile.py,sha256=Ozhh70qCn2yOzRWr9d8WmJeTo7AQurwd3tStgBMPFLA,1246
|
|
246
246
|
unique_toolkit/test_utilities/events.py,sha256=_mwV2bs5iLjxS1ynDCjaIq-gjjKhXYCK-iy3dRfvO3g,6410
|
|
247
|
-
unique_toolkit-1.45.
|
|
248
|
-
unique_toolkit-1.45.
|
|
249
|
-
unique_toolkit-1.45.
|
|
250
|
-
unique_toolkit-1.45.
|
|
247
|
+
unique_toolkit-1.45.2.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
|
248
|
+
unique_toolkit-1.45.2.dist-info/METADATA,sha256=WeKaLthzSrgmcOWbNRtK0VrZrwVEBtOhgM1Id-P5Els,48902
|
|
249
|
+
unique_toolkit-1.45.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
250
|
+
unique_toolkit-1.45.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|