A client implementing the Dictionary Server Protocol (DICT)
Project description
py-dict-client
py-dict-client
is a Python 3 client implementing the Dictionary Server Protocol.
Usage
>>> from dictionary_client import DictionaryClient
>>> dc = DictionaryClient()
>>> dc.databases
{'fra-eng': 'French-English FreeDict Dictionary ver. 0.4.1',
'eng-fra': 'English-French FreeDict Dictionary ver. 0.1.6',
'wn': 'WordNet (r) 3.1 (2011)',
'foldoc': 'The Free On-line Dictionary of Computing (2020-04-05)'}
>>> dc.define('oiseau', db='fra-eng').content
[{'db': 'fra-eng', 'definition': 'oiseau /wazo/ <n, masc>\nbird'}]
>>> dc.define('chauffeur').content
[{'db': 'fra-eng', 'definition': 'chauffeur /ʃofœʀ/ <n, masc>\nchauffeur, driver'},
{'db': 'eng-fra', 'definition': 'chauffeur /ʃoufər/\nchauffeur'},
{'db': 'wn', 'definition': 'chauffeur\n n 1: a man paid to drive a privately owned car\n...'}]
>>> dc.match('hello').content
defaultdict(<class 'list'>, {'eng-fra': ['hello'], 'wn': ['hello'], 'foldoc': ['hello']})
>>> dc.disconnect()
TODO implement remaining commands in specification
- STATUS
- SHOW INFO
- SHOW SERVER
- HELP
- OPTION
- AUTH
- SASLAUTH
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
py-dict-client-0.1.0.tar.gz
(2.1 kB
view details)
Built Distribution
File details
Details for the file py-dict-client-0.1.0.tar.gz
.
File metadata
- Download URL: py-dict-client-0.1.0.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f41ae7aa8564c36070af8383d4b2ea43eb69356c3d8b8ce33d8c51318f083a0 |
|
MD5 | 33a37d60dfe5bd2391e4e7823e28820b |
|
BLAKE2b-256 | 3746f684391685eede14dd8b341dbfb10d44903f3784958e6cbddfe822e9ab9e |
File details
Details for the file py_dict_client-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: py_dict_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f83b62c79726573a58015e4fcf460ab5995f631b40c22b518a7926c67685a46f |
|
MD5 | a57f98091926fba7ff297112bca702c2 |
|
BLAKE2b-256 | 52f6652ed681710adb33e6251161b35f66587072fe94dc0c501df5985453dfc6 |