Skip to main content

A client implementing the Dictionary Server Protocol (DICT)

Project description

py-dict-client 0.1.5

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.1.5.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

py_dict_client-0.1.5-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file py-dict-client-0.1.5.tar.gz.

File metadata

  • Download URL: py-dict-client-0.1.5.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.3

File hashes

Hashes for py-dict-client-0.1.5.tar.gz
Algorithm Hash digest
SHA256 0a258c5e4e9f2a9a49b8114a94c682f346d45521e82c4f3eb3bcf0185396726e
MD5 3ce87913cc08bfcd4f3a7ef338f1c780
BLAKE2b-256 cfc8d34eb8a94484dc6121776a315c7f8e82885c217cc7b3227f7c8275f4a8df

See more details on using hashes here.

File details

Details for the file py_dict_client-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: py_dict_client-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.3

File hashes

Hashes for py_dict_client-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 40c0a2269d093389eba3bdcf6d7f263ec98de75ca42dbad8618a7de0290c0097
MD5 5375737223c35f923afc13cbc803cc41
BLAKE2b-256 d9fbcc5959cd129ecf4e87234355f663b2ccfada64bf25f03b36970d2bbf8f78

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page