forked from novel/py-urbandict
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
45 lines (30 loc) · 1007 Bytes
/
Copy pathREADME
File metadata and controls
45 lines (30 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
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
py-urbandict
============
py-urbandict is a client for urbandictionary.com.
Project page on github: https://github.com/novel/py-urbandict
Installation
------------
Just run:
sudo setup.py install
Usage
__________
To use it from command line, just use 'urbancli' tool like that:
$ urbandicli xterm
1. xterm
Godly creature, omnipotent, guru in every way imaginable.
Examples:
* I wish i was an xterm
$
Usage from Python:
$ python3.2
Python 3.2 (r32:88445, Feb 27 2011, 09:51:00)
[GCC 4.2.1 20070719 [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.
>>> import urbandict
>>> urbandict.define('xterm')
[{'word': 'xterm', 'example': 'I wish i was an xterm', 'def': 'Godly creature, omnipotent, guru in every way imaginable.'}]
>>>
It returns list of defitinitions for a term. Each list item is a dict with the following keys:
* word -- the word itself
* def -- definition of the term
* example -- example of its usage (could be empty)