Dave Cinege Git Repo thesaurus / 157df3d
README.rst edit Dave Cinege 2 years ago
1 changed file(s) with 25 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
33
44 See the end of this file for further copyright and license information
55
6 Quick look
7 ----------
8 ::
9
10 from thesaurus import thes, Keypath
11 t = thes()
12 t.set_path('a.b.c.d', 'Hello')
13 print(t['a']['b']['c']['d']) # as nested items
14 print(t.a.b.c.d) # as attributes
15 print(t.a.b['c'].d) # as both
16 kp = Keypath('a.b.c.d')
17 print(t[kp]) # as a keypath
18
19 >>> 'a.b.c.d' in t
20 True
21 >>> kp[:-2] in t
22 True
23 >>> print(kp)
24 'a.b.c.d'
25 >>> print(repr(kp))
26 ['a', 'b', 'c', 'd']
27
628
729 Quick start
830 ------------
9 $ python thesauruscfg_sample.py
31 ::
32
33 $ python thesauruscfg_sample.py
1034
1135 Then review thesauruscfg_sample.py and thesauruscfg_sample.cfg
1236 and you will get an idea what Thesaurus and ThesaurusCfg