A client implementing the Dictionary Server Protocol (DICT)
Project description
py-dict-client 0.1.6
py-dict-client
is a Python 3 client implementing the Dictionary Server Protocol.
Installation
$ pip install py-dict-client
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()
Contributing
Contributions are welcome. Please format your code with black, and add/improve tests where suitable.
To run the tests: $ make test
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.2.0.tar.gz
(20.1 kB
view hashes)
Built Distribution
Close
Hashes for py_dict_client-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5c9aa786bb5b7f49c564ffe8b313877c1a49894ddd1e134a77c1a9727e4f4d6 |
|
MD5 | ba0678d9fdb401ccb511356d1a08efe1 |
|
BLAKE2b-256 | 88579b28855a97d2e6399197d12a870e782498ebb10d43b0a82bfa4d07516a90 |