mixpeek 0.6.25__tar.gz → 0.6.26__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.
- {mixpeek-0.6.25 → mixpeek-0.6.26}/PKG-INFO +1 -1
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek/endpoints/extract.py +1 -1
- mixpeek-0.6.26/mixpeek/endpoints/tools.py +24 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek.egg-info/PKG-INFO +1 -1
- {mixpeek-0.6.25 → mixpeek-0.6.26}/setup.py +1 -1
- mixpeek-0.6.25/mixpeek/endpoints/tools.py +0 -79
- {mixpeek-0.6.25 → mixpeek-0.6.26}/MANIFEST.in +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/README.md +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek/__init__.py +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek/client.py +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek/endpoints/__init__.py +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek/endpoints/connections.py +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek/endpoints/embed.py +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek/endpoints/generate.py +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek/endpoints/pipelines.py +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek/exceptions.py +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek.egg-info/SOURCES.txt +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek.egg-info/dependency_links.txt +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek.egg-info/requires.txt +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/mixpeek.egg-info/top_level.txt +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/requirements.txt +0 -0
- {mixpeek-0.6.25 → mixpeek-0.6.26}/setup.cfg +0 -0
@@ -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,
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import requests
|
2
|
+
|
3
|
+
|
4
|
+
class Tools:
|
5
|
+
def __init__(self, base_url, headers):
|
6
|
+
self.base_url = base_url
|
7
|
+
self.headers = headers
|
8
|
+
self.video = self.Video(self)
|
9
|
+
|
10
|
+
class Video:
|
11
|
+
def __init__(self, parent):
|
12
|
+
self.base_url = parent.base_url
|
13
|
+
self.headers = parent.headers
|
14
|
+
|
15
|
+
def process(self, url: str, frame_interval: int, resolution: list, return_base64: bool):
|
16
|
+
endpoint = f"{self.base_url}tools/video/process"
|
17
|
+
data = {
|
18
|
+
"url": url,
|
19
|
+
"frame_interval": frame_interval,
|
20
|
+
"resolution": resolution,
|
21
|
+
"return_base64": return_base64
|
22
|
+
}
|
23
|
+
response = requests.post(endpoint, json=data, headers=self.headers)
|
24
|
+
return response.json()
|
@@ -1,79 +0,0 @@
|
|
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
|
-
|
47
|
-
|
48
|
-
class Tools:
|
49
|
-
def __init__(self, base_url, headers):
|
50
|
-
self.base_url = base_url
|
51
|
-
self.headers = headers
|
52
|
-
self.video = self.Video(self)
|
53
|
-
|
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
|
-
class Video:
|
66
|
-
def __init__(self, parent):
|
67
|
-
self.base_url = parent.base_url
|
68
|
-
self.headers = parent.headers
|
69
|
-
|
70
|
-
def process(self, url: str, frame_interval: int, resolution: list, return_base64: bool):
|
71
|
-
endpoint = f"{self.base_url}tools/video/process"
|
72
|
-
data = {
|
73
|
-
"url": url,
|
74
|
-
"frame_interval": frame_interval,
|
75
|
-
"resolution": resolution,
|
76
|
-
"return_base64": return_base64
|
77
|
-
}
|
78
|
-
response = requests.post(endpoint, json=data, headers=self.headers)
|
79
|
-
return response.json()
|
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
|