1 """Simple lists of things for simple scripts
3 If you want to get a pokemon list, and you don't want it to include three
4 Wormadams and a whole bunch of Rotoms because of how the database is
5 structured, this module is for you.
7 The returned queries basically contain what a pokedex would show you.
8 You should make no other assumptions about them.
10 If you need to make assumptions, feel free to use these functions as examples
11 of what to watch out for.
14 from pokedex
.db
import tables
15 from pokedex
.db
.util
import filter_base_forms
, order_by_name
18 """Get a "sane" list of pokemon
20 WARNING: The result of this function is not very well defined.
21 If you want something specific, build that specific query yourself.
23 Currently, all base forms are returned, in evolution-preserving order
25 query
= session
.query(tables
.Pokemon
)
26 query
= query
.order_by(tables
.Pokemon
.order
)
27 query
= filter_base_forms(query
)
31 """Get a "sane" list of moves
33 WARNING: The result of this function is not very well defined.
34 If you want something specific, build that specific query yourself.
36 Currently, moves from mainline games are returned, sored by name
38 query
= session
.query(tables
.Move
)
39 query
= order_by_name(query
, tables
.Move
)
40 query
= query
.filter(tables
.Move
.id < 10000)
44 """Get a "sane" list of types
46 WARNING: The result of this function is not very well defined.
47 If you want something specific, build that specific query yourself.
49 Currently, generation V types are returned, sored by name
51 query
= session
.query(tables
.Type
)
52 query
= order_by_name(query
, tables
.Type
)
53 query
= query
.filter(tables
.Type
.id < 10000)
57 """Get a "sane" list of items
59 WARNING: The result of this function is not very well defined.
60 If you want something specific, build that specific query yourself.
62 Currently, items are sored by name
64 query
= session
.query(tables
.Item
)
65 query
= order_by_name(query
, tables
.Item
)