Reference
Reference material consisting of package details.
Wordly Utility classes for use in your python scripts.
Word
Bases: UserString
str
subclass that provides an interface for retrieving definitions of terms.
Source code in src/wordly/words.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
adefinition
async
property
Return definition of word.
definition
property
Return definition of word.
__init__(seq, hostname='dict.org', port=2628, client=None)
Initialize.
Source code in src/wordly/words.py
15 16 17 18 19 20 |
|
DICT client.
DictClient
Client.
Source code in src/wordly/client.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
__aenter__()
async
Enter method for async context manager.
Source code in src/wordly/client.py
28 29 30 31 |
|
__aexit__(exc_type, exc, tb)
async
Exit method for async context manager.
Source code in src/wordly/client.py
33 34 35 |
|
__init__(hostname='dict.org', port=2628)
Initialize.
Source code in src/wordly/client.py
14 15 16 17 18 19 20 21 22 |
|
__repr__()
Return string representation of object.
Source code in src/wordly/client.py
24 25 26 |
|
connect()
async
Upon successful connection a status code of 220 is expected.
Source code in src/wordly/client.py
37 38 39 40 41 42 43 44 45 46 47 48 |
|
define(word, database='!')
async
Return line reader given word and database.
Source code in src/wordly/client.py
84 85 86 87 |
|
disconnect()
async
Close client connection.
Source code in src/wordly/client.py
50 51 52 53 54 55 56 57 58 59 |
|
help()
async
Return line reader with helpful information.
Source code in src/wordly/client.py
89 90 91 92 |
|
match(word, database='*', strategy='.')
async
Match a word in a database using a strategy.
Source code in src/wordly/client.py
94 95 96 97 98 99 |
|
show(option='DB')
async
Show more information.
Source code in src/wordly/client.py
101 102 103 104 |
|
DICT status codes.
BytesEnum
Bases: bytes
, ReprEnum
Enum where members are also (and must be) bytes
.
Source code in src/wordly/status_codes.py
9 10 11 12 13 14 15 16 |
|
__new__(*values)
Values must be already of type bytes
.
Source code in src/wordly/status_codes.py
12 13 14 15 16 |
|
Status
Bases: BytesEnum
Enumeration of possible status responses from a DICT server.
Note
The first digit of the response has the following meaning:
1yz - Positive Preliminary reply
2yz - Positive Completion reply
3yz - Positive Intermediate reply
4yz - Transient Negative Completion reply
5yz - Permanent Negative Completion reply
The next digit in the code indicates the response category:
x0z - Syntax
x1z - Information (e.g., help)
x2z - Connections
x3z - Authentication
x4z - Unspecified as yet
x5z - DICT System (These replies indicate the status of the
receiver DICT system vis-a-vis the requested transfer
or other DICT system action.)
x8z - Nonstandard (private implementation) extensions
Source code in src/wordly/status_codes.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
by_value(value)
classmethod
Return a status code given a bytes
value.
Source code in src/wordly/status_codes.py
73 74 75 76 |
|
statuses()
cached
classmethod
Return dict
of status values as keys and members as values.
Source code in src/wordly/status_codes.py
67 68 69 70 71 |
|
DICT parser or line reader.
DictParser
Line reader for parsing byte stream of DICT protocol.
Creates a map of DICT status code and associated information.
Source code in src/wordly/parser.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
__init__(delimiter=b'\r\n')
Initialize.
Source code in src/wordly/parser.py
16 17 18 19 20 |
|
feed(stream)
Feed stream of bytes
to line reader.
Calls _process_line
on bytes stream until delimiter
can no longer be found.
Source code in src/wordly/parser.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|