阀门工件api周围的pythonic包装
pyartifact的Python项目详细描述
pyartifact
pythonic包装在valve的artifact api上,带有对象映射、过滤和希望的更多功能
当前阶段:alpha->;需要反馈
到目前为止,我们可以这样做
>>>frompyartifactimportCards>>>cards=Cards()>>>cards.load_all_sets()>>>repr(cards.get('Storm Spirit').includes[0])<Artifactcard:{'id':10538,'base_id':10538,'name':'Ball Lightning','type':'Spell','text':"Move an <span style='font-weight:bold;color:#736e80;'>allied black hero</span> to an empty combat position in any lane.",'mini_image':'https://steamcdn-a.akamaihd.net/apps/583950/icons/set01/10538.aeb7a6a47e1d8b1a26307ae25e329df3e3bb0843.png','large_image':'https://steamcdn-a.akamaihd.net/apps/583950/icons/set01/10538_large_english.9b39d2d2bb4769b68fa3ac42abee35b1685a57de.png','ingame_image':None,'_CardBase__references':[],'color':'black','rarity':None,'item_def':None,'mana_cost':3,'illustrator':'JiHun Lee'}>>>>filtered=cards.filter.type('Spell').mana_cost(gt=4).color('black').rarity('Rare')>>>len(filtered)1>>>forcardinfiltered:...print(card)...TheCoverofNight# Deck encoding (wrapper not done)>>>frompyartifactimportdecode_deck_string>>>deck_contents=decode_deck_string('ADCJQUQI30zuwEYg2ABeF1Bu94BmWIBTEkLtAKlAZakAYmHh0JsdWUvUmVkIEV4YW1wbGU_')>>>print(deck_contents['name'])Blue/RedExample>>>print(deck_contents['heroes'])[{'id':4003,'turn':1},{'id':10006,'turn':1},{'id':10030,'turn':1},{'id':10033,'turn':3},{'id':10065,'turn':2}]>>>frompyartifactimportencode_deck>>>print(encode_deck(deck_contents))ADCJQUQI30zuwEYg2ABeF1Bu94BmWIBTEkLtAKlAZakAYmHh0JsdWUvUmVkIEV4YW1wbGU_
计划
- 提供文本消毒剂(文本ATM。有html)-标记、删除等,用于甲板编码/解码
- 添加更多筛选选项
- 清除代码结构(可能的性能改进)