mixpeek 0.6.7__tar.gz → 0.6.15__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.15/PKG-INFO +68 -0
- mixpeek-0.6.15/README.md +55 -0
- mixpeek-0.6.15/mixpeek/__init__.py +1 -0
- mixpeek-0.6.15/mixpeek/client.py +21 -0
- mixpeek-0.6.15/mixpeek/endpoints/connections.py +16 -0
- mixpeek-0.6.15/mixpeek/endpoints/embed.py +50 -0
- mixpeek-0.6.15/mixpeek/endpoints/extract.py +16 -0
- mixpeek-0.6.15/mixpeek/endpoints/generate.py +17 -0
- mixpeek-0.6.15/mixpeek/endpoints/tools.py +23 -0
- mixpeek-0.6.15/mixpeek/exceptions.py +13 -0
- mixpeek-0.6.15/mixpeek.egg-info/PKG-INFO +68 -0
- mixpeek-0.6.15/mixpeek.egg-info/SOURCES.txt +15 -0
- mixpeek-0.6.15/mixpeek.egg-info/dependency_links.txt +1 -0
- mixpeek-0.6.15/mixpeek.egg-info/top_level.txt +1 -0
- mixpeek-0.6.15/setup.cfg +4 -0
- mixpeek-0.6.15/setup.py +19 -0
- mixpeek-0.6.7/LICENSE +0 -21
- mixpeek-0.6.7/PKG-INFO +0 -145
- mixpeek-0.6.7/README.md +0 -129
- mixpeek-0.6.7/pyproject.toml +0 -33
- mixpeek-0.6.7/src/mixpeek/__init__.py +0 -106
- mixpeek-0.6.7/src/mixpeek/base_client.py +0 -989
- mixpeek-0.6.7/src/mixpeek/client.py +0 -65
- mixpeek-0.6.7/src/mixpeek/core/__init__.py +0 -25
- mixpeek-0.6.7/src/mixpeek/core/api_error.py +0 -15
- mixpeek-0.6.7/src/mixpeek/core/client_wrapper.py +0 -83
- mixpeek-0.6.7/src/mixpeek/core/datetime_utils.py +0 -28
- mixpeek-0.6.7/src/mixpeek/core/file.py +0 -38
- mixpeek-0.6.7/src/mixpeek/core/http_client.py +0 -130
- mixpeek-0.6.7/src/mixpeek/core/jsonable_encoder.py +0 -103
- mixpeek-0.6.7/src/mixpeek/core/remove_none_from_dict.py +0 -11
- mixpeek-0.6.7/src/mixpeek/core/request_options.py +0 -32
- mixpeek-0.6.7/src/mixpeek/environment.py +0 -7
- mixpeek-0.6.7/src/mixpeek/errors/__init__.py +0 -17
- mixpeek-0.6.7/src/mixpeek/errors/bad_request_error.py +0 -9
- mixpeek-0.6.7/src/mixpeek/errors/forbidden_error.py +0 -9
- mixpeek-0.6.7/src/mixpeek/errors/internal_server_error.py +0 -9
- mixpeek-0.6.7/src/mixpeek/errors/not_found_error.py +0 -9
- mixpeek-0.6.7/src/mixpeek/errors/unauthorized_error.py +0 -9
- mixpeek-0.6.7/src/mixpeek/errors/unprocessable_entity_error.py +0 -9
- mixpeek-0.6.7/src/mixpeek/pipeline/__init__.py +0 -2
- mixpeek-0.6.7/src/mixpeek/pipeline/client.py +0 -474
- mixpeek-0.6.7/src/mixpeek/storage/__init__.py +0 -5
- mixpeek-0.6.7/src/mixpeek/storage/client.py +0 -145
- mixpeek-0.6.7/src/mixpeek/storage/sample/__init__.py +0 -2
- mixpeek-0.6.7/src/mixpeek/storage/sample/client.py +0 -282
- mixpeek-0.6.7/src/mixpeek/types/__init__.py +0 -81
- mixpeek-0.6.7/src/mixpeek/types/api_key.py +0 -31
- mixpeek-0.6.7/src/mixpeek/types/audio_params.py +0 -29
- mixpeek-0.6.7/src/mixpeek/types/configs_response.py +0 -42
- mixpeek-0.6.7/src/mixpeek/types/connection.py +0 -36
- mixpeek-0.6.7/src/mixpeek/types/connection_engine.py +0 -5
- mixpeek-0.6.7/src/mixpeek/types/csv_params.py +0 -29
- mixpeek-0.6.7/src/mixpeek/types/destination.py +0 -42
- mixpeek-0.6.7/src/mixpeek/types/embedding_response.py +0 -34
- mixpeek-0.6.7/src/mixpeek/types/error_message.py +0 -29
- mixpeek-0.6.7/src/mixpeek/types/error_response.py +0 -30
- mixpeek-0.6.7/src/mixpeek/types/extract_response.py +0 -35
- mixpeek-0.6.7/src/mixpeek/types/field_type.py +0 -5
- mixpeek-0.6.7/src/mixpeek/types/generation_response.py +0 -36
- mixpeek-0.6.7/src/mixpeek/types/html_params.py +0 -29
- mixpeek-0.6.7/src/mixpeek/types/http_validation_error.py +0 -30
- mixpeek-0.6.7/src/mixpeek/types/image_params.py +0 -32
- mixpeek-0.6.7/src/mixpeek/types/message.py +0 -37
- mixpeek-0.6.7/src/mixpeek/types/metadata.py +0 -32
- mixpeek-0.6.7/src/mixpeek/types/modality.py +0 -5
- mixpeek-0.6.7/src/mixpeek/types/model.py +0 -38
- mixpeek-0.6.7/src/mixpeek/types/models.py +0 -5
- mixpeek-0.6.7/src/mixpeek/types/pdf_params.py +0 -41
- mixpeek-0.6.7/src/mixpeek/types/pipeline_response.py +0 -49
- mixpeek-0.6.7/src/mixpeek/types/pipeline_task_response.py +0 -32
- mixpeek-0.6.7/src/mixpeek/types/ppt_params.py +0 -27
- mixpeek-0.6.7/src/mixpeek/types/pptx_params.py +0 -27
- mixpeek-0.6.7/src/mixpeek/types/settings.py +0 -35
- mixpeek-0.6.7/src/mixpeek/types/source.py +0 -43
- mixpeek-0.6.7/src/mixpeek/types/source_destination_mapping.py +0 -44
- mixpeek-0.6.7/src/mixpeek/types/txt_params.py +0 -27
- mixpeek-0.6.7/src/mixpeek/types/user.py +0 -36
- mixpeek-0.6.7/src/mixpeek/types/validation_error.py +0 -32
- mixpeek-0.6.7/src/mixpeek/types/validation_error_loc_item.py +0 -5
- mixpeek-0.6.7/src/mixpeek/types/video_params.py +0 -27
- mixpeek-0.6.7/src/mixpeek/types/workflow_code_response.py +0 -29
- mixpeek-0.6.7/src/mixpeek/types/workflow_response.py +0 -32
- mixpeek-0.6.7/src/mixpeek/types/workflow_settings.py +0 -30
- mixpeek-0.6.7/src/mixpeek/types/xlsx_params.py +0 -29
- mixpeek-0.6.7/src/mixpeek/user/__init__.py +0 -2
- mixpeek-0.6.7/src/mixpeek/user/client.py +0 -308
- mixpeek-0.6.7/src/mixpeek/version.py +0 -4
- mixpeek-0.6.7/src/mixpeek/workflow/__init__.py +0 -2
- mixpeek-0.6.7/src/mixpeek/workflow/client.py +0 -535
- /mixpeek-0.6.7/src/mixpeek/py.typed → /mixpeek-0.6.15/mixpeek/endpoints/__init__.py +0 -0
mixpeek-0.6.15/PKG-INFO
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: mixpeek
|
3
|
+
Version: 0.6.15
|
4
|
+
Summary: Mixpeek Python SDK
|
5
|
+
Home-page: https://github.com/mixpeek/mixpeek-python
|
6
|
+
Author: Ethan Steininger
|
7
|
+
Author-email: ethan@mixpeek.com
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Operating System :: OS Independent
|
11
|
+
Requires-Python: >=3.6
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
|
14
|
+
# Mixpeek SDK
|
15
|
+
|
16
|
+
A Python SDK for the Mixpeek API.
|
17
|
+
|
18
|
+
## Installation
|
19
|
+
|
20
|
+
```bash
|
21
|
+
pip install mixpeek
|
22
|
+
```
|
23
|
+
|
24
|
+
```python
|
25
|
+
from mixpeek import Mixpeek
|
26
|
+
from pydantic import BaseModel
|
27
|
+
|
28
|
+
mixpeek = Mixpeek("YOUR_API_KEY")
|
29
|
+
|
30
|
+
# Example usage
|
31
|
+
extraction = mixpeek.extract.text(
|
32
|
+
input="s3://document.pdf",
|
33
|
+
input_type="url"
|
34
|
+
)
|
35
|
+
|
36
|
+
embedding = mixpeek.embed.video(
|
37
|
+
model="mixpeek/vuse-generic-v1",
|
38
|
+
input="s3://waving_boy.mp4",
|
39
|
+
input_type="url"
|
40
|
+
)
|
41
|
+
|
42
|
+
class ResponseFormat(BaseModel):
|
43
|
+
city: int
|
44
|
+
weather: float
|
45
|
+
|
46
|
+
generated_content = mixpeek.generate.text(
|
47
|
+
response_format=ResponseFormat,
|
48
|
+
context="Please tell me the weather and make sure to respond in the provided JSON schema"
|
49
|
+
)
|
50
|
+
|
51
|
+
mixpeek.connections.create(
|
52
|
+
alias="my-mongo-test",
|
53
|
+
engine="mongodb",
|
54
|
+
details={
|
55
|
+
"host": "your_host_address",
|
56
|
+
"database": "your_database_name",
|
57
|
+
"username": "your_username",
|
58
|
+
"password": "your_password"
|
59
|
+
}
|
60
|
+
)
|
61
|
+
|
62
|
+
response = mixpeek.tools.video.process(
|
63
|
+
url="https://s3/video.mp4",
|
64
|
+
frame_interval=5,
|
65
|
+
resolution=[720, 1280],
|
66
|
+
return_base64=True
|
67
|
+
)
|
68
|
+
```
|
mixpeek-0.6.15/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# Mixpeek SDK
|
2
|
+
|
3
|
+
A Python SDK for the Mixpeek API.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```bash
|
8
|
+
pip install mixpeek
|
9
|
+
```
|
10
|
+
|
11
|
+
```python
|
12
|
+
from mixpeek import Mixpeek
|
13
|
+
from pydantic import BaseModel
|
14
|
+
|
15
|
+
mixpeek = Mixpeek("YOUR_API_KEY")
|
16
|
+
|
17
|
+
# Example usage
|
18
|
+
extraction = mixpeek.extract.text(
|
19
|
+
input="s3://document.pdf",
|
20
|
+
input_type="url"
|
21
|
+
)
|
22
|
+
|
23
|
+
embedding = mixpeek.embed.video(
|
24
|
+
model="mixpeek/vuse-generic-v1",
|
25
|
+
input="s3://waving_boy.mp4",
|
26
|
+
input_type="url"
|
27
|
+
)
|
28
|
+
|
29
|
+
class ResponseFormat(BaseModel):
|
30
|
+
city: int
|
31
|
+
weather: float
|
32
|
+
|
33
|
+
generated_content = mixpeek.generate.text(
|
34
|
+
response_format=ResponseFormat,
|
35
|
+
context="Please tell me the weather and make sure to respond in the provided JSON schema"
|
36
|
+
)
|
37
|
+
|
38
|
+
mixpeek.connections.create(
|
39
|
+
alias="my-mongo-test",
|
40
|
+
engine="mongodb",
|
41
|
+
details={
|
42
|
+
"host": "your_host_address",
|
43
|
+
"database": "your_database_name",
|
44
|
+
"username": "your_username",
|
45
|
+
"password": "your_password"
|
46
|
+
}
|
47
|
+
)
|
48
|
+
|
49
|
+
response = mixpeek.tools.video.process(
|
50
|
+
url="https://s3/video.mp4",
|
51
|
+
frame_interval=5,
|
52
|
+
resolution=[720, 1280],
|
53
|
+
return_base64=True
|
54
|
+
)
|
55
|
+
```
|
@@ -0,0 +1 @@
|
|
1
|
+
from .client import Mixpeek
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import requests
|
2
|
+
|
3
|
+
from .endpoints.extract import Extract
|
4
|
+
from .endpoints.embed import Embed
|
5
|
+
from .endpoints.generate import Generate
|
6
|
+
from .endpoints.connections import Connections
|
7
|
+
from .endpoints.tools import Tools
|
8
|
+
|
9
|
+
class Mixpeek:
|
10
|
+
def __init__(self, api_key: str):
|
11
|
+
self.api_key = api_key
|
12
|
+
self.base_url = "https://api.mixpeek.com/"
|
13
|
+
self.headers = {
|
14
|
+
"Authorization": f"Bearer {self.api_key}",
|
15
|
+
"Content-Type": "application/json"
|
16
|
+
}
|
17
|
+
self.extract = Extract(self.base_url, self.headers)
|
18
|
+
self.embed = Embed(self.base_url, self.headers)
|
19
|
+
self.generate = Generate(self.base_url, self.headers)
|
20
|
+
self.connections = Connections(self.base_url, self.headers)
|
21
|
+
self.tools = Tools(self.base_url, self.headers)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import requests
|
2
|
+
|
3
|
+
class Connections:
|
4
|
+
def __init__(self, base_url, headers):
|
5
|
+
self.base_url = base_url
|
6
|
+
self.headers = headers
|
7
|
+
|
8
|
+
def create(self, alias: str, engine: str, details: dict):
|
9
|
+
url = f"{self.base_url}connections/"
|
10
|
+
data = {
|
11
|
+
"alias": alias,
|
12
|
+
"engine": engine,
|
13
|
+
"details": details
|
14
|
+
}
|
15
|
+
response = requests.post(url, json=data, headers=self.headers)
|
16
|
+
return response.json()
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import requests
|
2
|
+
|
3
|
+
class Embed:
|
4
|
+
def __init__(self, base_url, headers):
|
5
|
+
self.base_url = base_url
|
6
|
+
self.headers = headers
|
7
|
+
|
8
|
+
def video(self, model: str, input: str, input_type: str):
|
9
|
+
url = f"{self.base_url}embed/"
|
10
|
+
data = {
|
11
|
+
"modality": "video",
|
12
|
+
"model": model,
|
13
|
+
"input": input,
|
14
|
+
"input_type": input_type
|
15
|
+
}
|
16
|
+
response = requests.post(url, json=data, headers=self.headers)
|
17
|
+
return response.json()
|
18
|
+
|
19
|
+
def text(self, model: str, input: str, input_type: str):
|
20
|
+
url = f"{self.base_url}embed/"
|
21
|
+
data = {
|
22
|
+
"modality": "text",
|
23
|
+
"model": model,
|
24
|
+
"input": input,
|
25
|
+
"input_type": input_type
|
26
|
+
}
|
27
|
+
response = requests.post(url, json=data, headers=self.headers)
|
28
|
+
return response.json()
|
29
|
+
|
30
|
+
def image(self, model: str, input: str, input_type: str):
|
31
|
+
url = f"{self.base_url}embed/"
|
32
|
+
data = {
|
33
|
+
"modality": "image",
|
34
|
+
"model": model,
|
35
|
+
"input": input,
|
36
|
+
"input_type": input_type
|
37
|
+
}
|
38
|
+
response = requests.post(url, json=data, headers=self.headers)
|
39
|
+
return response.json()
|
40
|
+
|
41
|
+
def audio(self, model: str, input: str, input_type: str):
|
42
|
+
url = f"{self.base_url}embed/"
|
43
|
+
data = {
|
44
|
+
"modality": "audio",
|
45
|
+
"model": model,
|
46
|
+
"input": input,
|
47
|
+
"input_type": input_type
|
48
|
+
}
|
49
|
+
response = requests.post(url, json=data, headers=self.headers)
|
50
|
+
return response.json()
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import requests
|
2
|
+
|
3
|
+
class Extract:
|
4
|
+
def __init__(self, base_url, headers):
|
5
|
+
self.base_url = base_url
|
6
|
+
self.headers = headers
|
7
|
+
|
8
|
+
def extract(self, modality: str, input: str, input_type: str):
|
9
|
+
url = f"{self.base_url}extract/"
|
10
|
+
data = {
|
11
|
+
"modality": modality,
|
12
|
+
"input": input,
|
13
|
+
"input_type": input_type
|
14
|
+
}
|
15
|
+
response = requests.post(url, json=data, headers=self.headers)
|
16
|
+
return response.json()
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import requests
|
2
|
+
from pydantic import BaseModel
|
3
|
+
|
4
|
+
class Generate:
|
5
|
+
def __init__(self, base_url, headers):
|
6
|
+
self.base_url = base_url
|
7
|
+
self.headers = headers
|
8
|
+
|
9
|
+
def generate(self, response_format: BaseModel, context: str):
|
10
|
+
url = f"{self.base_url}generate/text"
|
11
|
+
data = {
|
12
|
+
"response_format": response_format.model_json_schema(),
|
13
|
+
"context": context
|
14
|
+
}
|
15
|
+
response = requests.post(url, json=data, headers=self.headers)
|
16
|
+
return response.json()
|
17
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import requests
|
2
|
+
|
3
|
+
class Tools:
|
4
|
+
def __init__(self, base_url, headers):
|
5
|
+
self.base_url = base_url
|
6
|
+
self.headers = headers
|
7
|
+
self.video = self.Video(self)
|
8
|
+
|
9
|
+
class Video:
|
10
|
+
def __init__(self, parent):
|
11
|
+
self.base_url = parent.base_url
|
12
|
+
self.headers = parent.headers
|
13
|
+
|
14
|
+
def process(self, url: str, frame_interval: int, resolution: list, return_base64: bool):
|
15
|
+
endpoint = f"{self.base_url}tools/video/process"
|
16
|
+
data = {
|
17
|
+
"url": url,
|
18
|
+
"frame_interval": frame_interval,
|
19
|
+
"resolution": resolution,
|
20
|
+
"use_base64": return_base64
|
21
|
+
}
|
22
|
+
response = requests.post(endpoint, json=data, headers=self.headers)
|
23
|
+
return response.json()
|
@@ -0,0 +1,68 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: mixpeek
|
3
|
+
Version: 0.6.15
|
4
|
+
Summary: Mixpeek Python SDK
|
5
|
+
Home-page: https://github.com/mixpeek/mixpeek-python
|
6
|
+
Author: Ethan Steininger
|
7
|
+
Author-email: ethan@mixpeek.com
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Operating System :: OS Independent
|
11
|
+
Requires-Python: >=3.6
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
|
14
|
+
# Mixpeek SDK
|
15
|
+
|
16
|
+
A Python SDK for the Mixpeek API.
|
17
|
+
|
18
|
+
## Installation
|
19
|
+
|
20
|
+
```bash
|
21
|
+
pip install mixpeek
|
22
|
+
```
|
23
|
+
|
24
|
+
```python
|
25
|
+
from mixpeek import Mixpeek
|
26
|
+
from pydantic import BaseModel
|
27
|
+
|
28
|
+
mixpeek = Mixpeek("YOUR_API_KEY")
|
29
|
+
|
30
|
+
# Example usage
|
31
|
+
extraction = mixpeek.extract.text(
|
32
|
+
input="s3://document.pdf",
|
33
|
+
input_type="url"
|
34
|
+
)
|
35
|
+
|
36
|
+
embedding = mixpeek.embed.video(
|
37
|
+
model="mixpeek/vuse-generic-v1",
|
38
|
+
input="s3://waving_boy.mp4",
|
39
|
+
input_type="url"
|
40
|
+
)
|
41
|
+
|
42
|
+
class ResponseFormat(BaseModel):
|
43
|
+
city: int
|
44
|
+
weather: float
|
45
|
+
|
46
|
+
generated_content = mixpeek.generate.text(
|
47
|
+
response_format=ResponseFormat,
|
48
|
+
context="Please tell me the weather and make sure to respond in the provided JSON schema"
|
49
|
+
)
|
50
|
+
|
51
|
+
mixpeek.connections.create(
|
52
|
+
alias="my-mongo-test",
|
53
|
+
engine="mongodb",
|
54
|
+
details={
|
55
|
+
"host": "your_host_address",
|
56
|
+
"database": "your_database_name",
|
57
|
+
"username": "your_username",
|
58
|
+
"password": "your_password"
|
59
|
+
}
|
60
|
+
)
|
61
|
+
|
62
|
+
response = mixpeek.tools.video.process(
|
63
|
+
url="https://s3/video.mp4",
|
64
|
+
frame_interval=5,
|
65
|
+
resolution=[720, 1280],
|
66
|
+
return_base64=True
|
67
|
+
)
|
68
|
+
```
|
@@ -0,0 +1,15 @@
|
|
1
|
+
README.md
|
2
|
+
setup.py
|
3
|
+
mixpeek/__init__.py
|
4
|
+
mixpeek/client.py
|
5
|
+
mixpeek/exceptions.py
|
6
|
+
mixpeek.egg-info/PKG-INFO
|
7
|
+
mixpeek.egg-info/SOURCES.txt
|
8
|
+
mixpeek.egg-info/dependency_links.txt
|
9
|
+
mixpeek.egg-info/top_level.txt
|
10
|
+
mixpeek/endpoints/__init__.py
|
11
|
+
mixpeek/endpoints/connections.py
|
12
|
+
mixpeek/endpoints/embed.py
|
13
|
+
mixpeek/endpoints/extract.py
|
14
|
+
mixpeek/endpoints/generate.py
|
15
|
+
mixpeek/endpoints/tools.py
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
mixpeek
|
mixpeek-0.6.15/setup.cfg
ADDED
mixpeek-0.6.15/setup.py
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
from setuptools import setup, find_packages
|
2
|
+
|
3
|
+
setup(
|
4
|
+
name='mixpeek',
|
5
|
+
version='0.6.15',
|
6
|
+
author='Ethan Steininger',
|
7
|
+
author_email='ethan@mixpeek.com',
|
8
|
+
description='Mixpeek Python SDK',
|
9
|
+
long_description=open('README.md').read(),
|
10
|
+
long_description_content_type='text/markdown',
|
11
|
+
url='https://github.com/mixpeek/mixpeek-python',
|
12
|
+
packages=find_packages(),
|
13
|
+
classifiers=[
|
14
|
+
'Programming Language :: Python :: 3',
|
15
|
+
'License :: OSI Approved :: MIT License',
|
16
|
+
'Operating System :: OS Independent',
|
17
|
+
],
|
18
|
+
python_requires='>=3.6',
|
19
|
+
)
|
mixpeek-0.6.7/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2024 Mixpeek.
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
mixpeek-0.6.7/PKG-INFO
DELETED
@@ -1,145 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: mixpeek
|
3
|
-
Version: 0.6.7
|
4
|
-
Summary:
|
5
|
-
Requires-Python: >=3.8,<4.0
|
6
|
-
Classifier: Programming Language :: Python :: 3
|
7
|
-
Classifier: Programming Language :: Python :: 3.8
|
8
|
-
Classifier: Programming Language :: Python :: 3.9
|
9
|
-
Classifier: Programming Language :: Python :: 3.10
|
10
|
-
Classifier: Programming Language :: Python :: 3.11
|
11
|
-
Requires-Dist: httpx (>=0.21.2)
|
12
|
-
Requires-Dist: pydantic (>=1.9.2)
|
13
|
-
Requires-Dist: typing_extensions (>=4.0.0)
|
14
|
-
Description-Content-Type: text/markdown
|
15
|
-
|
16
|
-
# Mixpeek Python Library
|
17
|
-
|
18
|
-
[](https://github.com/fern-api/fern)
|
19
|
-
|
20
|
-
The Mixpeek Python Library provides convenient access to the Mixpeek API from applications written in Python.
|
21
|
-
|
22
|
-
## Installation
|
23
|
-
Add this dependency to your project's build file:
|
24
|
-
|
25
|
-
```bash
|
26
|
-
pip install mixpeek
|
27
|
-
# or
|
28
|
-
poetry add mixpeek
|
29
|
-
```
|
30
|
-
|
31
|
-
## Usage
|
32
|
-
Simply import `Mixpeek` and start making calls to our API.
|
33
|
-
|
34
|
-
```python
|
35
|
-
from mixpeek.client import Mixpeek
|
36
|
-
|
37
|
-
client = Mixpeek(
|
38
|
-
api_key="..."
|
39
|
-
)
|
40
|
-
```
|
41
|
-
|
42
|
-
## Async Client
|
43
|
-
|
44
|
-
The SDK also exports an async client so that you can make non-blocking
|
45
|
-
calls to our API.
|
46
|
-
|
47
|
-
```python
|
48
|
-
from mixpeek.client import AsymcMixpeek
|
49
|
-
|
50
|
-
client = AsyncMixpeek(
|
51
|
-
api_key="..."
|
52
|
-
)
|
53
|
-
```
|
54
|
-
|
55
|
-
## Exception Handling
|
56
|
-
All errors thrown by the SDK will be subclasses of [`ApiError`](./src/mixpeek/core/api_error.py).
|
57
|
-
|
58
|
-
```python
|
59
|
-
import mixpeek
|
60
|
-
|
61
|
-
try:
|
62
|
-
client.search(...)
|
63
|
-
except mixpeek.core.ApiError as e: # Handle all errors
|
64
|
-
print(e.status_code)
|
65
|
-
print(e.body)
|
66
|
-
```
|
67
|
-
|
68
|
-
## Advanced
|
69
|
-
|
70
|
-
### Retries
|
71
|
-
The Mixpeek SDK is instrumented with automatic retries with exponential backoff. A request will be
|
72
|
-
retried as long as the request is deemed retriable and the number of retry attempts has not grown larger
|
73
|
-
than the configured retry limit.
|
74
|
-
|
75
|
-
A request is deemed retriable when any of the following HTTP status codes is returned:
|
76
|
-
|
77
|
-
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
78
|
-
- [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
|
79
|
-
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
80
|
-
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
81
|
-
|
82
|
-
Use the `max_retries` request option to configure this behavior.
|
83
|
-
|
84
|
-
```python
|
85
|
-
from mixpeek.client import Mixpeek
|
86
|
-
|
87
|
-
client = Mixpeek(...)
|
88
|
-
|
89
|
-
# Override retries for a specific method
|
90
|
-
client.search(..., {
|
91
|
-
max_retries=5
|
92
|
-
})
|
93
|
-
```
|
94
|
-
|
95
|
-
### Timeouts
|
96
|
-
By default, requests time out after 60 seconds. You can configure this with a
|
97
|
-
timeout option at the client or request level.
|
98
|
-
|
99
|
-
```python
|
100
|
-
from mixpeek.client import Mixpeek
|
101
|
-
|
102
|
-
client = Mixpeek(
|
103
|
-
# All timeouts are 20 seconds
|
104
|
-
timeout=20.0,
|
105
|
-
)
|
106
|
-
|
107
|
-
# Override timeout for a specific method
|
108
|
-
client.search(..., {
|
109
|
-
timeout_in_seconds=20.0
|
110
|
-
})
|
111
|
-
```
|
112
|
-
|
113
|
-
### Custom HTTP client
|
114
|
-
You can override the httpx client to customize it for your use-case. Some common use-cases
|
115
|
-
include support for proxies and transports.
|
116
|
-
|
117
|
-
```python
|
118
|
-
import httpx
|
119
|
-
|
120
|
-
from mixpeek.client import Mixpeek
|
121
|
-
|
122
|
-
client = Mixpeek(
|
123
|
-
http_client=httpx.Client(
|
124
|
-
proxies="http://my.test.proxy.example.com",
|
125
|
-
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
126
|
-
),
|
127
|
-
)
|
128
|
-
```
|
129
|
-
|
130
|
-
## Beta Status
|
131
|
-
|
132
|
-
This SDK is in beta, and there may be breaking changes between versions without a major
|
133
|
-
version update. Therefore, we recommend pinning the package version to a specific version.
|
134
|
-
This way, you can install the same version each time without breaking changes.
|
135
|
-
|
136
|
-
## Contributing
|
137
|
-
|
138
|
-
While we value open-source contributions to this SDK, this library is generated programmatically.
|
139
|
-
Additions made directly to this library would have to be moved over to our generation code,
|
140
|
-
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
141
|
-
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
142
|
-
an issue first to discuss with us!
|
143
|
-
|
144
|
-
On the other hand, contributions to the README are always very welcome!
|
145
|
-
|