Skip to content

fleetwoodmac/PokemonTeamBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PokemonTeamBuilder

Version License: MIT

A hacked-together, barebones, locally-(or web)-hosted Pokemon Team Builder app. Mostly pure Python using Streamlit and PyZMQ.

🏠 Homepage

Table of contents

Feature List


  • Functional
    • Choose Pokemon
      • Get game desc
      • Get type
      • Get sprite
    • Choose Moves
      • get move desc
      • get power/acc
      • get type
    • Choose Held item
      • get sprite
      • get item desc
    • Get Smogon Dex Analysis Link
  • User
    • tabbed or single page view

Software/Resources Used


Images


Single Page View

Example Teamslot

Preparation (Build) Guide


Using Docker (easiest to run)

  1. Install Docker Desktop
  2. (optional) Install Git
  3. Clone this repo to a directory of your choice using the following command:
git clone https://github.com/fleetwoodmac/PokemonTeamBuilder.git

or by downloading repo as zip file and unzipping to desired to location

4. Make sure Docker Desktop is running and that you have space free before proceeding.
5. In the root directory of the program, build using the following command:
docker build -t namehere .

where namehere is whatever you want the docker image to be called. For example, this guide will use pokemonteambuilder. Keep the . in the command.

  1. Terminal/CMD should give a success message

Verify that the image built properly using command
docker images

Using Python (bit more work)

To be updated

Usage


Using Docker

  1. This is if you built the docker image.
  2. Run the following command
docker run -p 8501:8501 namehere

where namehere is the image name you used in step 5 of the docker build guide. You should see something like:

  1. Copy the URL (by default, this is http://0.0.0.0:8501). paste it into a browser, and you should see the webapp come up!


4. You can verify the docker container is running using
docker container ls

  1. Stop the container using the command
docker stop containername

where containername is the text from step 4 under NAMES. In the image above, it happened to be peaceful_leavitt. You can also open Docker Desktop, go to the Containers tab, and stop the container there.

Using Python

To be updated

Remove/Delete program


Using Docker

  1. The easiest way to do this is using Docker Desktop.
  2. Open Docker Desktop. Make sure any containers running this program are stopped.
  3. In the Containers tab, check the box for the container that has this program in it, and hit Delete.
  4. In the Images tab, check the box for the image containing this program, and hit Delete.
  5. Delete the directory you cloned/files you directly downloaded in the Install guide.

Using Python

To be updated

Notes


  • While I do not collect any sort of information, Streamlit collects usage telemetry by default. This is not disabled by default.

    • If you want to disable this, see Streamlit's documentation on the subject here.
  • Changing the port or address the app runs on

    • You can change the port as well as the host URL you want to app to run on in the Dockerfile before you build the image. Also make sure to change the EXPOSE line in the Dockerfile if you change the default port.
  • Deploying as a web-hosted/public instance

    • I can do a more thorough write-up of how to deploy this as a public instance if there is interest but the general steps are:
      • Make a docker hub account and create a public repository. Name it whatever you want (ex: pokemonteambuilder-demo). it should display a push command like docker push yourdockername/yourreponame
      • Build a docker image locally following the steps in the build guide. Make sure that your image name matches your repo name, i.e for the image name/tag use yourdockerusername/yourimagename (or yourdockerusername/yourimagename:version where version is something like latest if you are actively tracking version history).
      • if you are compiling on an arm based machine like an M1 Mac, make sure you build an x86 version of the image (see Jaimyn Mayer's guide linked below).
      • push to docker hub using the docker push command you got earlier
      • sign up for the free tier of a hosting service like oracle cloud, google cloud run, etc.
      • I used google cloud run, so for that, once you are logged in, create a new project and name it whatever, then go to Google Cloud Run, hit create new service
      • for the container URL just put in your docker hub repo name, i.e yourdockerusername/yourreponame. It should automatically pull the docker image from there (again, important that it is a public repo)
      • change the container port to 8501 (or whatever you changed it to in the dockerfile)
      • create the service, and it should eventually give you a URL. Go to that URL and you should have a public instance running.
  • Note on debugging seg faults and pyarrow

    • one of Streamlit's dependencies is pyarrow, and as of the time of this readme being updated, pyarrow has been quite finicky. If you are getting segfaults or weird errors running Streamlit, it may be due to pyarrow. As of this update to the readme, the current version of pyarrow is 14.0.0. After installing streamlit, manually overwriting pyarrow with an older version (12.0.1 for example) made the app run perfectly after experiencing some seg faults while running the streamlit run command.

Author


πŸ‘€ fleetwoodmac

🀝 Contributing


Contributions, issues and feature requests are welcome! Please also feel free to fork and start developing on it more on your own!
Feel free to check issues page.

Show your support


As mentioned, please feel free to fork this and start developing it more if you want--it's pretty barebones and sorta buggy in its current state. Give it a ⭐️ if you thought it was cool!

Acknowledgements


πŸ“ License


Copyright Β© 2023 fleetwoodmac.
This project is MIT licensed.


This README was generated with ❀️ by readme-md-generator

About

Pokemon Team Builder made with Streamlit and PyZMQ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published