mixpeek 0.1.2__tar.gz → 0.5__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.5/LICENSE.rst +20 -0
- mixpeek-0.5/MANIFEST.in +1 -0
- mixpeek-0.5/PKG-INFO +11 -0
- mixpeek-0.5/README.md +196 -0
- mixpeek-0.5/mixpeek/__init__.py +86 -0
- mixpeek-0.5/mixpeek.egg-info/PKG-INFO +11 -0
- mixpeek-0.5/mixpeek.egg-info/SOURCES.txt +12 -0
- mixpeek-0.5/mixpeek.egg-info/dependency_links.txt +1 -0
- mixpeek-0.5/mixpeek.egg-info/requires.txt +1 -0
- mixpeek-0.5/mixpeek.egg-info/top_level.txt +1 -0
- mixpeek-0.5/pyproject.toml +20 -0
- mixpeek-0.5/setup.cfg +8 -0
- mixpeek-0.5/setup.py +15 -0
- mixpeek-0.1.2/PKG-INFO +0 -439
- mixpeek-0.1.2/README-PYPI.md +0 -415
- mixpeek-0.1.2/py.typed +0 -1
- mixpeek-0.1.2/pyproject.toml +0 -55
- mixpeek-0.1.2/src/mixpeek/__init__.py +0 -9
- mixpeek-0.1.2/src/mixpeek/_hooks/__init__.py +0 -5
- mixpeek-0.1.2/src/mixpeek/_hooks/registration.py +0 -13
- mixpeek-0.1.2/src/mixpeek/_hooks/sdkhooks.py +0 -76
- mixpeek-0.1.2/src/mixpeek/_hooks/types.py +0 -94
- mixpeek-0.1.2/src/mixpeek/_version.py +0 -12
- mixpeek-0.1.2/src/mixpeek/assets.py +0 -1561
- mixpeek-0.1.2/src/mixpeek/basesdk.py +0 -350
- mixpeek-0.1.2/src/mixpeek/collections.py +0 -1029
- mixpeek-0.1.2/src/mixpeek/featureextractors.py +0 -205
- mixpeek-0.1.2/src/mixpeek/features.py +0 -1181
- mixpeek-0.1.2/src/mixpeek/health.py +0 -167
- mixpeek-0.1.2/src/mixpeek/httpclient.py +0 -84
- mixpeek-0.1.2/src/mixpeek/ingest.py +0 -831
- mixpeek-0.1.2/src/mixpeek/interactions.py +0 -221
- mixpeek-0.1.2/src/mixpeek/models/__init__.py +0 -751
- mixpeek-0.1.2/src/mixpeek/models/actionusage.py +0 -16
- mixpeek-0.1.2/src/mixpeek/models/apierror.py +0 -22
- mixpeek-0.1.2/src/mixpeek/models/apikey.py +0 -25
- mixpeek-0.1.2/src/mixpeek/models/apikeyupdate.py +0 -49
- mixpeek-0.1.2/src/mixpeek/models/assetfeatures.py +0 -55
- mixpeek-0.1.2/src/mixpeek/models/assetresponse.py +0 -166
- mixpeek-0.1.2/src/mixpeek/models/assets_model_searchquery.py +0 -21
- mixpeek-0.1.2/src/mixpeek/models/assetupdate.py +0 -28
- mixpeek-0.1.2/src/mixpeek/models/availableindexesresponse.py +0 -23
- mixpeek-0.1.2/src/mixpeek/models/availablemodels.py +0 -12
- mixpeek-0.1.2/src/mixpeek/models/boolindexparams.py +0 -18
- mixpeek-0.1.2/src/mixpeek/models/collectionmodel.py +0 -70
- mixpeek-0.1.2/src/mixpeek/models/collectionresult.py +0 -73
- mixpeek-0.1.2/src/mixpeek/models/create_api_key_organizations_users_user_email_api_keys_postop.py +0 -23
- mixpeek-0.1.2/src/mixpeek/models/create_collection_collections_postop.py +0 -62
- mixpeek-0.1.2/src/mixpeek/models/create_interaction_features_search_interactions_postop.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/createcollectionrequest.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/createnamespacerequest.py +0 -62
- mixpeek-0.1.2/src/mixpeek/models/datetimeindexparams.py +0 -18
- mixpeek-0.1.2/src/mixpeek/models/dateusage.py +0 -22
- mixpeek-0.1.2/src/mixpeek/models/db_model_paginationresponse.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/db_model_taskresponse.py +0 -20
- mixpeek-0.1.2/src/mixpeek/models/delete_api_key_organizations_users_user_email_api_keys_key_name_deleteop.py +0 -23
- mixpeek-0.1.2/src/mixpeek/models/delete_asset_assets_asset_id_deleteop.py +0 -57
- mixpeek-0.1.2/src/mixpeek/models/delete_collection_collections_collection_deleteop.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/delete_feature_features_feature_id_deleteop.py +0 -57
- mixpeek-0.1.2/src/mixpeek/models/delete_interaction_features_search_interactions_interaction_id_deleteop.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/delete_namespace_namespaces_namespace_deleteop.py +0 -18
- mixpeek-0.1.2/src/mixpeek/models/delete_user_organizations_users_user_email_deleteop.py +0 -16
- mixpeek-0.1.2/src/mixpeek/models/denseembedding.py +0 -16
- mixpeek-0.1.2/src/mixpeek/models/embeddingrequest.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/embeddingresponse.py +0 -64
- mixpeek-0.1.2/src/mixpeek/models/errormessage.py +0 -13
- mixpeek-0.1.2/src/mixpeek/models/errorresponse.py +0 -21
- mixpeek-0.1.2/src/mixpeek/models/facedetectsettings.py +0 -52
- mixpeek-0.1.2/src/mixpeek/models/featureextractionembeddingrequest.py +0 -54
- mixpeek-0.1.2/src/mixpeek/models/featureresponse.py +0 -74
- mixpeek-0.1.2/src/mixpeek/models/features_model_paginationresponse.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/featureupdaterequest.py +0 -21
- mixpeek-0.1.2/src/mixpeek/models/filtercondition.py +0 -74
- mixpeek-0.1.2/src/mixpeek/models/floatindexparams.py +0 -18
- mixpeek-0.1.2/src/mixpeek/models/full_asset_update_assets_asset_id_putop.py +0 -69
- mixpeek-0.1.2/src/mixpeek/models/full_feature_update_features_feature_id_putop.py +0 -69
- mixpeek-0.1.2/src/mixpeek/models/geoindexparams.py +0 -18
- mixpeek-0.1.2/src/mixpeek/models/get_asset_assets_asset_id_getop.py +0 -73
- mixpeek-0.1.2/src/mixpeek/models/get_asset_with_features_assets_asset_id_features_getop.py +0 -73
- mixpeek-0.1.2/src/mixpeek/models/get_collection_collections_collection_getop.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/get_feature_features_feature_id_getop.py +0 -70
- mixpeek-0.1.2/src/mixpeek/models/get_interaction_features_search_interactions_interaction_id_getop.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/get_namespace_namespaces_namespace_getop.py +0 -18
- mixpeek-0.1.2/src/mixpeek/models/get_task_tasks_task_id_getop.py +0 -57
- mixpeek-0.1.2/src/mixpeek/models/get_user_organizations_users_user_email_getop.py +0 -16
- mixpeek-0.1.2/src/mixpeek/models/groupbyoptions.py +0 -71
- mixpeek-0.1.2/src/mixpeek/models/groupbyoptionsasset.py +0 -71
- mixpeek-0.1.2/src/mixpeek/models/groupedassetdata.py +0 -18
- mixpeek-0.1.2/src/mixpeek/models/healthcheckresponse.py +0 -13
- mixpeek-0.1.2/src/mixpeek/models/httpvalidationerror.py +0 -21
- mixpeek-0.1.2/src/mixpeek/models/imagedescribesettings.py +0 -82
- mixpeek-0.1.2/src/mixpeek/models/imagedetectsettings.py +0 -53
- mixpeek-0.1.2/src/mixpeek/models/imagereadsettings.py +0 -71
- mixpeek-0.1.2/src/mixpeek/models/imagesettings.py +0 -79
- mixpeek-0.1.2/src/mixpeek/models/ingest_image_url_ingest_images_url_postop.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/ingest_text_ingest_text_postop.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/ingest_video_url_ingest_videos_url_postop.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/inputtype.py +0 -11
- mixpeek-0.1.2/src/mixpeek/models/integerindexparams.py +0 -24
- mixpeek-0.1.2/src/mixpeek/models/interactionresponse.py +0 -87
- mixpeek-0.1.2/src/mixpeek/models/interactiontype.py +0 -11
- mixpeek-0.1.2/src/mixpeek/models/jsonimageoutputsettings.py +0 -55
- mixpeek-0.1.2/src/mixpeek/models/jsontextoutputsettings.py +0 -55
- mixpeek-0.1.2/src/mixpeek/models/jsonvideooutputsettings.py +0 -55
- mixpeek-0.1.2/src/mixpeek/models/keywordindexparams.py +0 -21
- mixpeek-0.1.2/src/mixpeek/models/kill_task_tasks_task_id_deleteop.py +0 -57
- mixpeek-0.1.2/src/mixpeek/models/list_assets_assets_postop.py +0 -77
- mixpeek-0.1.2/src/mixpeek/models/list_collections_collections_getop.py +0 -65
- mixpeek-0.1.2/src/mixpeek/models/list_features_features_postop.py +0 -79
- mixpeek-0.1.2/src/mixpeek/models/list_interactions_features_search_interactions_getop.py +0 -96
- mixpeek-0.1.2/src/mixpeek/models/listassetsrequest.py +0 -75
- mixpeek-0.1.2/src/mixpeek/models/listassetsresponse.py +0 -22
- mixpeek-0.1.2/src/mixpeek/models/listcollectionsresponse.py +0 -22
- mixpeek-0.1.2/src/mixpeek/models/listfeaturesrequest.py +0 -77
- mixpeek-0.1.2/src/mixpeek/models/listfeaturesresponse.py +0 -22
- mixpeek-0.1.2/src/mixpeek/models/logicaloperator_input.py +0 -88
- mixpeek-0.1.2/src/mixpeek/models/logicaloperator_output.py +0 -103
- mixpeek-0.1.2/src/mixpeek/models/logodetectsettings.py +0 -52
- mixpeek-0.1.2/src/mixpeek/models/modality.py +0 -13
- mixpeek-0.1.2/src/mixpeek/models/modeldetails.py +0 -57
- mixpeek-0.1.2/src/mixpeek/models/namespaceresponse.py +0 -54
- mixpeek-0.1.2/src/mixpeek/models/organizationmodel.py +0 -45
- mixpeek-0.1.2/src/mixpeek/models/partial_asset_update_assets_asset_id_patchop.py +0 -69
- mixpeek-0.1.2/src/mixpeek/models/payloadindexconfig.py +0 -94
- mixpeek-0.1.2/src/mixpeek/models/payloadindextype.py +0 -17
- mixpeek-0.1.2/src/mixpeek/models/payloadschematype.py +0 -15
- mixpeek-0.1.2/src/mixpeek/models/percolaterequest.py +0 -57
- mixpeek-0.1.2/src/mixpeek/models/permission.py +0 -10
- mixpeek-0.1.2/src/mixpeek/models/processimageurlinput.py +0 -99
- mixpeek-0.1.2/src/mixpeek/models/processtextinput.py +0 -94
- mixpeek-0.1.2/src/mixpeek/models/processvideourlinput.py +0 -99
- mixpeek-0.1.2/src/mixpeek/models/querysettings.py +0 -56
- mixpeek-0.1.2/src/mixpeek/models/rerankingoptions.py +0 -47
- mixpeek-0.1.2/src/mixpeek/models/search_assets_assets_search_postop.py +0 -59
- mixpeek-0.1.2/src/mixpeek/models/search_features_features_search_postop.py +0 -96
- mixpeek-0.1.2/src/mixpeek/models/search_model_searchquery_input.py +0 -76
- mixpeek-0.1.2/src/mixpeek/models/searchassetsrequest.py +0 -78
- mixpeek-0.1.2/src/mixpeek/models/searchinteraction.py +0 -82
- mixpeek-0.1.2/src/mixpeek/models/searchquery_output.py +0 -79
- mixpeek-0.1.2/src/mixpeek/models/searchrequestfeatures_input.py +0 -151
- mixpeek-0.1.2/src/mixpeek/models/searchrequestfeatures_output.py +0 -151
- mixpeek-0.1.2/src/mixpeek/models/sortoption.py +0 -28
- mixpeek-0.1.2/src/mixpeek/models/sparseembedding.py +0 -21
- mixpeek-0.1.2/src/mixpeek/models/tasks_model_taskresponse.py +0 -24
- mixpeek-0.1.2/src/mixpeek/models/taskstatus.py +0 -16
- mixpeek-0.1.2/src/mixpeek/models/textindexparams.py +0 -31
- mixpeek-0.1.2/src/mixpeek/models/textsettings.py +0 -61
- mixpeek-0.1.2/src/mixpeek/models/tokenizertype.py +0 -11
- mixpeek-0.1.2/src/mixpeek/models/update_api_key_organizations_users_user_email_api_keys_key_name_patchop.py +0 -30
- mixpeek-0.1.2/src/mixpeek/models/update_collection_collections_collection_putop.py +0 -74
- mixpeek-0.1.2/src/mixpeek/models/update_namespace_namespaces_namespace_putop.py +0 -28
- mixpeek-0.1.2/src/mixpeek/models/updateassetrequest.py +0 -60
- mixpeek-0.1.2/src/mixpeek/models/updatenamespacerequest.py +0 -26
- mixpeek-0.1.2/src/mixpeek/models/usage.py +0 -18
- mixpeek-0.1.2/src/mixpeek/models/usermodel_input.py +0 -36
- mixpeek-0.1.2/src/mixpeek/models/usermodel_output.py +0 -36
- mixpeek-0.1.2/src/mixpeek/models/uuidindexparams.py +0 -21
- mixpeek-0.1.2/src/mixpeek/models/validationerror.py +0 -26
- mixpeek-0.1.2/src/mixpeek/models/vectormodel.py +0 -11
- mixpeek-0.1.2/src/mixpeek/models/vectortype.py +0 -9
- mixpeek-0.1.2/src/mixpeek/models/videodescribesettings.py +0 -82
- mixpeek-0.1.2/src/mixpeek/models/videodetectsettings.py +0 -53
- mixpeek-0.1.2/src/mixpeek/models/videoreadsettings.py +0 -71
- mixpeek-0.1.2/src/mixpeek/models/videosettings.py +0 -101
- mixpeek-0.1.2/src/mixpeek/models/videotranscriptionsettings.py +0 -69
- mixpeek-0.1.2/src/mixpeek/namespaces.py +0 -1143
- mixpeek-0.1.2/src/mixpeek/organizations.py +0 -1508
- mixpeek-0.1.2/src/mixpeek/py.typed +0 -1
- mixpeek-0.1.2/src/mixpeek/sdk.py +0 -135
- mixpeek-0.1.2/src/mixpeek/sdkconfiguration.py +0 -45
- mixpeek-0.1.2/src/mixpeek/searchinteractions.py +0 -647
- mixpeek-0.1.2/src/mixpeek/tasks.py +0 -387
- mixpeek-0.1.2/src/mixpeek/types/__init__.py +0 -21
- mixpeek-0.1.2/src/mixpeek/types/basemodel.py +0 -39
- mixpeek-0.1.2/src/mixpeek/utils/__init__.py +0 -97
- mixpeek-0.1.2/src/mixpeek/utils/annotations.py +0 -55
- mixpeek-0.1.2/src/mixpeek/utils/enums.py +0 -34
- mixpeek-0.1.2/src/mixpeek/utils/eventstreaming.py +0 -238
- mixpeek-0.1.2/src/mixpeek/utils/forms.py +0 -202
- mixpeek-0.1.2/src/mixpeek/utils/headers.py +0 -136
- mixpeek-0.1.2/src/mixpeek/utils/logger.py +0 -27
- mixpeek-0.1.2/src/mixpeek/utils/metadata.py +0 -118
- mixpeek-0.1.2/src/mixpeek/utils/queryparams.py +0 -205
- mixpeek-0.1.2/src/mixpeek/utils/requestbodies.py +0 -66
- mixpeek-0.1.2/src/mixpeek/utils/retries.py +0 -217
- mixpeek-0.1.2/src/mixpeek/utils/security.py +0 -174
- mixpeek-0.1.2/src/mixpeek/utils/serializers.py +0 -215
- mixpeek-0.1.2/src/mixpeek/utils/url.py +0 -155
- mixpeek-0.1.2/src/mixpeek/utils/values.py +0 -134
mixpeek-0.5/LICENSE.rst
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright (c) 2021 mixpeek
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
18
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
19
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
20
|
+
OR OTHER DEALINGS IN THE SOFTWARE.
|
mixpeek-0.5/MANIFEST.in
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
include homograph/homographs.json
|
mixpeek-0.5/PKG-INFO
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: mixpeek
|
3
|
+
Version: 0.5
|
4
|
+
Summary: full-text file search API
|
5
|
+
Home-page: https://github.com/mixpeek/mixpeek-python
|
6
|
+
Author: Ethan Steininger
|
7
|
+
Author-email: info@mixpeek.com
|
8
|
+
License: MIT
|
9
|
+
Keywords: file search
|
10
|
+
License-File: LICENSE.rst
|
11
|
+
Requires-Dist: requests
|
mixpeek-0.5/README.md
ADDED
@@ -0,0 +1,196 @@
|
|
1
|
+
# Mixpeek
|
2
|
+
|
3
|
+
Mixpeek let's you run full-text-search on your files
|
4
|
+
|
5
|
+
**Stuff you might be looking for**:
|
6
|
+
|
7
|
+
- [API Documentation](https://docs.mixpeek.com)
|
8
|
+
- [Installing Mixpeek](https://github.com/mixpeek/mixpeek-python#installation)
|
9
|
+
- [S3 Support](https://github.com/mixpeek/mixpeek-python#s3-support)
|
10
|
+
- [Bugs & Questions](https://github.com/mixpeek/mixpeek-python#bugs-&-questions)
|
11
|
+
|
12
|
+
## Quickstart
|
13
|
+
|
14
|
+
Upload any filetype from the supported filetype [list here](https://mixpeek.com/learn)
|
15
|
+
|
16
|
+
```python
|
17
|
+
from mixpeek import Mixpeek
|
18
|
+
|
19
|
+
mix = Mixpeek(api_key="API_KEY")
|
20
|
+
|
21
|
+
# index one local pdf document without any extra metadata
|
22
|
+
mix.index("/user/desktop/file.pdf")
|
23
|
+
|
24
|
+
# with extra metadata
|
25
|
+
mix.index(
|
26
|
+
"/user/desktop/file.pdf",
|
27
|
+
user_id="123",
|
28
|
+
tags="document, legal",
|
29
|
+
static_file_url="cdn.host.com/file.pdf",
|
30
|
+
save=True,
|
31
|
+
description="this is a cat"
|
32
|
+
)
|
33
|
+
```
|
34
|
+
|
35
|
+
...or any audio filetype
|
36
|
+
|
37
|
+
```python
|
38
|
+
mix.index("/user/desktop/never_gonna_give_you_up.mp3")
|
39
|
+
```
|
40
|
+
|
41
|
+
... or an image, video, document or [anything else mixpeek supports](https://mixpeek.com/learn)
|
42
|
+
|
43
|
+
```python
|
44
|
+
video = mix.index("/user/desktop/video.avi")
|
45
|
+
image = mix.index("/user/desktop/image.png")
|
46
|
+
markdown = mix.index("/user/desktop/markdown.md")
|
47
|
+
```
|
48
|
+
|
49
|
+
The API will return the `file_id`, be sure to store this:
|
50
|
+
|
51
|
+
```python
|
52
|
+
# response
|
53
|
+
{
|
54
|
+
"file_id": "63a32cca0de5e4ce354a4b1c"
|
55
|
+
}
|
56
|
+
```
|
57
|
+
|
58
|
+
Now you can search across all your files:
|
59
|
+
|
60
|
+
```python
|
61
|
+
mix.search(query="let you down")
|
62
|
+
|
63
|
+
# response
|
64
|
+
[
|
65
|
+
{
|
66
|
+
"file_id": "6377c98b3c4f239f17663d79",
|
67
|
+
"filename": "prescription.pdf",
|
68
|
+
"importance": "100%",
|
69
|
+
"static_file_url": "s3://audio.mp3"
|
70
|
+
}
|
71
|
+
]
|
72
|
+
|
73
|
+
```
|
74
|
+
|
75
|
+
And you can include other parameters in your search query:
|
76
|
+
|
77
|
+
```python
|
78
|
+
mix.search(
|
79
|
+
"readme",
|
80
|
+
user_id="john_smith_123",
|
81
|
+
context="true",
|
82
|
+
tags="legal, document"
|
83
|
+
)
|
84
|
+
|
85
|
+
# response
|
86
|
+
[
|
87
|
+
{
|
88
|
+
"file_id": "63a32cd70de5e4ce354a4b1f",
|
89
|
+
"filename": "system-design-primer.md",
|
90
|
+
"static_file_url": "s3://audio.mp3",
|
91
|
+
"user_id": "john_smith_123",
|
92
|
+
"tags":["legal", "document"],
|
93
|
+
"highlights": [
|
94
|
+
{
|
95
|
+
"texts": [
|
96
|
+
{
|
97
|
+
"type": "text",
|
98
|
+
"value": "- What is the expected "
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"type": "hit",
|
102
|
+
"value": "read"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"type": "text",
|
106
|
+
"value": " to write ratio?\n\n"
|
107
|
+
}
|
108
|
+
]
|
109
|
+
}
|
110
|
+
],
|
111
|
+
"importance": "100%"
|
112
|
+
}
|
113
|
+
]
|
114
|
+
```
|
115
|
+
|
116
|
+
## Installation
|
117
|
+
|
118
|
+
Installing mixpeek is easy
|
119
|
+
|
120
|
+
```shell
|
121
|
+
pip install git+https://github.com/mixpeek/mixpeek-python.git@master
|
122
|
+
```
|
123
|
+
|
124
|
+
## S3 Support
|
125
|
+
|
126
|
+
Be sure you create an AWS access key/secret key combo with S3 bucket read permissions using [this guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).
|
127
|
+
|
128
|
+
Files are never stored on our servers, review our [security principles](https://mixpeek.com/security).
|
129
|
+
|
130
|
+
```python
|
131
|
+
from mixpeek import Mixpeek
|
132
|
+
|
133
|
+
mix = Mixpeek(
|
134
|
+
api_key="mixpeek_api_key",
|
135
|
+
access_key="aws_access_key",
|
136
|
+
secret_key="aws_secret_key",
|
137
|
+
region="region"
|
138
|
+
)
|
139
|
+
|
140
|
+
mix.index_bucket("mixpeek-public-demo")
|
141
|
+
|
142
|
+
# response (list of File_ids)
|
143
|
+
|
144
|
+
{
|
145
|
+
"file_ids": [
|
146
|
+
"63a33611660c021b50271666",
|
147
|
+
"63a33611660c021b50271667",
|
148
|
+
"63a33611660c021b50271668",
|
149
|
+
"63a33613660c021b50271669"
|
150
|
+
]
|
151
|
+
}
|
152
|
+
|
153
|
+
```
|
154
|
+
|
155
|
+
## Bugs & Questions
|
156
|
+
|
157
|
+
If this was helpful, please upvote [this StackOverflow comment](https://stackoverflow.com/a/69475102/5956579)
|
158
|
+
|
159
|
+
You can file bugs in our [github issues tracker](https://github.com/mixpeek/mixpeek-python/issues),
|
160
|
+
and ask any technical questions on
|
161
|
+
[Stack Overflow using the mixpeek tag](http://stackoverflow.com/questions/ask?tags=mixpeek).
|
162
|
+
We keep an eye on both.
|
163
|
+
|
164
|
+
## 🚀 Features
|
165
|
+
|
166
|
+
- Supports for `Python 3.8` and higher.
|
167
|
+
- Full text search
|
168
|
+
- AWS S3 Integration
|
169
|
+
- Fuzzy text matching
|
170
|
+
|
171
|
+
## Articles:
|
172
|
+
|
173
|
+
[Learning Center](https://mixpeek.com/learn)
|
174
|
+
|
175
|
+
## License ([MIT License](http://opensource.org/licenses/mit-license.php))
|
176
|
+
|
177
|
+
Copyright © 2022 Mixpeek, https://mixpeek.com
|
178
|
+
|
179
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
180
|
+
a copy of this software and associated documentation files (the
|
181
|
+
"Software"), to deal in the Software without restriction, including
|
182
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
183
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
184
|
+
permit persons to whom the Software is furnished to do so, subject to
|
185
|
+
the following conditions:
|
186
|
+
|
187
|
+
The above copyright notice and this permission notice shall be
|
188
|
+
included in all copies or substantial portions of the Software.
|
189
|
+
|
190
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
191
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
192
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
193
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
194
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
195
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
196
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# mixpeek.py
|
2
|
+
import requests
|
3
|
+
import json
|
4
|
+
|
5
|
+
|
6
|
+
class Mixpeek:
|
7
|
+
def __init__(self, api_key):
|
8
|
+
self.base_url = "http://localhost:8000"
|
9
|
+
self.headers = {
|
10
|
+
"Authorization": f"Bearer {api_key}",
|
11
|
+
"Content-Type": "application/json",
|
12
|
+
}
|
13
|
+
|
14
|
+
self.generate = self.Generate(self)
|
15
|
+
self.parse = self.Parse(self)
|
16
|
+
self.embed = self.Embed(self)
|
17
|
+
|
18
|
+
def _send_post(self, url, payload):
|
19
|
+
return requests.post(url, headers=self.headers, data=json.dumps(payload)).json()
|
20
|
+
|
21
|
+
def _send_get(self, url, payload=None):
|
22
|
+
return requests.get(url, headers=self.headers, data=json.dumps(payload)).json()
|
23
|
+
|
24
|
+
class Embed:
|
25
|
+
def __init__(self, mixpeek):
|
26
|
+
self.mixpeek = mixpeek
|
27
|
+
self.embed_url = f"{self.mixpeek.base_url}/embed"
|
28
|
+
|
29
|
+
def text(self, text, additional_data=None):
|
30
|
+
payload = {"input": text}
|
31
|
+
if additional_data is not None:
|
32
|
+
payload.update(additional_data)
|
33
|
+
return self.mixpeek._send_get(self.embed_url, payload)
|
34
|
+
|
35
|
+
class Generate:
|
36
|
+
def __init__(self, mixpeek):
|
37
|
+
self.mixpeek = mixpeek
|
38
|
+
self.openai = self.OpenAI(self.mixpeek)
|
39
|
+
|
40
|
+
class OpenAI:
|
41
|
+
def __init__(self, mixpeek):
|
42
|
+
self.mixpeek = mixpeek
|
43
|
+
self.generate_openai_url = f"{self.mixpeek.base_url}/generate"
|
44
|
+
|
45
|
+
def _construct_request_format(
|
46
|
+
self, model, context, response_format, settings=None
|
47
|
+
):
|
48
|
+
payload = {
|
49
|
+
"model": {"provider": "gpt", "model": model},
|
50
|
+
"context": context,
|
51
|
+
"messages": [{"role": "user", "content": ""}],
|
52
|
+
**settings,
|
53
|
+
}
|
54
|
+
|
55
|
+
if response_format is not None:
|
56
|
+
json_schema = response_format.model_json_schema()
|
57
|
+
payload["response_format"] = json_schema
|
58
|
+
|
59
|
+
return payload
|
60
|
+
|
61
|
+
def chat(self, model, response_format, context, settings=None):
|
62
|
+
payload = self._construct_request_format(
|
63
|
+
model, context, response_format, settings
|
64
|
+
)
|
65
|
+
return self.mixpeek._send_post(self.generate_openai_url, payload)
|
66
|
+
|
67
|
+
class Parse:
|
68
|
+
def __init__(self, mixpeek):
|
69
|
+
self.mixpeek = mixpeek
|
70
|
+
self.text = self.Text(self.mixpeek)
|
71
|
+
|
72
|
+
class Text:
|
73
|
+
def __init__(self, mixpeek):
|
74
|
+
self.mixpeek = mixpeek
|
75
|
+
self.parse_url = f"{self.mixpeek.base_url}/parsers"
|
76
|
+
|
77
|
+
def extract(self, file_url, should_chunk=True):
|
78
|
+
url = self.parse_url + "?should_chunk=" + str(should_chunk)
|
79
|
+
return self.mixpeek._send_post(url, {"file_url": file_url})
|
80
|
+
|
81
|
+
def chunk(self, corpus):
|
82
|
+
pass
|
83
|
+
|
84
|
+
class Index:
|
85
|
+
def __init__(self):
|
86
|
+
pass
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: mixpeek
|
3
|
+
Version: 0.5
|
4
|
+
Summary: full-text file search API
|
5
|
+
Home-page: https://github.com/mixpeek/mixpeek-python
|
6
|
+
Author: Ethan Steininger
|
7
|
+
Author-email: info@mixpeek.com
|
8
|
+
License: MIT
|
9
|
+
Keywords: file search
|
10
|
+
License-File: LICENSE.rst
|
11
|
+
Requires-Dist: requests
|
@@ -0,0 +1,12 @@
|
|
1
|
+
LICENSE.rst
|
2
|
+
MANIFEST.in
|
3
|
+
README.md
|
4
|
+
pyproject.toml
|
5
|
+
setup.cfg
|
6
|
+
setup.py
|
7
|
+
mixpeek/__init__.py
|
8
|
+
mixpeek.egg-info/PKG-INFO
|
9
|
+
mixpeek.egg-info/SOURCES.txt
|
10
|
+
mixpeek.egg-info/dependency_links.txt
|
11
|
+
mixpeek.egg-info/requires.txt
|
12
|
+
mixpeek.egg-info/top_level.txt
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
requests
|
@@ -0,0 +1 @@
|
|
1
|
+
mixpeek
|
@@ -0,0 +1,20 @@
|
|
1
|
+
[tool.poetry]
|
2
|
+
name = "mixpeek"
|
3
|
+
version = "0.1.0"
|
4
|
+
description = ""
|
5
|
+
authors = ["Ethan Steininger <esteininger21@gmail.com>"]
|
6
|
+
readme = "README.md"
|
7
|
+
|
8
|
+
[tool.poetry.dependencies]
|
9
|
+
python = "^3.11"
|
10
|
+
pydantic = "^2.6.4"
|
11
|
+
requests = "^2.31.0"
|
12
|
+
|
13
|
+
[tool.poetry.dev-dependencies]
|
14
|
+
setuptools = "^69.2.0"
|
15
|
+
wheel = "^0.43.0"
|
16
|
+
twine = "^5.0.0"
|
17
|
+
|
18
|
+
[build-system]
|
19
|
+
requires = ["poetry-core>=1.0.0"]
|
20
|
+
build-backend = "poetry.core.masonry.api"
|
mixpeek-0.5/setup.cfg
ADDED
mixpeek-0.5/setup.py
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
from setuptools import setup, find_packages
|
2
|
+
|
3
|
+
|
4
|
+
setup(
|
5
|
+
name="mixpeek",
|
6
|
+
version="0.5",
|
7
|
+
license="MIT",
|
8
|
+
author="Ethan Steininger",
|
9
|
+
author_email="info@mixpeek.com",
|
10
|
+
packages=["mixpeek"],
|
11
|
+
url="https://github.com/mixpeek/mixpeek-python",
|
12
|
+
keywords="file search",
|
13
|
+
description="full-text file search API",
|
14
|
+
install_requires=["requests"],
|
15
|
+
)
|