synod by Gnifajio
Python ΡΠ»ΠΎΠ²Π°ΡΡ Ρ ΡΠΈΠ½ΠΎΠ½ΠΈΠΌΠ°ΠΌΠΈ
ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅
Python Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°Π΅Ρ ΡΠΈΠΏ list ΠΊΠ°ΠΊ ΠΊΠ»ΡΡ ΡΠ»ΠΎΠ²Π°ΡΡ, Π° ΡΠ°ΠΌ Π±ΠΎΠ»Π΅Π΅ ΡΠΈΠ½ΠΎΠ½ΠΈΠΌΡ. Π― ΡΠ΅ΡΠΈΠ» ΡΡΡ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ, ΡΠΎΠ·Π΄Π°Π² ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΡΠΉ ΡΠΈΠΏ Π΄Π°Π½Π½ΡΡ synod, ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡΡΠΈΠΉ Π΄Π΅Π»Π°ΡΡ ΡΡΠΎ. ΠΠΈΠΆΠ΅ Π±ΡΠ΄Π΅Ρ ΠΏΡΠΈΠΌΠ΅Ρ ΠΊΠ°ΠΊ ΡΡΠΎ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ.
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ°
git clone https://github.com/gnifajio/synod.git
cd synod
python3 setup.py install
ΠΠ»ΠΈ
pip install synod
ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅
from synod import synod
synoded = synod([
[['development', 'dev'], [
'all_inclusive', 'backend', 'frontend',
'prototyping', 'android', 'desktop',
'1c_dev', 'games', 'other', 'scripts',
'voice_interfaces', 'ios', 'bots',
]],
[['testing', 'tst'], [
'sites', 'mobile', 'software',
]],
[['admin', 'adm'], [
'servers', 'network', 'databases',
'security', 'other' ,
]]
]
)
synoded['dev'] == synoded['development'] # True
'dev' in synoded # True
synoded.get('wtf') # synod.EmptyValue
synoded.get('testing') # [ 'sites', 'mobile', 'software' ]
synoded.has_key('tst') # True
synoded.is_synonym('adm') # True
synoded.get_main_key('adm') # 'admin'
del synoded['dev']
synoded.has_key(dev) # False
synoded.clear()
synoded # {}
TODO
ΠΠΎΠ±Π°Π²ΠΈΡΡ ΠΌΠ΅ΡΠΎΠ΄Ρ:
__ior__
__iter__
__len__
__or__
__reversed__
__ror__
__setitem__
copy
fromkeys
keys
pop
popitem
setdefault
update
values
ΠΠΎΠ²ΠΎΠ΅ Π² Π²Π΅ΡΡΠΈΠΈ 1.1:
- ΠΠ΅ΡΠΎΠ΄
items
.