Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sword & Shield Pokemon #460

Closed
karsvaniersel opened this issue Dec 11, 2019 · 20 comments
Closed

Sword & Shield Pokemon #460

karsvaniersel opened this issue Dec 11, 2019 · 20 comments
Labels

Comments

@karsvaniersel
Copy link

When will the Sword & Shield Pokemon be added? And how can I help speed up the process? :)

@blevy115
Copy link

I think they're waiting on the data from veekun

@Naramsim
Copy link
Member

Yes, we are waiting for https://github.com/veekun/pokedex to update their CSV files. We are based on the data they provide.

You can track their issue here: veekun/pokedex#284

@karsvaniersel
Copy link
Author

Ah thanks! Ye not really familiar how Veekun is getting their data, else i would love to help. I do see some sites having the Sword and Shield data, but they probably have their own data set

@Naramsim
Copy link
Member

They get the data from

  1. Looking into pokemon Nintendo games
  2. Manually

So it's a long and difficult process

@karsvaniersel
Copy link
Author

Ah ye I wonder how people can parse the game data and convert it to CSV. Maybe should link into that sometimes, do you have any experience with that?

@Naramsim
Copy link
Member

Nope, at all :(

@sfyfedotcom
Copy link

If it helps anyone, here is json and sprites for the 8th gen Pokemon. The json is just id, name and type names, as that's all I needed. The sprites are also a bit small, as that's all I could source easily.

8th-gen-pokemon.zip

Also here's the Node script I used to scrape it from Bulbapedia:

const cheerio = require('cheerio')
const https = require('https')

const get = (url, binary) => new Promise((resolve, reject) => {
  https
    .get(url, resp => {
      if (binary) {
        resp.setEncoding('binary')
      }
      let data = ''
      resp.on('data', (chunk) => {
        data += chunk
      })
      resp.on('end', () => {
        resolve(data)
      })
    })
    .on('error', err => {
      throw err
    })
})

const get8thGenPokemon = async () => {
  const html = await get([
    'https://bulbapedia.bulbagarden.net',
    '/wiki/List_of_Pokémon_by_index_number_(Generation_VIII)'
  ].join(''))
  const $ = cheerio.load(html)
  const pokemon = {}
  $('#mw-content-text table.roundy tr').each((i, row) => {
    const cells = $(row).find('td')
    if (!cells.length) {
      return
    }
    const id = $(cells[1]).text().trim()
    if (id < 810) {
      // 810 Grookey is the first Gen 8 pokemon
      return
    }
    // TODO get higher res images
    const image = $(cells[2]).find('img').attr('src')
    const name = $(cells[3]).text().trim()
    const types = []
    cells.each((i, cell) => {
      if (i < 4) {
        return
      }
      const type = $(cell).text().toLowerCase().trim()
      if (types.indexOf(type) > -1) {
        return
      }
      types.push(type)
    })
    pokemon[id] = {
      image,
      name,
      types
    }
  })
  return pokemon
}

module.exports = {
  get,
  get8thGenPokemon
}

@route1rodent
Copy link

meanwhile we get veekun/pokedex ready, I have prepared a project and a JSON with all gen 8 Pokemon and stats https://github.com/route1rodent/swordshield-data/blob/master/data/json/pokemon.json

we are working on porting the data to veekun/pokedex soon-ish

@Naramsim
Copy link
Member

Nice one, where are you fetching the data from?

@route1rodent
Copy link

route1rodent commented Feb 18, 2020

@Naramsim
from @ SciresM and @ Kaphotics on Twitter, who always rip the data and sprites from the original games.

The JSON file I posted is just the result of parsing and processing some of that data (concretely Sword/Shield Pokemon Stats, Learnsets and Evolutions) , which I am doing in that repository.

@skylarr1227
Copy link

Very good an accurate. I have all the gen 8 sprites (gif format) in a much more hd form if you would like or if it would help I can make a repository for this (or just give you the link to our webserver)

@dreki
Copy link

dreki commented Mar 2, 2020

Good work, y’all. Let me know if I can help at all. I built https://pokedecks.now.sh and am very thankful for PokeAPI. I’ll help in any way I can.

Update: I've been able to bring Sword & Shield Pokémon into my site: https://pokedecks.now.sh/pokemon/812

I have classic (pre-gen 8) Pokémon coming from PokeAPI and gen 8 Pokémon coming from local data files, and they're both served by one unifying GraphQL service.

@Naramsim
Copy link
Member

Cool @dreki, two questions:

Which data did you use for sword and shield?

Did you use Pokeapi's branch for GraphQL?

Thanks

@takeshi-codes
Copy link

I know it'd be a large undertaking, but have you considered switching from veekun to smogon's API? it seems to be more up to date.

@Naramsim
Copy link
Member

No, we haven't considered it. I didn't even know that Smogon is offering a set of APIs, could you post a link to these ones?

I also think that Smogon data could be significantly different from the one of Veekun, different in format and different in variety (I expect much more pokemon-battle related data than general-data such as the one we are currently offering)

@takeshi-codes
Copy link

They don't have explicit APIs per-se, but the repo itself has typescript files that contains the data they use.

As for format and variety of the data, it is structured differently than that of Veekun. Although having the data at hand vs having to manually add/create the csv files, you could probably automate a good chunk of what you need done.

Given that this is a python-based repo, it would take a bit for me to get ramped up as I don't really know python, I primarily work in js. But I am willing to help, I use PokeAPI A LOT.

@Naramsim
Copy link
Member

It would be cool to understand how do they get their data. If they get it automatically using a script then we could use the same source to update Veekun's data. Or maybe they add all the data manually. I don't know

I took a look at their data and, in the end, they only have a small chunk of Pokemon data, only the one needed for battles. And that data is also tuned by them to make fair battles.

@allowthisfam
Copy link

allowthisfam commented Jul 5, 2020

Bump.
Really like the Pokédex bot on Discord and would very like to see Gen 8 (up to atleast Zarude, if not Calyrex) added!
I'm aware of PokéAPI / Vekkun etc. Just hope it's not forgotten...

@Naramsim
Copy link
Member

Naramsim commented Aug 17, 2020

Hello to everyone in this long and old thread. I wanted to inform you that PokeAPI has new plans for updating the data with the new generation-8 one. We thought about relying a bit more on the PokeAPI community and allow it to contribute to the data we serve.

So, temporary, we will have our own veekun/pokedex fork, new data (taken from other sources than Veekun) can be submitted over there.

If you are interested in contributing, you are more than welcome! Please read this issue: #520

Just as a PoC we've scraped Bulbapedia for the new gen-8 pokemons and we've added some of their properties to the API. https://pokeapi.co/api/v2/generation/8/

@karsvaniersel @sfyfedotcom @route1rodent @skylarr1227(for the sprites), @dreki

Thanks to everyone!!

PS: I'll still have this issue open until Veekun will release all the data.

@Naramsim Naramsim unpinned this issue Aug 17, 2020
@Naramsim
Copy link
Member

Naramsim commented Jan 8, 2021

Closing since we added gen-8 pokemons.

For other gen-8 data, please look at #520

@Naramsim Naramsim closed this as completed Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants