{"id":16799638,"url":"https://github.com/tomplus/wordbook","last_synced_at":"2025-04-11T00:31:46.163Z","repository":{"id":62589371,"uuid":"100406554","full_name":"tomplus/wordbook","owner":"tomplus","description":"DICT Python Client","archived":false,"fork":false,"pushed_at":"2017-08-15T20:54:29.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T21:12:54.050Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/wordbook","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomplus.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-15T18:22:54.000Z","updated_at":"2023-06-27T16:42:14.000Z","dependencies_parsed_at":"2022-11-03T17:57:05.801Z","dependency_job_id":null,"html_url":"https://github.com/tomplus/wordbook","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fwordbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fwordbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fwordbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fwordbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomplus","download_url":"https://codeload.github.com/tomplus/wordbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247934828,"owners_count":21020728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T09:29:23.112Z","updated_at":"2025-04-11T00:31:46.142Z","avatar_url":"https://github.com/tomplus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Wordbook\n========\n\nDICT Python Client\n\n.. image:: https://img.shields.io/pypi/v/wordbook.svg\n    :target: https://pypi.python.org/pypi/wordbook\n.. image:: https://img.shields.io/pypi/pyversions/wordbook.svg\n    :target: https://pypi.python.org/pypi/wordbook\n.. image:: https://img.shields.io/pypi/l/wordbook.svg\n    :target: https://pypi.python.org/pypi/wordbook\n.. image:: https://travis-ci.org/tomplus/wordbook.svg?branch=master\n    :target: https://travis-ci.org/tomplus/wordbook\n.. image:: https://coveralls.io/repos/github/tomplus/wordbook/badge.svg?branch=master\n    :target: https://coveralls.io/github/tomplus/wordbook?branch=master\n\n\nMore details\n-----------\n\nWordbook is a Python asynchronous library to query Dict servers. It implements the main parts of DICT protocol (`RFC 2229 \u003chttps://tools.ietf.org/html/rfc2229\u003e`_)\n\nThe library consists two classes:\n\n* **DictBase**: which implements commands from RFC2229.\n* **Wordbook**: which exposes more abstract methods to find a definition within dictionaries.\n\nBoth classes are asynchronous and require Python 3.5+.\n\n\nInstallation\n------------\n\nTo install from pypi\n\n.. code-block:: bash\n\n   $ sudo pip install wordbook\n\nor from source:\n\n.. code-block:: bash\n\n    $ sudo python setup.py install\n\n\nExamples\n--------\n\nGetting information from a server using the *DictBase* class:\n\n.. code-block:: pycon\n\n   import asyncio\n   import wordbook\n\n\n   async def main():\n       dictb = wordbook.DictBase()\n       await dictb.connect()\n       await dictb.client('wordbook/server-status.py')\n       info = await dictb.show_server()\n       for line in info:\n           print(line)\n\n\n   if __name__ == \"__main__\":\n       loop = asyncio.get_event_loop()\n       loop.run_until_complete(main())\n       loop.close()\n\nOutput:\n\n.. code-block::\n\n   dictd 1.12.1/rf on Linux 4.10.0-30-generic\n   On LT19758: up 07:55:45, 5 forks (0.6/hour)\n\n   Database      Headwords         Index          Data  Uncompressed\n   gcide              203645       3859 kB         12 MB         38 MB\n   wn                 147311       3002 kB       9247 kB         29 MB\n   moby-thesaurus      30263        528 kB         10 MB         28 MB\n\n\nGetting definition of word *mock* using the *WordBookDatabase* class: \n\n.. code-block:: pycon\n\n   import asyncio\n   import wordbook\n\n   async def main():\n       wb = wordbook.WordBookDatabase('wn')\n       await wb.connect()\n       lines = await wb.define('mock')\n       for line in lines:\n           print(line)\n        \n   if __name__ == \"__main__\":\n       loop = asyncio.get_event_loop()\n       loop.run_until_complete(main())\n       loop.close()\n\nOutput:\n\n.. code-block::\n\n   [\"mock\" wn \"WordNet (r) 3.0 (2006)\"]\n   mock\n       adj 1: constituting a copy or imitation of something; \"boys in\n              mock battle\"\n       n 1: the act of mocking or ridiculing; \"they made a mock of him\"\n       v 1: treat with contempt; \"The new constitution mocks all\n            democratic principles\" [syn: {mock}, {bemock}]\n       2: imitate with mockery and derision; \"The children mocked their\n          handicapped classmate\"\n\nYou can find more examples in directory *example/*.\n\n\nResources\n---------\n\n* The DICT Development Group - http://www.dict.org/\n* RFC 2229: https://tools.ietf.org/html/rfc2229\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomplus%2Fwordbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomplus%2Fwordbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomplus%2Fwordbook/lists"}