mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 09:15:41 +00:00
17 lines
451 B
Python
17 lines
451 B
Python
from .api import APIClient
|
|
from .models.corpora import CorpusCollection
|
|
|
|
|
|
class CQiClient:
|
|
def __init__(self, host, port=4877):
|
|
self.api = APIClient(host, port=port)
|
|
|
|
def connect(self, username='anonymous', password=''):
|
|
status = self.api.ctrl_connect(username, password)
|
|
self.corpora = CorpusCollection(self)
|
|
return status
|
|
|
|
def disconnect(self):
|
|
del self.corpora
|
|
return self.api.ctrl_bye()
|