Created
February 25, 2019 15:28
-
-
Save yi-jiayu/bdf1e07095ae93a6581fb4698f26faa7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 17, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from pokedex.lookup import PokedexLookup" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 18, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"lookup = PokedexLookup()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 21, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[LookupResult(object=<pokedex.db.tables.PokemonSpecies object (133): eevee>, indexed_name=u'eevee', name=u'Eevee', language=<pokedex.db.tables.Language object (9): en>, iso639=u'en', iso3166=u'us', exact=True)]" | |
] | |
}, | |
"execution_count": 21, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"result = lookup.lookup('eevee')\n", | |
"result" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 28, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"['__class__',\n", | |
" '__delattr__',\n", | |
" '__dict__',\n", | |
" '__doc__',\n", | |
" '__format__',\n", | |
" '__getattribute__',\n", | |
" '__hash__',\n", | |
" '__init__',\n", | |
" '__mapper__',\n", | |
" '__module__',\n", | |
" '__new__',\n", | |
" '__reduce__',\n", | |
" '__reduce_ex__',\n", | |
" '__repr__',\n", | |
" '__setattr__',\n", | |
" '__singlename__',\n", | |
" '__sizeof__',\n", | |
" '__str__',\n", | |
" '__subclasshook__',\n", | |
" '__table__',\n", | |
" '__tablename__',\n", | |
" '__unicode__',\n", | |
" '__weakref__',\n", | |
" '_decl_class_registry',\n", | |
" '_sa_class_manager',\n", | |
" '_sa_instance_state',\n", | |
" 'base_happiness',\n", | |
" 'capture_rate',\n", | |
" 'child_species',\n", | |
" 'color',\n", | |
" 'color_id',\n", | |
" 'conquest_abilities',\n", | |
" 'conquest_evolution',\n", | |
" 'conquest_max_links',\n", | |
" 'conquest_move',\n", | |
" 'conquest_order',\n", | |
" 'conquest_stats',\n", | |
" 'default_form',\n", | |
" 'default_pokemon',\n", | |
" 'dex_numbers',\n", | |
" 'egg_groups',\n", | |
" 'evolution_chain',\n", | |
" 'evolution_chain_id',\n", | |
" 'evolutions',\n", | |
" 'evolves_from_species_id',\n", | |
" 'flavor_summaries',\n", | |
" 'flavor_summaries_local',\n", | |
" 'flavor_summaries_table',\n", | |
" 'flavor_summary',\n", | |
" 'flavor_summary_map',\n", | |
" 'flavor_text',\n", | |
" 'form_description',\n", | |
" 'form_description_map',\n", | |
" 'forms',\n", | |
" 'forms_switchable',\n", | |
" 'gender_rate',\n", | |
" 'generation',\n", | |
" 'generation_id',\n", | |
" 'genus',\n", | |
" 'genus_map',\n", | |
" 'growth_rate',\n", | |
" 'growth_rate_id',\n", | |
" 'habitat',\n", | |
" 'habitat_id',\n", | |
" 'has_gender_differences',\n", | |
" 'hatch_counter',\n", | |
" 'id',\n", | |
" 'identifier',\n", | |
" 'is_baby',\n", | |
" 'metadata',\n", | |
" 'name',\n", | |
" 'name_map',\n", | |
" 'names',\n", | |
" 'names_local',\n", | |
" 'names_table',\n", | |
" 'order',\n", | |
" 'pal_park',\n", | |
" 'parent_species',\n", | |
" 'pokemon',\n", | |
" 'prose',\n", | |
" 'prose_local',\n", | |
" 'prose_table',\n", | |
" 'shape',\n", | |
" 'shape_id',\n", | |
" 'translation_classes',\n", | |
" 'triggered_evolutions']" | |
] | |
}, | |
"execution_count": 28, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"eevee = result[0].object\n", | |
"dir(eevee)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 38, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"['__class__',\n", | |
" '__delattr__',\n", | |
" '__dict__',\n", | |
" '__doc__',\n", | |
" '__format__',\n", | |
" '__getattribute__',\n", | |
" '__hash__',\n", | |
" '__init__',\n", | |
" '__mapper__',\n", | |
" '__module__',\n", | |
" '__new__',\n", | |
" '__reduce__',\n", | |
" '__reduce_ex__',\n", | |
" '__repr__',\n", | |
" '__setattr__',\n", | |
" '__sizeof__',\n", | |
" '__str__',\n", | |
" '__subclasshook__',\n", | |
" '__table__',\n", | |
" '__tablename__',\n", | |
" '__unicode__',\n", | |
" '__weakref__',\n", | |
" '_decl_class_registry',\n", | |
" '_sa_class_manager',\n", | |
" '_sa_instance_state',\n", | |
" 'flavor_text',\n", | |
" 'language',\n", | |
" 'language_id',\n", | |
" 'metadata',\n", | |
" 'species',\n", | |
" 'species_id',\n", | |
" 'summary_column',\n", | |
" 'translation_classes',\n", | |
" 'version',\n", | |
" 'version_id']" | |
] | |
}, | |
"execution_count": 38, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"dir(eevee.flavor_text[0])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 43, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Its genetic code\n", | |
"is irregular.\n", | |
"It may mutate if\f", | |
"it is exposed to\n", | |
"radiation from\n", | |
"element STONEs.\n" | |
] | |
} | |
], | |
"source": [ | |
"print eevee.flavor_text[0].flavor_text" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 41, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<pokedex.db.tables.Language object (9): en>" | |
] | |
}, | |
"execution_count": 41, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"eevee.flavor_text[0].language" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 42, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x108f76050>,\n", | |
" 'flavor_text': u'Its genetic code\\nis irregular.\\nIt may mutate if\\x0cit is exposed to\\nradiation from\\nelement STONEs.',\n", | |
" 'language': <pokedex.db.tables.Language object (9): en>,\n", | |
" 'language_id': 9,\n", | |
" 'species_id': 133,\n", | |
" 'version': <pokedex.db.tables.Version object (1): red>,\n", | |
" 'version_id': 1}" | |
] | |
}, | |
"execution_count": 42, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"eevee.flavor_text[0].__dict__" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 2", | |
"language": "python", | |
"name": "python2" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 2 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython2", | |
"version": "2.7.15" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment