program to store and update pokemons using SQL and Flask

Overview

Pokemon

SQL and Flask Pokemons api in python.

Technologies

  • flask
  • pymysql

Description

PokeCorp is a company that tracks pokemon and their trainers around the world.

Until this day, they've been storing all their data together, in the attached JSON file that looks like this:

, "name": , "type": , "height": , "weight": , "ownedBy": [ {name: , town: }, ... ] }, ...] ">
[{ 
    "id": 
         
          , 
    "name": 
          
           , 
    "type": 
           
            , 
    "height": 
            
             , 
    "weight": 
             
              , "ownedBy": [ {name: 
              
               , town: 
               
                }, ... ] }, ...] 
               
              
             
            
           
          
         

The file has 151 pokemon in it. Each pokemon has some data, as well as an ownedBy field.

The ownedBy field is an array of objects, where each object represents a trainer that owns this pokemon - note that this array might be empty.

In this project we were required to migrate all of the data to an SQL database, create the tables using plain SQL, and then do all the INSERTs in python using the pymysql package.

Once we were done, we wrote functions for the following queries:

  • heaviest_ pokemon(): returns the heaviest pokemon (the one with the biggest weight property).
  • find_by_type(type): receives a pokemon type, and returns all of the pokemon names with that type.
  • find_owners(pokemon __name): receives the name of a pokemon, and returns the names of all the trainers that own it, or an empty array if no one owns it.
  • find_roster(trainer_name): receives the name of a trainer, and returns the names of all the pokemon he or she owns.
  • finds_most_owned(): finds the most owned pokemon, meaning the pokemon that has the highest number of owners.

At the next stage, we were required to implement a server with api to the pokemons database. The api:

  • /pokemons/ GET: returns all the pokemons of a given owner.
  • /trainers/ GET: returns all the trainers of a given pokemon.
  • /pokemons POST: adds a new pokemon with the following information: id, name, height, weight, types (all of them).
  • /pokemons/get_by_type/ GET: returns all pokemons with the specific type.
  • /pokemons/ DELETE: deletes pokemon.
  • /pokemons/ DELETE: deletes all pokemons of trainer.
  • /pokemons/types/ PUT: updates pokemon types.
  • /evolve PUT: evolves specific pokemon of specific trainer.

Evolution

  1. Get the info of a specific pokemon.

  2. From the pokemon general info, get the species url.

  3. Get the info of the species, by making a request to the species url .

  4. From the species info get the evolution chain url.

  5. Get the info of the evolution chain, by making a request to the evolution chain url.

  6. From the evolution chain info get the chain item.

  7. Scan the chain item to find what is the next form of your pokemon.

  8. You should end up with the name of the evolved pokemon.

  9. Update the DB accordingly.

Original database

Pokémon Data

Owner
Sara Hindy Salfer
Sara Hindy Salfer
For Tok-k passages that have passed through the Bi-Encoder Retrival, ReRank is performed using CrossEncoder.

Cross-Encoder-with-Bi-Encoder For Tok-k passages that have passed through the Bi-Encoder Retrival, ReRank is performed using CrossEncoder. Data Data u

7 Feb 09, 2022
Find Transposon Element insertions using long reads (nanopore), by alignment directly. (minimap2)

find_te_ins find_te_ins is designed to find Transposon Element (TE) insertions using long reads (nanopore), by alignment directly. (minimap2) Install

Ming Wang 1 Feb 09, 2022
An alternative site to emplea.do due to inconsistent service of the app.

feline a agile and fast alternative to emplea.do License: MIT Settings Moved to settings. Basic Commands Setting Up Your Users To create a normal user

Codetiger 8 Nov 10, 2021
A New, Interactive Approach to Learning Python

This is the repository for The Python Workshop, published by Packt. It contains all the supporting project files necessary to work through the course from start to finish.

Packt Workshops 231 Dec 26, 2022
Check if Python package names are available on PyPI.

😻 isavailable Can I haz this Python package on PyPI? Check if Python package names are available on PyPI. Usage $ isavailable checks whether your des

Felipe S. S. Schneider 3 May 18, 2022
XlvnsScriptTool - Tool for decompilation and compilation of scripts .SDT from the visual novel's engine xlvns

XlvnsScriptTool English Dual languaged (rus+eng) tool for decompiling and compiling (actually, this tool is more than just (dis)assenbler, but less th

Tester 3 Sep 15, 2022
A fast Python in-process signal/event dispatching system.

Blinker Blinker provides a fast dispatching system that allows any number of interested parties to subscribe to events, or "signals". Signal receivers

jason kirtland 1.4k Dec 31, 2022
Covid-ChatBot - A Rapid Response Virtual Agent for Covid-19 Queries

COVID-19 CHatBot A Rapid Response Virtual Agent for Covid-19 Queries Contents What is ChatBot Types of ChatBots About the Project Dataset Prerequisite

NelakurthiSudheer 2 Jan 04, 2022
Supercharge your NFTs with new behaviours and superpowers!

WrapX Supercharge your NFTs with new behaviours and superpowers! WrapX is a collection of Wrappers (currently one - WrapXSet) to decorate your NTFs ad

Emiliano Bonassi 9 Jun 13, 2022
Application to list countries in order of travel from the United States.

Application to list countries in order of travel from the United States.

Broden Wanner 1 Nov 03, 2021
Plux - A dynamic code loading framework for building plugable Python distributions

Plux plux is the dynamic code loading framework used in LocalStack. Overview The

LocalStack 65 Dec 20, 2022
Simple utlity for sniffing decrypted HTTP/HTTPS traffic on a jailbroken iOS device into an HAR format.

Description iOS devices contain a hidden feature for sniffing decrypted HTTP/HTTPS traffic from all processes using the CFNetwork framework into an HA

83 Dec 25, 2022
Stop python warnings, no matter what!

SHUTUP - Stop python warnings, no matter what! Sometimes you just can't mute python warnings. Use this library to solve this. Installation pip install

80 Jan 04, 2023
1000+ ready code templates to kickstart your next AI experiment

AI Seed Projects Start with ready code for your next AI experiment. Choose from 1000+ code templates, across a wide variety of use cases. All examples

BlobCity, Inc 98 Jan 03, 2023
Configure request params such as text, color, size etc. And then download the image

Configure request params such as text, color, size etc. And then download the image

6 Aug 18, 2022
thonny plugin for gitonic

thonny-gitonic thonny plugin for gitonic open gitonic in thonny by pressing Control+Shift+g, or via tools menu press ESC key to minimize gitonic windo

karl 1 Apr 12, 2022
Perform oocyst segmentation in mercurochrome stained mosquito midgut

Midgut_oocyst_segmentation Perform oocyst segmentation in mercurochrome stained mosquito midguts This oocyst segmentation model also powers the webtoo

Duo Peng 3 Oct 27, 2021
Imports an object based on a string import_string('package.module:function_name')() - Based on werkzeug.utils

DEPRECATED don't use it. Please do: import importlib foopath = 'src.apis.foo.Foo' module_name = '.'.join(foopath.split('.')[:-1]) # to get src.apis.f

Bruno Rocha Archived Projects 11 Nov 12, 2022
A basic python project which replicates the functionalities on an 8 Ball.

Magic-8-Ball To the people who wish to make decisions using a Magic 8 Ball but can't get one? I gotchu. This is a basic python project which replicate

3 Jun 24, 2021
A basic layout of atm working of my local database

Software for working Banking service 😄 This project was developed for Banking service. mysql server is required To have mysql server on your system u

satya 1 Oct 21, 2021