mixpeek 0.6.25__py3-none-any.whl → 0.6.26__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.
- mixpeek/endpoints/extract.py +1 -1
- mixpeek/endpoints/tools.py +0 -55
- {mixpeek-0.6.25.dist-info → mixpeek-0.6.26.dist-info}/METADATA +1 -1
- {mixpeek-0.6.25.dist-info → mixpeek-0.6.26.dist-info}/RECORD +6 -6
- {mixpeek-0.6.25.dist-info → mixpeek-0.6.26.dist-info}/WHEEL +0 -0
- {mixpeek-0.6.25.dist-info → mixpeek-0.6.26.dist-info}/top_level.txt +0 -0
mixpeek/endpoints/extract.py
CHANGED
@@ -5,7 +5,7 @@ class Extract:
|
|
5
5
|
self.base_url = base_url
|
6
6
|
self.headers = headers
|
7
7
|
|
8
|
-
def extract(self,
|
8
|
+
def extract(self, input: str, input_type: str, modality: str = None):
|
9
9
|
url = f"{self.base_url}extract/"
|
10
10
|
data = {
|
11
11
|
"modality": modality,
|
mixpeek/endpoints/tools.py
CHANGED
@@ -1,48 +1,4 @@
|
|
1
1
|
import requests
|
2
|
-
from magika import Magika
|
3
|
-
|
4
|
-
|
5
|
-
modality_to_content_types = {
|
6
|
-
"text": [
|
7
|
-
"application/pdf",
|
8
|
-
"text/html",
|
9
|
-
"text/html; charset=utf-8",
|
10
|
-
"text/csv",
|
11
|
-
"text/plain",
|
12
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
13
|
-
"application/vnd.ms-powerpoint",
|
14
|
-
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
15
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
16
|
-
"text/plain",
|
17
|
-
"text/markdown",
|
18
|
-
"application/xml",
|
19
|
-
],
|
20
|
-
"image": [
|
21
|
-
"image/png",
|
22
|
-
"image/jpeg",
|
23
|
-
"image/gif",
|
24
|
-
"image/bmp",
|
25
|
-
"image/tiff",
|
26
|
-
"image/webp",
|
27
|
-
],
|
28
|
-
"audio": [
|
29
|
-
"audio/mpeg",
|
30
|
-
"audio/wav",
|
31
|
-
"audio/ogg",
|
32
|
-
"audio/flac",
|
33
|
-
"audio/mp4",
|
34
|
-
"audio/aac",
|
35
|
-
"audio/mp3",
|
36
|
-
],
|
37
|
-
"video": [
|
38
|
-
"video/mp4",
|
39
|
-
"video/x-msvideo",
|
40
|
-
"video/quicktime",
|
41
|
-
"video/x-ms-wmv",
|
42
|
-
"video/x-flv",
|
43
|
-
],
|
44
|
-
}
|
45
|
-
|
46
2
|
|
47
3
|
|
48
4
|
class Tools:
|
@@ -51,17 +7,6 @@ class Tools:
|
|
51
7
|
self.headers = headers
|
52
8
|
self.video = self.Video(self)
|
53
9
|
|
54
|
-
def detect(self, url: str):
|
55
|
-
# Fetch the file from the URL
|
56
|
-
response = requests.get(url)
|
57
|
-
content_type = response.headers.get('Content-Type', '').split(';')[0] # Get the base MIME type without parameters
|
58
|
-
|
59
|
-
# Determine modality based on MIME type and Magika detection
|
60
|
-
for modality, types in modality_to_content_types.items():
|
61
|
-
if content_type in types:
|
62
|
-
return modality
|
63
|
-
return 'unknown'
|
64
|
-
|
65
10
|
class Video:
|
66
11
|
def __init__(self, parent):
|
67
12
|
self.base_url = parent.base_url
|
@@ -4,11 +4,11 @@ mixpeek/exceptions.py,sha256=Orhdo5UFLn3fcWVJtlgkznW8Iy5ndL96h0qTY8zOlDA,235
|
|
4
4
|
mixpeek/endpoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
mixpeek/endpoints/connections.py,sha256=-SdwLhHY1KNnNT9u_V2hx0kiKjYrDXKLzceedZBqa14,917
|
6
6
|
mixpeek/endpoints/embed.py,sha256=8ds_FinxZRW-ZQyv6LjDAX6Zoek2Cv4OYhwIgSBqwTs,1598
|
7
|
-
mixpeek/endpoints/extract.py,sha256=
|
7
|
+
mixpeek/endpoints/extract.py,sha256=7-d-8Mc7Uj20JyQRURoXeawpvUGvwMeBI8nwtjCYe8k,483
|
8
8
|
mixpeek/endpoints/generate.py,sha256=SFjVYfgeuIt4wO0I5ItnB4TEHhRkLgZOvQfWlEioye8,594
|
9
9
|
mixpeek/endpoints/pipelines.py,sha256=X2mRsWgOx6FgWbInrAdjLQJbjXjorNqAo9mjFawLpoE,1210
|
10
|
-
mixpeek/endpoints/tools.py,sha256=
|
11
|
-
mixpeek-0.6.
|
12
|
-
mixpeek-0.6.
|
13
|
-
mixpeek-0.6.
|
14
|
-
mixpeek-0.6.
|
10
|
+
mixpeek/endpoints/tools.py,sha256=Ni9AYm2-jpDS1SLUohNLTOkXDUxLPnNLpTlhWJLfofs,791
|
11
|
+
mixpeek-0.6.26.dist-info/METADATA,sha256=PKf1HAukMjpd1omrd6Rxxegqz9_-r-5XEZq93FUjRsE,1952
|
12
|
+
mixpeek-0.6.26.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
13
|
+
mixpeek-0.6.26.dist-info/top_level.txt,sha256=EJ8Jc4IhqyUwnUlBwKbs498Ju4O9a-IDh2kXc_lo6Vg,8
|
14
|
+
mixpeek-0.6.26.dist-info/RECORD,,
|
File without changes
|
File without changes
|