Skip to main content

A client implementing the Dictionary Server Protocol (DICT)

Project description

py-dict-client 0.1.0

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()

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

Uploaded Source

Built Distribution

py_dict_client-0.1.1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for py-dict-client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 277907c3b57e29004c7209fb65be3d2eb7018896709847fb2caab6bd690eb908
MD5 1d3a6046acbbc9056b947e9abcc870e3
BLAKE2b-256 9a003cb9b4bf09f615e3179de1619959ad36642ebcbf67a9786d6663ee4b4a86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: py_dict_client-0.1.1-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

Hashes for py_dict_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9cc9c30e5d0bd208b68cecbd99f11f3761c56408d5ac699ca59a5fb4556ccb41
MD5 5187112ce388b7acdd00f23d4d805a2e
BLAKE2b-256 151fcf47bc7032f66190bd2e74fe451c6a0f4b28abe3b679fff00048142bad50

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