diff --git a/python/sdk/LICENSE b/python/sdk/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..44fe606a257854b8257b98f07a1f65101553cf1b --- /dev/null +++ b/python/sdk/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 上海赜睿信息科技有限公司(Zilliz) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/python/sdk/client/Abstract.py b/python/sdk/client/Abstract.py index 5a113d3114b626bfda04c189ab628e681f385056..ce3e28e42a7719ddb51a5ab2e4407339ff555c04 100644 --- a/python/sdk/client/Abstract.py +++ b/python/sdk/client/Abstract.py @@ -102,7 +102,6 @@ class TopKQueryResult(object): return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - def _abstract(): raise NotImplementedError('You need to override this function') diff --git a/python/sdk/client/Client.py b/python/sdk/client/Client.py index 86b414a9d10741c60a85f19a248d67595f212d63..a3b56247cfc47f586badcc429be5896a64113b13 100644 --- a/python/sdk/client/Client.py +++ b/python/sdk/client/Client.py @@ -2,20 +2,19 @@ import logging, logging.config from thrift.transport import TSocket from thrift.transport import TTransport -from thrift.transport.TTransport import TTransportException -from thrift.protocol import TBinaryProtocol, TCompactProtocol, TJSONProtocol -from thrift.Thrift import TException, TApplicationException, TType +from thrift.protocol import TBinaryProtocol +from thrift.Thrift import TException, TApplicationException from megasearch.thrift import MegasearchService from megasearch.thrift import ttypes from client.Abstract import ( ConnectIntf, TableSchema, - IndexType, Range, RowRecord, QueryResult, - TopKQueryResult + TopKQueryResult, + IndexType ) from client.Status import Status diff --git a/python/sdk/examples/connection_exp.py b/python/sdk/examples/example.py similarity index 96% rename from python/sdk/examples/connection_exp.py rename to python/sdk/examples/example.py index 05c2cffd5a68dfa695ee821271b229d80348b241..45de4fbbe2748079ca6c4832b71567c105bbcc68 100644 --- a/python/sdk/examples/connection_exp.py +++ b/python/sdk/examples/example.py @@ -1,12 +1,8 @@ from client.Client import MegaSearch, Prepare, IndexType -from client.Status import Status -import time import random import struct from pprint import pprint -from megasearch.thrift import MegasearchService, ttypes - def main(): # Get client version diff --git a/python/sdk/requirements.txt b/python/sdk/requirements.txt index ea9b1b81eea05c10002b3b9a642e7442552b8e29..ebe4797579f38a5f46d2d47af133271cb3e23cf8 100644 --- a/python/sdk/requirements.txt +++ b/python/sdk/requirements.txt @@ -1,5 +1,6 @@ atomicwrites==1.3.0 attrs==19.1.0 +Faker==1.0.7 importlib-metadata==0.17 mock==3.0.5 more-itertools==7.0.0 @@ -9,7 +10,9 @@ pluggy==0.12.0 py==1.8.0 pyparsing==2.4.0 pytest==4.6.0 +python-dateutil==2.8.0 six==1.12.0 +text-unidecode==1.2 thrift==0.11.0 wcwidth==0.1.7 zipp==0.5.1 diff --git a/python/sdk/setup.py b/python/sdk/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..3d40338b015f997f4d8bc9077aae70dddd5c88ca --- /dev/null +++ b/python/sdk/setup.py @@ -0,0 +1,18 @@ +import setuptools + +# TODO +long_description = '' + +setuptools.setup( + name="MegaSearch", + version="0.0.1", + author="XuanYang", + author_email="xuan.yang@zilliz.com", + description="Sdk for using MegaSearch", + packages=setuptools.find_packages(), + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + ], +) \ No newline at end of file