友好pokeapi数据库的python包装器
pokebase的Python项目详细描述
pokebase是一个简单但功能强大的python接口, PokéAPI database
安装
pip install pokebase
再简单不过了。
用法
>>> import pokebase as pb >>> chesto = pb.NamedAPIResource('berry', 'chesto') >>> chesto.name 'chesto' >>> chesto.natural_gift_type.name 'water' >>> charmander = pb.pokemon('charmander') # Quick lookup. >>> charmander.height 6
>>> bulba = pb.pokemon_sprite(1) # And sprites too! >>> bulba.path '/home/user/.pokebase/sprite/pokemon/1.png' >>>
…就这么简单。
版本支持
Pokebase目前(官方)支持Python2.7和3.6版本。
测试
python单元测试位于单独的tests目录中,可以通过 python -m tests.test_pokebase。
重要
pokémon类型的快速数据查找是pokebase.type_('type-name'), 不是pokebase.type('type-name')。这是因为与 内置的type函数。