├── .gitignore ├── LICENSE ├── README.md ├── docs ├── Makefile ├── apidocs.rst ├── conf.py ├── index.rst ├── make.bat ├── quickstart.rst └── starter_pokemon.png ├── environment.yml ├── requirements.txt └── src └── pokedex.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Melissa Weber Mendonça 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # minimalsphinx 2 | 3 | Sphinx is what is called a documentation generator. This means that it takes a bunch of source files in plain text, and generates a bunch of other awesome things, mainly HTML. For our use case you can think of it as a program that takes in plain text files in reStructuredText format, and outputs HTML. 4 | 5 | reST -> Sphinx -> HTML 6 | 7 | So as a user of Sphinx, your main job will be writing these text files. This means that you should be minimally familiar with reStructuredText as a language. It’s similar to Markdown in a lot of ways, if you are already familiar with Markdown. 8 | 9 | This repo contains a very simple example of how to set up and use Sphinx to generate Python documentation. 10 | 11 | See the rendered version of the documentation at [https://minimalsphinx.readthedocs.io](https://minimalsphinx.readthedocs.io) 12 | 13 | ## Basic instructions 14 | 15 | 0. Install Python on your machine. Depending on your operating system, the instructions may vary. 16 | 1. Create and activate a virtual environment for your project. You can use conda for this: 17 | 18 | ```bash 19 | $ conda env create -f environment.yml 20 | $ conda activate minimal-sphinx 21 | ``` 22 | 23 | Another option is to use virtualenv. Create a 24 | 25 | ```bash 26 | $ pip install virtualenv # not needed if you have used virtualenv before 27 | $ virtualenv venv 28 | $ source venv/bin/activate 29 | ``` 30 | 31 | (A subtle difference between both methods is that the virtualenv environment you created lives in the folder where it was created, whereas the conda environment will work in whatever folder you are on.) 32 | 33 | 2. Install sphinx 34 | 35 | If you have used the conda instructions above, you all all set. If you prefer using pip, you can do 36 | 37 | ```bash 38 | $ pip install -r requirements.txt 39 | ``` 40 | 41 | This will install all required packages, including `sphinx` itself and the `furo` Sphinx theme. 42 | 43 | 3. Initiate sphinx 44 | 45 | If you are starting a project from scratch, you can do 46 | 47 | ```bash 48 | $ sphinx-quickstart 49 | ``` 50 | 51 | to get an initial file structure and configuration for your documentation. You can set default values for most of the answers, but you should fill your name and the project's name. The final message should say: 52 | 53 | > Finished: An initial directory structure has been created. 54 | 55 | > You should now populate your master file /home/melissa/projects/minimalsphinx/index.rst and create other documentation source files. Use the Makefile to build the docs, like so: 56 | > make builder 57 | > where "builder" is one of the supported builders, e.g. html, latex or linkcheck 58 | 59 | This means that once you have your documentation, you can choose in which format to build it to. For example, to build an html version of the docs, you can navigate to the `docs/` folder and use 60 | 61 | ```bash 62 | $ make html 63 | ``` 64 | 65 | However, if you run this command now, you may see some WARNINGS - this is expected as we haven't actually created any documents to build. 66 | 67 | (For this repo, this initial configuration has already been run, so you don't need to do it again.) 68 | 69 | 4. You can check the current folder for a bunch of automatically created files and folders. If you open `_build/html/index.html`, you can see an autogenerated starting point for your documentation. So now, let's create some documents! 70 | 71 | ## Documenting a Python module 72 | 73 | We'll create a very simple Python module to test our setup. It's a starter Pokédex, containing just the three starter Pokémon from the Kanto region. 74 | 75 | ### The `index.rst` file and the reStructuredText format 76 | 77 | After running `sphinx-quickstart`, an `index.rst` file is created that serves as the entry-point to your module documentation (unless you want to customize this - we'll see how you can do that below). It will likely contain only a basic structure in a [reStructuredText format](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html). reStructuredText, or reST, is a markup syntax that allows you to autogenerate documentation, including inline markup, custom content and powerful linking and referencing features. 78 | 79 | The standard reST inline markup consists of 80 | - one asterisk: `*text*` for emphasis (italics), 81 | - two asterisks: `**text**` for strong emphasis (boldface), and 82 | - backquotes: `` `text` `` for code samples. 83 | 84 | In addition, reST also implements [directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#directives), which are blocks of explicit markup which can have arguments, options and content. We'll see some examples of that in our module documentation. 85 | 86 | For now, you can see some directives in the `index.rst` file: `toctree` is a reStructuredText directive; `maxdepth` and `caption` are options for this directive, and their values are `2` and `Contents:`. In addition, you can see the `:ref:` *role* in this file. Sphinx implements [interpreted text roles](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html) to insert semantic markup into documents. For example, ``:ref:`search` `` implements the role `ref` with the content `search` - in this particular case, we are cross-referencing a location, in this case creating a link to the document with label `search`. 87 | 88 | We'll see concrete examples of this in the NumPy documentation, but you can check out a [nice summary of reST syntax](https://sphinx-tutorial.readthedocs.io/step-1/) and a longer [reST primer](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html). 89 | 90 | ### The `conf.py` file 91 | 92 | In order to properly autogenerate our documentation, we must edit a configuration file called `conf.py`, which is created by `sphinx-quickstart` with default values. You should see this in the root folder of your project. 93 | 94 | For now, the first thing to customize is the project name and author, if you have to. After that, we'll add `'venv'` to the `exclude_patterns` list, if you're using venv to manage your developer environment. With this basic configuration we create the documentation with `make html`. 95 | 96 | ### Generating your module documentation 97 | 98 | Right now, there's nothing in your rendered documentation. Let's fix that. 99 | 100 | When documenting Python code, it is common to write *docstrings*. Sphinx supports the inclusion of docstrings from your modules with an extension called [autodoc](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#module-sphinx.ext.autodoc). 101 | 102 | In order to use autodoc, you need to activate it in `conf.py` by writing 103 | 104 | ``` 105 | extensions = ['sphinx.ext.autodoc'] 106 | ``` 107 | 108 | You can then document whole classes or even modules automatically, using member options for the auto directives, like 109 | 110 | ``` 111 | .. automodule:: io 112 | :members: 113 | ``` 114 | 115 | Note that autodoc needs to import your modules in order to extract the docstrings. Therefore, you must add the appropriate path to `sys.path` in your `conf.py`. 116 | 117 | ### doctests 118 | 119 | Another extension that is helpful is [sphinx.ext.doctest](https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html). This allows you to add tests *to your docstrings*. All you need to do is add `'sphinx.ext.doctest'` to your `extensions` variable in `conf.py`. After this, you can add doctests as examples in your docstrings. You can then run 120 | 121 | ``` 122 | $ make doctest 123 | ``` 124 | 125 | to see the results. 126 | 127 | ### Adding custom pages 128 | 129 | Because we want to add more to our documentation than just the docstrings, let's add some custom pages to our project. 130 | 131 | 1. Move the API documentation to a separate page. 132 | 133 | First, let's create a new `apidocs.rst` file and move the `automodule` directive to this new file. After this, we'll add `apidocs` to our ToC Tree - our Table of Contents in the main `index.rst` file. 134 | 135 | 2. Add a Quickstart page to our documentation 136 | 137 | We'll write the *Quickstart* page separately. 138 | 139 | ### Intersphinx 140 | 141 | Finally, we'll check the `sphinx.ext.intersphinx` extension. Adding this to our extensions list, we can refer to other project's documentation labels easily by using their *intersphinx mapping*. For an example, check the **Base Stats** section in the Quickstart document of this package. 142 | 143 | ## References 144 | 145 | - [Sphinx tutorial](https://www.sphinx-doc.org/en/master/tutorial/index.html) 146 | - [Sphinx documentation](https://www.sphinx-doc.org/en/master/) 147 | - [Matplotlib Sphinx tutorial](https://matplotlib.org/sampledoc/) 148 | - [Sphinx tutorial](https://sphinx-tutorial.readthedocs.io/) by Eric Holscher 149 | - [A beginner's guide to writing documentation](https://www.writethedocs.org/guide/writing/beginners-guide-to-docs/), also by Eric Holscher 150 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/apidocs.rst: -------------------------------------------------------------------------------- 1 | API Documentation 2 | ================= 3 | 4 | .. automodule:: pokedex 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # This file only contains a selection of the most common options. For a full 4 | # list see the documentation: 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 6 | 7 | # -- Path setup -------------------------------------------------------------- 8 | 9 | # If extensions (or modules to document with autodoc) are in another directory, 10 | # add these directories to sys.path here. If the directory is relative to the 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. 12 | # 13 | import os 14 | import sys 15 | sys.path.insert(0, os.path.abspath('../src')) 16 | 17 | 18 | # -- Project information ----------------------------------------------------- 19 | 20 | project = 'Pokédex' 21 | copyright = '2021, melissawm' 22 | author = 'melissawm' 23 | 24 | 25 | # -- General configuration --------------------------------------------------- 26 | 27 | # Add any Sphinx extension module names here, as strings. They can be 28 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 29 | # ones. 30 | extensions = [ 'sphinx.ext.autodoc', 31 | 'sphinx.ext.doctest', 32 | 'sphinx.ext.intersphinx', 33 | 'sphinx_immaterial', 34 | ] 35 | 36 | # Add any paths that contain templates here, relative to this directory. 37 | templates_path = ['_templates'] 38 | 39 | # List of patterns, relative to source directory, that match files and 40 | # directories to ignore when looking for source files. 41 | # This pattern also affects html_static_path and html_extra_path. 42 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 43 | 44 | 45 | # -- Options for HTML output ------------------------------------------------- 46 | 47 | # The theme to use for HTML and HTML Help pages. See the documentation for 48 | # a list of builtin themes. 49 | # 50 | #html_theme = 'furo' 51 | html_theme = "sphinx_immaterial" 52 | 53 | html_theme_options = { 54 | "features": ["toc.follow"], 55 | } 56 | 57 | # Add any paths that contain custom static files (such as style sheets) here, 58 | # relative to this directory. They are copied after the builtin static files, 59 | # so a file named "default.css" will overwrite the builtin "default.css". 60 | #html_static_path = ['_static'] 61 | 62 | # Set up intersphinx maps 63 | intersphinx_mapping = {'numpy': ('https://numpy.org/doc/stable', None)} 64 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. pokedex documentation master file, created by 2 | sphinx-quickstart on Thu Jan 7 23:46:55 2021. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to Pokédex's documentation! 7 | =================================== 8 | 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | :caption: Contents: 13 | 14 | quickstart 15 | apidocs 16 | 17 | 18 | 19 | Indices and tables 20 | ================== 21 | 22 | * :ref:`genindex` 23 | * :ref:`modindex` 24 | * :ref:`search` 25 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/quickstart.rst: -------------------------------------------------------------------------------- 1 | Quickstart 2 | ========== 3 | 4 | The Pokédex package contains basic information about the three 5 | `starter Pokémon `_ 6 | from the `core series`_. These are detailed in :doc:`apidocs`. 7 | 8 | .. _starter: 9 | 10 | About starter Pokémon 11 | --------------------- 12 | 13 | .. _startpoke: 14 | 15 | .. figure:: starter_pokemon.png 16 | 17 | Starter Pokémon from the core series. 18 | 19 | As you can see in the :ref:`startpoke` image, these starter Pokémon have 20 | different types and abilities, and will evolve into different creatures as their 21 | level progresses. 22 | 23 | Base Stats 24 | ~~~~~~~~~~ 25 | 26 | The base stats for these Pokémon can be obtained from the general 27 | `base stats list`_. If you need to compute total damage done in battle or the 28 | current HP for a given Pokémon, you can use :ref:`NumPy array ` 29 | objects. 30 | 31 | .. _core series: https://bulbapedia.bulbagarden.net/wiki/Core_series 32 | .. _base stats list: https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_base_stats_(Generation_I) 33 | 34 | =========== ====== ========== =========== ========= =========== ========= =========== 35 | **Pokémon** **HP** **Attack** **Defense** **Speed** **Special** **Total** **Average** 36 | ----------- ------ ---------- ----------- --------- ----------- --------- ----------- 37 | Bulbasaur 45 49 49 45 65 253 50.6 38 | Charmander 39 52 43 65 50 249 49.8 39 | Squirtle 44 48 65 43 50 250 50.0 40 | =========== ====== ========== =========== ========= =========== ========= =========== 41 | 42 | Pokémon details 43 | ~~~~~~~~~~~~~~~ 44 | 45 | For these three Pokémon, you can check out their pokédex entries below. 46 | 47 | .. md-tab-set:: 48 | 49 | .. md-tab-item:: Bulbasaur 50 | 51 | * Seed Pokémon 52 | * Type: :bdg-success:`grass` :bdg-dark:`poison` 53 | * Abilities: Overgrow, Chlorophyll 54 | 55 | .. md-tab-item:: Charmander 56 | 57 | * Lizard Pokémon 58 | * Type: :bdg-warning:`fire` 59 | * Abilities: Blaze, Solar power 60 | 61 | .. md-tab-item:: Squirtle 62 | 63 | * Tiny turtle Pokémon 64 | * Type: :bdg-primary:`water` 65 | * Abilities: Torrent, Rain dish 66 | 67 | Usage 68 | ----- 69 | 70 | You can create an instance of Bulbasaur called ``friend``, for example, by doing 71 | 72 | .. code:: 73 | 74 | >>> import pokedex 75 | >>> friend = pokedex.Bulbasaur() 76 | -------------------------------------------------------------------------------- /docs/starter_pokemon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melissawm/minimalsphinx/437e12269b0a33da694104fa92599ff69c9ff7de/docs/starter_pokemon.png -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: minimal-sphinx 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.9 6 | - sphinx 7 | - furo 8 | - sphinx-design 9 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx-immaterial 2 | 3 | -------------------------------------------------------------------------------- /src/pokedex.py: -------------------------------------------------------------------------------- 1 | class StarterPokemon: 2 | 3 | """ 4 | This class defined one of the starter Pokémon given to the player by 5 | Professor Oak at the start of Pokémon Red, Green, Blue, FireRed, and 6 | LeafGreen. 7 | 8 | Actual Pokémon can be created by calling the specific classes defining the 9 | starter Pokémon types. You can see more details about them at :ref:`starter`. 10 | """ 11 | 12 | def __init__(self): 13 | self.name = None 14 | self.evolution = None 15 | self.ability = None 16 | self.pokemon_type = None 17 | self.base_stats = dict() 18 | 19 | def who_is_that_pokemon(self): 20 | """ 21 | Shows the Pokémon name and its evolution. 22 | 23 | Usage: 24 | 25 | .. doctest:: 26 | 27 | >>> import pokedex 28 | >>> friend = pokedex.Bulbasaur() 29 | >>> friend.who_is_that_pokemon() 30 | This pokemon is Bulbasaur. 31 | It will evolve into Ivysaur, Venusaur, Mega Venusaur, Gigantamax Venusaur. 32 | >>> 33 | """ 34 | print(f"This pokemon is {self.name}.") 35 | print(f"It will evolve into {', '.join(self.evolution)}.") 36 | 37 | 38 | class Bulbasaur(StarterPokemon): 39 | """ 40 | Bulbasaur is a dual-type Grass/Poison Pokémon introduced in Generation I. 41 | 42 | It evolves into Ivysaur starting at level 16, which evolves into Venusaur 43 | starting at level 32. 44 | 45 | Along with :class:`Charmander` and :class:`Squirtle`, Bulbasaur is one of 46 | three starter Pokémon of Kanto available at the beginning of Pokémon Red, 47 | Green, Blue, FireRed, and LeafGreen. 48 | """ 49 | 50 | def __init__(self): 51 | self.name = "Bulbasaur" 52 | self.pokemon_type = {"grass", "poison"} 53 | self.ability = "Overgrow" 54 | self.evolution = ["Ivysaur", 55 | "Venusaur", 56 | "Mega Venusaur", 57 | "Gigantamax Venusaur"] 58 | 59 | 60 | class Charmander(StarterPokemon): 61 | """ 62 | Charmander is a Fire-type Pokémon introduced in Generation I. 63 | 64 | It evolves into Charmeleon starting at level 16, which evolves into 65 | Charizard starting at level 36. 66 | 67 | Along with :class:`Bulbasaur` and :class:`Squirtle`, Charmander is one of 68 | three starter Pokémon of Kanto available at the beginning of Pokémon Red, 69 | Green, Blue, FireRed, and LeafGreen. 70 | 71 | .. note:: 72 | 73 | Charmeleon and Charizard are fire-type Pokémon, but Mega Charizard X and 74 | Gigantamax Charizard are also Flying Pokémon, while Mega Charizard Y is a 75 | Dragon-type Pokémon. 76 | """ 77 | 78 | def __init__(self): 79 | self.name = "Charmander" 80 | self.pokemon_type = {"fire"} 81 | self.ability = "Blaze" 82 | self.evolution = [ 83 | "Charmeleon", 84 | "Charizard", 85 | "Mega Charizard X", 86 | "Mega Charizard Y", 87 | "Gigantamax Charizard", 88 | ] 89 | 90 | 91 | class Squirtle(StarterPokemon): 92 | """ 93 | Squirtle is a Water-type Pokémon introduced in Generation I. 94 | 95 | It evolves into Wartortle starting at level 16, which evolves into Blastoise 96 | starting at level 36. 97 | 98 | Along with :class:`Bulbasaur` and :class:`Charmander`, Squirtle is one of 99 | three starter Pokémon of Kanto available at the beginning of Pokémon Red, 100 | Green, Blue, FireRed, and LeafGreen. 101 | """ 102 | 103 | def __init__(self): 104 | self.name = "Squirtle" 105 | self.pokemon_type = {"water"} 106 | self.ability = "Torrent" 107 | self.evolution = ["Wartortle"] 108 | 109 | class Caterpie(StarterPokemon): 110 | """ 111 | For protection, it releases a horrible stench from the antenna on its head to drive away enemies. 112 | """ 113 | 114 | def __init__(self): 115 | self.name = "Caterpie" 116 | self.pokemon_type = {"bug"} 117 | self.ability = "Shield Dust" 118 | self.evolution = ["Metapod", "Butterfree"] 119 | 120 | class Pidgey(StarterPokemon): 121 | """ 122 | A common sight in forests and woods. It flaps its wings at ground level to kick up blinding sand. 123 | 124 | Very docile. If attacked, it will often kick up sand to protect itself rather than fight back. 125 | """ 126 | 127 | def __init__(self): 128 | self.name = "Pidgey" 129 | self.pokemon_type = {"normal", "flying"} 130 | self.ability = "Keen Eye" 131 | self.evolution = ["Pidgeotto", "Pidgeot"] 132 | 133 | 134 | class Ratata(StarterPokemon): 135 | """ 136 | Bites anything when it attacks. Small and very quick, it is a common sight in many places. 137 | 138 | It is cautious in the extreme. Even while it is asleep, it constantly listens by moving its ears around. 139 | """ 140 | 141 | def __init__(self): 142 | self.name = "Ratata" 143 | self.pokemon_type = {"normal"} 144 | self.ability = "Run Away" 145 | self.evolution = ["Raticate"] 146 | 147 | 148 | class Spearow(StarterPokemon): 149 | """ 150 | Eats bugs in grassy areas. It has to flap its short wings at high speed to stay airborne. 151 | 152 | Inept at flying high. However, it can fly around very fast to protect its territory. 153 | """ 154 | 155 | def __init__(self): 156 | self.name = "Spearow" 157 | self.pokemon_type = {"normal", "flying"} 158 | self.ability = "Keen Eye" 159 | self.evolution = ["Fearow"] 160 | 161 | 162 | class Pikachu(StarterPokemon): 163 | """ 164 | When several of these Pokémon gather, their electricity could build and cause lightning storms. 165 | 166 | It keeps its tail raised to monitor its surroundings. If you yank its tail, it will try to bite you. 167 | """ 168 | 169 | def __init__(self): 170 | self.name = "Pikachu" 171 | self.pokemon_type = {"electric"} 172 | self.ability = "Static" 173 | self.evolution = ["Raichu", "Alolan Raichu"] 174 | 175 | class Jigglypuff(StarterPokemon): 176 | """ 177 | When its huge eyes light up, it sings a mysteriously soothing melody that lulls its enemies to sleep. 178 | 179 | Nothing can avoid falling asleep hearing a Jigglypuff's song. The sound waves of its singing voice match the brain waves of someone in a deep sleep. 180 | """ 181 | 182 | def __init__(self): 183 | self.name = "Jigglypuff" 184 | self.pokemon_type = {"normal", "fairy"} 185 | self.ability = "Cute Charm" 186 | self.evolution = ["Wigglytuff"] 187 | 188 | 189 | class Meowth(StarterPokemon): 190 | """ 191 | Adores round objects. It wanders the streets on a nightly basis to look for dropped loose change. 192 | 193 | It is nocturnal in nature. If it spots something shiny, its eyes glitter brightly. 194 | """ 195 | 196 | def __init__(self): 197 | self.name = "Meowth" 198 | self.pokemon_type = {"normal"} 199 | self.ability = "Pickup" 200 | self.evolution = ["Persian", "Alolan Persian"] 201 | 202 | 203 | class Psyduck(StarterPokemon): 204 | """ 205 | While lulling its enemies with its vacant look, this wily Pokémon will use psychokinetic powers. 206 | 207 | It is constantly wracked by a headache. When the headache turns intense, it begins using mysterious powers. 208 | """ 209 | 210 | def __init__(self): 211 | self.name = "Psyduck" 212 | self.pokemon_type = {"water"} 213 | self.ability = "Damp" 214 | self.evolution = ["Golduck"] 215 | 216 | 217 | class Abra(StarterPokemon): 218 | """ 219 | Using its ability to read minds, it will identify impending danger and teleport to safety. 220 | 221 | It sleeps for 18 hours a day. Even when awake, it teleports itself while remaining seated. 222 | """ 223 | 224 | def __init__(self): 225 | self.name = "Abra" 226 | self.pokemon_type = {"psychic"} 227 | self.ability = "Synchronize" 228 | self.evolution = ["Kadabra", "Alakazam"] 229 | 230 | 231 | class Machop(StarterPokemon): 232 | """ 233 | Loves to build its muscles. It trains in all styles of martial arts to become even stronger. 234 | 235 | It loves working out. As it gazes at its muscles, which continue to swell day by day, it becomes more and more dedicated to its training. 236 | """ 237 | 238 | def __init__(self): 239 | self.name = "Machop" 240 | self.pokemon_type = {"fighting"} 241 | self.ability = "Guts" 242 | self.evolution = ["Machoke", "Machamp"] 243 | 244 | 245 | class Bellsprout(StarterPokemon): 246 | """ 247 | A carnivorous Pokémon that traps and eats bugs. It uses its root feet to soak up needed moisture. 248 | 249 | If it notices anything that moves, it immediately flings its vine at the object. 250 | """ 251 | 252 | def __init__(self): 253 | self.name = "Bellsprout" 254 | self.pokemon_type = {"grass", "poison"} 255 | self.ability = "Chlorophyll" 256 | self.evolution = ["Weepinbell", "Victreebel"] 257 | 258 | 259 | class Geodude(StarterPokemon): 260 | """ 261 | Commonly found near mountain trails and the like. If you step on one by accident, it gets angry. 262 | 263 | It uses both hands to climb precipitous cliffs. People who see it in action have been known to take up bouldering. 264 | """ 265 | 266 | def __init__(self): 267 | self.name = "Geodude" 268 | self.pokemon_type = {"rock", "ground"} 269 | self.ability = "Rock Head" 270 | self.evolution = ["Graveler", "Golem"] 271 | 272 | class Ponyta(StarterPokemon): 273 | """ 274 | Capable of jumping incredibly high. Its hooves and sturdy legs absorb the impact of a hard landing. 275 | 276 | Its hooves are 10 times harder than diamonds. It can trample anything completely flat in little time. 277 | """ 278 | 279 | def __init__(self): 280 | self.name = "Ponyta" 281 | self.pokemon_type = {"fire"} 282 | self.ability = "Run Away" 283 | self.evolution = ["Rapidash", "Galarian Rapidash"] 284 | 285 | 286 | class Slowpoke(StarterPokemon): 287 | """ 288 | Incredibly slow and sluggish. It is quite content to loll about without worrying about the time. 289 | 290 | It is always so absent-minded that it won't react, even if its flavorful tail is bitten. 291 | """ 292 | 293 | def __init__(self): 294 | self.name = "Slowpoke" 295 | self.pokemon_type = {"water", "psychic"} 296 | self.ability = "Oblivious" 297 | self.evolution = ["Slowbro", "Mega Slowbro", "Slowking", "Galarian Slowbro"] 298 | 299 | 300 | class Magnemite(StarterPokemon): 301 | """ 302 | Uses anti-gravity to stay suspended. Appears without warning and uses Thunder Wave and similar moves. 303 | 304 | The units at the sides of its body generate anti-gravity energy to keep it aloft in the air. 305 | """ 306 | 307 | def __init__(self): 308 | self.name = "Magnemite" 309 | self.pokemon_type = {"electric", "steel"} 310 | self.ability = "Magnet Pull" 311 | self.evolution = ["Magneton", "Magnezone"] 312 | 313 | 314 | class Farfetchd(StarterPokemon): 315 | """ 316 | The sprig of green onions it holds is its weapon. It is used much like a metal sword. 317 | 318 | Although it can cut steel with its beak, it will not pick up a blade if it is dirty. 319 | """ 320 | 321 | def __init__(self): 322 | self.name = "Farfetch'd" 323 | self.pokemon_type = {"normal", "flying"} 324 | self.ability = "Keen Eye" 325 | self.evolution = ["Sirfetch'd", "Galarian Farfetch'd"] 326 | 327 | 328 | class Doduo(StarterPokemon): 329 | """ 330 | A bird that makes up for its poor flying with its fast foot speed. Leaves giant footprints. 331 | 332 | It lives on a grassy plain where it can see a long way. If it sees an enemy, it runs away at 60 mph. 333 | """ 334 | 335 | def __init__(self): 336 | self.name = "Doduo" 337 | self.pokemon_type = {"normal", "flying"} 338 | self.ability = "Run Away" 339 | self.evolution = ["Dodrio"] 340 | 341 | 342 | class Seel(StarterPokemon): 343 | """ 344 | The protruding horn on its head is very hard. It is used for bashing through thick ice. 345 | 346 | Seel hunts for prey in the frigid sea underneath sheets of ice. When it needs to breathe, it punches a hole through the ice with the sharply protruding section of its head. 347 | """ 348 | 349 | def __init__(self): 350 | self.name = "Seel" 351 | self.pokemon_type = {"water"} 352 | self.ability = "Thick Fat" 353 | self.evolution = ["Dewgong"] 354 | 355 | 356 | class Grimer(StarterPokemon): 357 | """ 358 | Appears in filthy areas. Thrives by sucking up polluted sludge that is pumped out of factories. 359 | 360 | Wherever Grimer has passed, so many germs are left behind that no plants will ever grow again. 361 | """ 362 | 363 | def __init__(self): 364 | self.name = "Grimer" 365 | self.pokemon_type = {"poison"} 366 | self.ability = "Stench" 367 | self.evolution = ["Muk", "Alolan Muk"] 368 | 369 | 370 | class Shellder(StarterPokemon): 371 | """ 372 | Its hard shell repels any kind of attack. It is vulnerable only when its shell is open. 373 | 374 | Even though it is encased in a sturdy shell, the body inside is tender. It can't withstand a harsh attack. 375 | """ 376 | 377 | def __init__(self): 378 | self.name = "Shellder" 379 | self.pokemon_type = {"water"} 380 | self.ability = "Shell Armor" 381 | self.evolution = ["Cloyster"] 382 | 383 | 384 | class Gastly(StarterPokemon): 385 | """ 386 | A being that exists as a thin gas. It can topple an Indian elephant by enveloping the prey in two seconds. 387 | 388 | It wraps its opponent in its gas-like body, slowly weakening its prey by poisoning it through the skin. 389 | """ 390 | 391 | def __init__(self): 392 | self.name = "Gastly" 393 | self.pokemon_type = {"ghost", "poison"} 394 | self.ability = "Levitate" 395 | self.evolution = ["Haunter", "Gengar", "Mega Gengar"] 396 | 397 | 398 | class Onix(StarterPokemon): 399 | """ 400 | Burrows at high speed in search of food. The tunnels it leaves are used as homes by Diglett. 401 | 402 | As it digs through the ground, it absorbs many hard objects. This is what makes its body so solid. 403 | """ 404 | 405 | def __init__(self): 406 | self.name = "Onix" 407 | self.pokemon_type = {"rock", "ground"} 408 | self.ability = "Rock Head" 409 | self.evolution = ["Steelix", "Mega Steelix"] 410 | 411 | 412 | class Drowzee(StarterPokemon): 413 | """ 414 | Puts enemies to sleep, then eats their dreams. Occasionally gets sick from eating bad dreams. 415 | 416 | It puts its enemy to sleep and eats the victim's dreams. It is known to visit children to steal their dreams through the holes in their noses. 417 | """ 418 | 419 | def __init__(self): 420 | self.name = "Drowzee" 421 | self.pokemon_type = {"psychic"} 422 | self.ability = "Insomnia" 423 | self.evolution = ["Hypno"] 424 | 425 | 426 | class Krabby(StarterPokemon): 427 | """ 428 | Its pincers are superb weapons. They sometimes break off during battle, but they grow back fast. 429 | 430 | If it loses a pincer, it somehow becomes incapable of walking sideways. However, it can still live on in the water. 431 | """ 432 | 433 | def __init__(self): 434 | self.name = "Krabby" 435 | self.pokemon_type = {"water"} 436 | self.ability = "Hyper Cutter" 437 | self.evolution = ["Kingler", "Galarian Kingler"] 438 | 439 | 440 | class Voltorb(StarterPokemon): 441 | """ 442 | It was discovered when Poké Balls were introduced. It is said that there is some connection. 443 | 444 | It was discovered at the site of a meteor strike 50 years ago. Its own energy source is its main enemy. 445 | """ 446 | 447 | def __init__(self): 448 | self.name = "Voltorb" 449 | self.pokemon_type = {"electric"} 450 | self.ability = "Soundproof" 451 | self.evolution = ["Electrode"] 452 | --------------------------------------------------------------------------------