Client class¶
Here's the reference information for the Client class.
You can import the Client class directly from pypokeclient:
from pypokeclient import Client
Client
¶
Client(http_client: httpx.Client | None = None)
Synchronous version of the client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
http_client
|
httpx.Client
|
an |
None
|
Source code in pypokeclient/sync_client.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
__enter__
¶
__enter__() -> Client
Creates the client and deletes all the expired responses from the cache.
Returns:
| Name | Type | Description |
|---|---|---|
Client |
Client
|
an instance of the synchronous client. |
Source code in pypokeclient/sync_client.py
44 45 46 47 48 49 50 | |
__exit__
¶
__exit__(exc_type: type[BaseException] | None = None, exc_val: BaseException | None = None, exc_tb: TracebackType | None = None) -> None
Closes the session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exc_type
|
type[BaseException] | None
|
exception type. Defaults to None. |
None
|
exc_val
|
BaseException | None
|
exception value. Defaults to None. |
None
|
exc_tb
|
TracebackType | None
|
exception traceback. Defaults to None. |
None
|
Source code in pypokeclient/sync_client.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
_api_request
¶
_api_request(url: str) -> httpx.Response
Sends an API request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
the url to which the request will be sent. |
required |
Returns:
| Type | Description |
|---|---|
httpx.Response
|
httpx.Response: the non-parsed response from the API. |
Source code in pypokeclient/sync_client.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
_get_resource
¶
_get_resource(endpoint: str, key: int | str, model: type[T]) -> T
Source code in pypokeclient/sync_client.py
94 95 96 | |
_get_resources
¶
_get_resources(endpoint: str, key: int | str, model: type[T]) -> list[T]
Source code in pypokeclient/sync_client.py
98 99 100 | |
get_resource_list
¶
get_resource_list(endpoint: str, limit: int = 20, offset: int = 0) -> _api.NamedAPIResourceList | _api.APIResourceList | None
Get a list of resource data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoint
|
str
|
the endpoint (e.g. "pokemon", "berry", "item"). |
required |
limit
|
int
|
limits the number of elements to fetch. Defaults to 20. |
20
|
offset
|
int
|
offset needed to move to next page. Defaults to 0. |
0
|
Returns:
| Type | Description |
|---|---|
_api.NamedAPIResourceList | _api.APIResourceList | None
|
NamedAPIResourceList | APIResourceList | None: the parsed response from the API if the passed endpoint is among the list of available endpoints. |
Source code in pypokeclient/sync_client.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
get_berry
¶
get_berry(key: int | str) -> _api.Berry
Get data about a berry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the berry. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Berry |
_api.Berry
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
131 132 133 134 135 136 137 138 139 140 141 | |
get_berry_firmness
¶
get_berry_firmness(key: int | str) -> _api.BerryFirmness
Get data about a berry firmness.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the berry firmness. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BerryFirmness |
_api.BerryFirmness
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
143 144 145 146 147 148 149 150 151 152 153 | |
get_berry_flavor
¶
get_berry_flavor(key: int | str) -> _api.BerryFlavor
Get data about a berry flavor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the berry flavor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BerryFlavor |
_api.BerryFlavor
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
155 156 157 158 159 160 161 162 163 164 165 | |
get_contest_type
¶
get_contest_type(key: int | str) -> _api.ContestType
Get data about a contest type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the contest type. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ContestType |
_api.ContestType
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
170 171 172 173 174 175 176 177 178 179 180 | |
get_contest_effect
¶
get_contest_effect(key: int) -> _api.ContestEffect
Get data about a contest effect.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int
|
id of the contest effect. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ContestEffect |
_api.ContestEffect
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
182 183 184 185 186 187 188 189 190 191 192 | |
get_super_contest_effect
¶
get_super_contest_effect(key: int) -> _api.SuperContestEffect
Get data about a super contest effect.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int
|
id of the super contest effect. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
SuperContestEffect |
_api.SuperContestEffect
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
194 195 196 197 198 199 200 201 202 203 204 | |
get_encounter_method
¶
get_encounter_method(key: int | str) -> _api.EncounterMethod
Get data about an encounter method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the encounter method. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
EncounterMethod |
_api.EncounterMethod
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
209 210 211 212 213 214 215 216 217 218 219 | |
get_encounter_condition
¶
get_encounter_condition(key: int | str) -> _api.EncounterCondition
Get data about an encounter condition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the encounter condition. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
EncounterCondition |
_api.EncounterCondition
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
221 222 223 224 225 226 227 228 229 230 231 | |
get_encounter_condition_value
¶
get_encounter_condition_value(key: int | str) -> _api.EncounterConditionValue
Get data about an encounter condition value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the encounter condition. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
EncounterConditionValue |
_api.EncounterConditionValue
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
233 234 235 236 237 238 239 240 241 242 243 | |
get_evolution_chain
¶
get_evolution_chain(key: int) -> _api.EvolutionChain
Get data about an evolution chain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int
|
id of the evolution chain. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
EvolutionChain |
_api.EvolutionChain
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
248 249 250 251 252 253 254 255 256 257 258 | |
get_evolution_trigger
¶
get_evolution_trigger(key: int | str) -> _api.EvolutionTrigger
Get data about an evolution trigger.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the evolution trigger. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
EvolutionTrigger |
_api.EvolutionTrigger
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
260 261 262 263 264 265 266 267 268 269 270 | |
get_generation
¶
get_generation(key: int | str) -> _api.Generation
Get data about a generation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the generation. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Generation |
_api.Generation
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
275 276 277 278 279 280 281 282 283 284 285 | |
get_pokedex
¶
get_pokedex(key: int | str) -> _api.Pokedex
Get data about a Pokédex.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the Pokédex. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Pokedex |
_api.Pokedex
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
287 288 289 290 291 292 293 294 295 296 297 | |
get_version_group
¶
get_version_group(key: int | str) -> _api.VersionGroup
Get data about a version group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the version group. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VersionGroup |
_api.VersionGroup
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
299 300 301 302 303 304 305 306 307 308 309 | |
get_version
¶
get_version(key: int | str) -> _api.Version
Get data about a version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the version. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Version |
_api.Version
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
311 312 313 314 315 316 317 318 319 320 321 | |
get_item
¶
get_item(key: int | str) -> _api.Item
Get data about an item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the item. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Item |
_api.Item
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
326 327 328 329 330 331 332 333 334 335 336 | |
get_item_attribute
¶
get_item_attribute(key: int | str) -> _api.ItemAttribute
Get data about an item attribute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the item attribute. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemAttribute |
_api.ItemAttribute
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
338 339 340 341 342 343 344 345 346 347 348 | |
get_item_category
¶
get_item_category(key: int | str) -> _api.ItemCategory
Get data about an item category.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the item category. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemCategory |
_api.ItemCategory
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
350 351 352 353 354 355 356 357 358 359 360 | |
get_item_fling_effect
¶
get_item_fling_effect(key: int | str) -> _api.ItemFlingEffect
Get data about an item fling effect.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the item fling effect. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemFlingEffect |
_api.ItemFlingEffect
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
362 363 364 365 366 367 368 369 370 371 372 | |
get_item_pocket
¶
get_item_pocket(key: int | str) -> _api.ItemPocket
Get data about an item pocket.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the item pocket. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ItemPocket |
_api.ItemPocket
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
374 375 376 377 378 379 380 381 382 383 384 | |
get_location
¶
get_location(key: int | str) -> _api.Location
Get data about a location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the location. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Location |
_api.Location
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
389 390 391 392 393 394 395 396 397 398 399 | |
get_location_area
¶
get_location_area(key: int | str) -> _api.LocationArea
Get data about a location area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the location area. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
LocationArea |
_api.LocationArea
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
401 402 403 404 405 406 407 408 409 410 411 | |
get_pal_park_area
¶
get_pal_park_area(key: int | str) -> _api.PalParkArea
Get data about a Pal Park area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the Pal Park area. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PalParkArea |
_api.PalParkArea
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
413 414 415 416 417 418 419 420 421 422 423 | |
get_regions
¶
get_regions(key: int | str) -> _api.Region
Get data about a region.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the region. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Region |
_api.Region
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
425 426 427 428 429 430 431 432 433 434 435 | |
get_machine
¶
get_machine(key: int) -> _api.Machine
Get data about a machine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int
|
id of the machine. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Machine |
_api.Machine
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
440 441 442 443 444 445 446 447 448 449 450 | |
get_move
¶
get_move(key: int | str) -> _api.Move
Get data about a move.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the move. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Move |
_api.Move
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
455 456 457 458 459 460 461 462 463 464 465 | |
get_move_ailment
¶
get_move_ailment(key: int | str) -> _api.MoveAilment
Get data about a move ailment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the move ailment. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MoveAilment |
_api.MoveAilment
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
467 468 469 470 471 472 473 474 475 476 477 | |
get_move_battle_style
¶
get_move_battle_style(key: int | str) -> _api.MoveBattleStyle
Get data about a move battle style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the move battle style. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MoveBattleStyle |
_api.MoveBattleStyle
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
479 480 481 482 483 484 485 486 487 488 489 | |
get_move_category
¶
get_move_category(key: int | str) -> _api.MoveCategory
Get data about a move category.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the move category. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MoveCategory |
_api.MoveCategory
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
491 492 493 494 495 496 497 498 499 500 501 | |
get_damage_class
¶
get_damage_class(key: int | str) -> _api.MoveDamageClass
Get data about a move damage class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the move damage class. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MoveDamageClass |
_api.MoveDamageClass
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
503 504 505 506 507 508 509 510 511 512 513 | |
get_move_learn_method
¶
get_move_learn_method(key: int | str) -> _api.MoveLearnMethod
Get data about a move learn method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the move learn method. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MoveLearnMethod |
_api.MoveLearnMethod
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
515 516 517 518 519 520 521 522 523 524 525 | |
get_move_target
¶
get_move_target(key: int | str) -> _api.MoveTarget
Get data about a move target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the move target. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MoveTarget |
_api.MoveTarget
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
527 528 529 530 531 532 533 534 535 536 537 | |
get_ability
¶
get_ability(key: int | str) -> _api.Ability
Get data about an ability.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the ability. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Ability |
_api.Ability
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
542 543 544 545 546 547 548 549 550 551 552 | |
get_characteristic
¶
get_characteristic(key: int) -> _api.Characteristic
Get data about a characteristic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int
|
id of the characteristic. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Characteristic |
_api.Characteristic
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
554 555 556 557 558 559 560 561 562 563 564 | |
get_egg_group
¶
get_egg_group(key: int | str) -> _api.EggGroup
Get data about an egg group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the egg group. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
EggGroup |
_api.EggGroup
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
566 567 568 569 570 571 572 573 574 575 576 | |
get_gender
¶
get_gender(key: int | str) -> _api.Gender
Get data about a gender.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the gender. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Gender |
_api.Gender
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
578 579 580 581 582 583 584 585 586 587 588 | |
get_growth_rate
¶
get_growth_rate(key: int | str) -> _api.GrowthRate
Get data about a growth rate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the growth rate. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GrowthRate |
_api.GrowthRate
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
590 591 592 593 594 595 596 597 598 599 600 | |
get_nature
¶
get_nature(key: int | str) -> _api.Nature
Get data about a nature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the nature. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Nature |
_api.Nature
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
602 603 604 605 606 607 608 609 610 611 612 | |
get_pokeathlon_stat
¶
get_pokeathlon_stat(key: int | str) -> _api.PokeathlonStat
Get data about a Pokéathlon stat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the Pokéathlon stat. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PokeathlonStat |
_api.PokeathlonStat
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
614 615 616 617 618 619 620 621 622 623 624 | |
get_pokemon
¶
get_pokemon(key: int | str) -> _api.Pokemon
Get data about a pokémon.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the pokémon |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Pokemon |
_api.Pokemon
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
626 627 628 629 630 631 632 633 634 635 636 | |
get_pokemon_location_area
¶
get_pokemon_location_area(key: int | str) -> list[_api.LocationAreaEncounter]
Get data about a Pokémon's encounters in a location area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the Pokémon. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
LocationAreaEncounter |
list[_api.LocationAreaEncounter]
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
638 639 640 641 642 643 644 645 646 647 648 | |
get_pokemon_color
¶
get_pokemon_color(key: int | str) -> _api.PokemonColor
Get data about a Pokémon color.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the Pokémon color. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PokemonColor |
_api.PokemonColor
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
650 651 652 653 654 655 656 657 658 659 660 | |
get_pokemon_form
¶
get_pokemon_form(key: int | str) -> _api.PokemonForm
Get data about a Pokémon form.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the Pokémon form. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PokemonForm |
_api.PokemonForm
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
662 663 664 665 666 667 668 669 670 671 672 | |
get_pokemon_habitat
¶
get_pokemon_habitat(key: int | str) -> _api.PokemonHabitat
Get data about a Pokémon habitat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the Pokémon habitat. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PokemonHabitat |
_api.PokemonHabitat
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
674 675 676 677 678 679 680 681 682 683 684 | |
get_pokemon_shape
¶
get_pokemon_shape(key: int | str) -> _api.PokemonShape
Get data about a Pokémon shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the Pokémon shape. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PokemonShape |
_api.PokemonShape
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
686 687 688 689 690 691 692 693 694 695 696 | |
get_pokemon_species
¶
get_pokemon_species(key: int | str) -> _api.PokemonSpecies
Get data about a Pokémon species.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the Pokémon species. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PokemonSpecies |
_api.PokemonSpecies
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
698 699 700 701 702 703 704 705 706 707 708 | |
get_stat
¶
get_stat(key: int | str) -> _api.Stat
Get data about a stat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the stat. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Stat |
_api.Stat
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
710 711 712 713 714 715 716 717 718 719 720 | |
get_type
¶
get_type(key: int | str) -> _api.Type
Get data about a type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the type. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Type |
_api.Type
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
722 723 724 725 726 727 728 729 730 731 732 | |
get_language
¶
get_language(key: int | str) -> _api.Language
Get infos about a language.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
int | str
|
id or name of the pokémon |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Language |
_api.Language
|
the parsed response from the API. |
Source code in pypokeclient/sync_client.py
737 738 739 740 741 742 743 744 745 746 747 | |
get_sprite
¶
get_sprite(url: str) -> _api.Sprite
Get a sprite from an url.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
the url to the sprite. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Sprite |
_api.Sprite
|
a Sprite object useful to save the image. |
Source code in pypokeclient/sync_client.py
752 753 754 755 756 757 758 759 760 761 762 763 | |