A Python library for the IMS Open Corpus Workbench (CWB) corpus query interface (CQi) API.
Project description
CQi SDK for Python
A Python library for the IMS Open Corpus Workbench (CWB) Corpus Query Interface (CQi) API.
Installation
The latest stable version is available on PyPI. Either add cqi
to your requirements.txt
file or install with pip:
pip install cqi
Version compatibility
Package version | Protocol version |
---|---|
0.1.0 | 0.1 |
0.1.1 | 0.1 |
0.1.2 | 0.1 |
Usage
import cqi
client = cqi.CQiClient('127.0.0.1')
client.connect(username='anonymous', password='') # <class 'cqi.status.StatusConnectOk'>
client.ping() # <class 'cqi.status.StatusPingOk'>
corpus = client.corpora.get('CORPUS') # <Corpus: CORPUS>
corpus.query('"and" []* "the";', 'Results') # <class 'cqi.status.StatusOk'>
results = corpus.subcorpora.get('Results') # <Subcorpus: CORPUS:Results>
client.disconnect() # <class 'cqi.status.StatusByeOk'>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cqi-0.1.2.tar.gz
(14.5 kB
view hashes)
Built Distribution
cqi-0.1.2-py3-none-any.whl
(18.3 kB
view hashes)