Skip to main content

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

Uploaded Source

Built Distribution

py_dict_client-0.1.6-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: py-dict-client-0.1.6.tar.gz
  • Upload date:
  • Size: 18.8 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.7

File hashes

Hashes for py-dict-client-0.1.6.tar.gz
Algorithm Hash digest
SHA256 76fa4121bf837ac4b89c4f430def0d8e52248e62a128a82f30e92933025ee9dd
MD5 36036eb93bc636b042d8e74fef64ad2c
BLAKE2b-256 347c853a9d024f2082c2d7a5ba3bf9f9fa99bc992d1437fb31f154682b04662a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: py_dict_client-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 20.7 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.7

File hashes

Hashes for py_dict_client-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 281d18e7492f480b4ee08f9b2bac3d17c908a7ced35f1038b19e0524a759f96c
MD5 d799b04a380412c0476b37eaade09346
BLAKE2b-256 ff351441488f1c5b0e6e3632c28d199037ec6a503f363d0ca4e51033e54593c4

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