Skip to main content

pypogo - The Python Pokemon Go Module

GithubActions

The pypogo module.

The goal is a Python module to run Pokemon Go calculations and simulations. This module interfaces with https://pogoapi.net/api/v1/ to obtain data like pokemon stats and stuff. It can currently do CP calculations, and check the rank of IVs based on the stats product of the mons at various levels.

I’m currently working on a battle simulator, and I plan to train agents to play PVP using neural networks and reinforcement learning. But it will be a while before that’s done.

In the meantime, there are still useful things you can do with this package.

The main way to interface is using the Pokemon class.

You can find IVs and levels to maximize CP under constraints:

>>> from pypogo.pokemon import Pokemon
>>> base = Pokemon('eevee')
>>> print('base = {}'.format(base))
>>> #
>>> max_cp = 1500
>>> #
>>> for mon in base.family():
>>>     mon.maximize(max_cp, ivs='maximize', max_level=51)
>>>     print('mon = {}'.format(mon))
base = <Pokemon(eevee, None, None, None, None)>
mon = <Pokemon(leafeon, 1497, 19.0, [1, 15, 14], None)>
mon = <Pokemon(espeon, 1498, 17.5, [0, 15, 15], None)>
mon = <Pokemon(umbreon, 1497, 27.5, [0, 15, 14], None)>
mon = <Pokemon(flareon, 1500, 18.5, [0, 15, 13], None)>
mon = <Pokemon(glaceon, 1500, 18.0, [0, 15, 12], None)>
mon = <Pokemon(jolteon, 1500, 19.5, [0, 12, 15], None)>
mon = <Pokemon(vaporeon, 1500, 18.0, [1, 15, 15], None)>

You can do purification and evolution operations.

>>> from pypogo.pokemon import Pokemon
>>> self = Pokemon('ralts', ivs=[6, 13, 15], level=20,
>>>                 shadow=True, shiny=True)
>>> new = self.purify()
>>> print('self = {}'.format(self))
>>> print('new  = {}'.format(new))
>>> evos = new.evolved()[0].evolved()
>>> print(evos[0])
>>> print(evos[1])
self = <Pokemon(ralts(😈,✨), 274, 20, [6, 13, 15], None)>
new  = <Pokemon(ralts(👼,✨), 285, 20, (8, 15, 15), None)>
<Pokemon(gallade(👼,✨), 1718, 20, (8, 15, 15), None)>
<Pokemon(gardevoir(👼,✨), 1718, 20, (8, 15, 15), None)>

You can do build a table of league rankings for different IV combinations

>>> from pypogo.pokemon import Pokemon
>>> self = Pokemon('beedrill')
>>> beedrill_df = self.league_ranking_table(max_cp=1500)
>>> print(beedrill_df)
      iva  ivd  ivs    cp  level      attack     defense  stamina  stat_product_k  rank     percent
rank
1       0   13   14  1499   32.5  126.206025  106.789714      132     1779.030702     1  100.000000
2       0   14   13  1500   32.5  126.206025  107.536495      131     1777.899723     2   99.316671
3       0   14   15  1496   32.0  125.700414  107.105679      132     1777.146120     3   98.861349
4       0   15   14  1497   32.0  125.700414  107.849468      131     1775.930690     4   98.126996
5       1   13   15  1500   32.0  126.444204  106.361889      132     1775.247460     5   97.714193
...   ...  ...  ...   ...    ...         ...         ...      ...             ...   ...         ...
4092   14    2    1  1489   32.0  136.113467   98.180205      121     1617.001419  4092    2.103120
4093   15    0    2  1490   32.0  136.857256   96.692626      122     1614.436679  4093    0.553523
4094   15    0    0  1493   32.5  137.407744   97.081558      121     1614.110696  4094    0.356567
4095   15    1    3  1488   31.5  136.304546   97.042911      122     1613.741564  4095    0.133540
4096   15    1    1  1492   32.0  136.857256   97.436416      121     1613.520542  4096    0.000000
...
[4096 rows x 11 columns]

This module is being developed mainly for fun and personal use. Features as added as I need them to answer questions mostly to do with my own personal min-maxing. Feel free to fork, contribute, or use as you’d like.

Read the docs

https://pypogo.readthedocs.io

Github

https://github.com/Erotemic/pypogo

Pypi

https://pypi.org/project/pypogo

Release files for pypogo 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypogo 0.1.0
File Size Uploaded
pypogo-0.1.0.tar.gz 65.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypogo 0.1.0
File Interpreter ABI Platform
pypogo-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 129.8 kB

Release files / pypogo-0.1.0.tar.gz

Download URL pypogo-0.1.0.tar.gz
Size 65.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fb00b8a184bb9708415ea69e65cb6860f12ec5db9ea985ecf8939c5c31a144b0
BLAKE2b-256 checksum
How to use checksums
596d34c5bc3b99519a5431813a4663d3d086be64ef2203a2af7659bdf4ea8593
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / pypogo-0.1.0-py3-none-any.whl

Download URL pypogo-0.1.0-py3-none-any.whl
Size 64.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26b5019756e666ec173a8f191670b36eaccb2457a7dbe4fea593a09e757ea083
BLAKE2b-256 checksum
How to use checksums
785840fd433912200fba8f99d9a11787354f02a2ea537fa32c9993ee75b9e492
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page