Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python client for DICT Servers

Project Description

Wordbook is a Python asynchronous library to query Dict servers. It implements the main parts of DICT protocol (RFC 2229<>).

The library consists two classes:

  • DictBase: which implements commands from RFC2229.
  • Wordbook: which exposes more abstract methods to find a definition within dictionaries.

Both classes are asynchronous and require Python 3.5+.


To install from pypi

$ sudo pip install wordbook

or from source:

$ sudo python install


Getting information from a server using the DictBase class:

import asyncio
import wordbook

async def main():
    dictb = wordbook.DictBase()
    await dictb.connect()
    await dictb.client('wordbook/')
    info = await dictb.show_server()
    for line in info:

if __name__ == "__main__":
    loop = asyncio.get_event_loop()


dictd 1.12.1/rf on Linux 4.10.0-30-generic
On LT19758: up 07:55:45, 5 forks (0.6/hour)

Database      Headwords         Index          Data  Uncompressed
gcide              203645       3859 kB         12 MB         38 MB
wn                 147311       3002 kB       9247 kB         29 MB
moby-thesaurus      30263        528 kB         10 MB         28 MB

Getting definition of word mock using the WordBookDatabase class:

import asyncio
import wordbook

async def main():
    wb = wordbook.WordBookDatabase('wn')
    await wb.connect()
    lines = await wb.define('mock')
    for line in lines:

if __name__ == "__main__":
    loop = asyncio.get_event_loop()


["mock" wn "WordNet (r) 3.0 (2006)"]
    adj 1: constituting a copy or imitation of something; "boys in
           mock battle"
    n 1: the act of mocking or ridiculing; "they made a mock of him"
    v 1: treat with contempt; "The new constitution mocks all
         democratic principles" [syn: {mock}, {bemock}]
    2: imitate with mockery and derision; "The children mocked their
       handicapped classmate"

You can find more examples in directory example/.


Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(4.8 kB) Copy SHA256 Hash SHA256
Source Aug 15, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting