https://github.com/pokeapi/pokeapi

The Pokémon API

https://github.com/pokeapi/pokeapi

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 175 committers (1.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.0%) to scientific vocabulary

Keywords

api beginner-friendly graphql hacktoberfest pokeapi pokemon

Keywords from Contributors

profiles interactive shellcodes tensors sequences parallel optimizing-compiler packaging autograding projection
Last synced: 5 months ago · JSON representation

Repository

The Pokémon API

Basic Info
  • Host: GitHub
  • Owner: PokeAPI
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: master
  • Homepage: https://pokeapi.co
  • Size: 45.7 MB
Statistics
  • Stars: 4,812
  • Watchers: 75
  • Forks: 1,030
  • Open Issues: 167
  • Releases: 7
Topics
api beginner-friendly graphql hacktoberfest pokeapi pokemon
Created about 11 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Security

README.md


PokeAPI [![build status](https://img.shields.io/circleci/project/github/PokeAPI/pokeapi/master.svg)](https://circleci.com/gh/PokeAPI/pokeapi) [![data status](https://img.shields.io/circleci/build/github/PokeAPI/api-data?label=data)](https://github.com/PokeAPI/api-data) [![deploy status](https://img.shields.io/circleci/build/github/PokeAPI/deploy?label=deploy)](https://github.com/PokeAPI/deploy) [![License](https://img.shields.io/github/license/PokeAPI/pokeapi.svg)](https://github.com/PokeAPI/pokeapi/blob/master/LICENSE.md) [![Backers on Open Collective](https://opencollective.com/pokeapi/backers/badge.svg)](https://opencollective.com/pokeapi) [![Sponsors on Open Collective](https://opencollective.com/pokeapi/sponsors/badge.svg)](https://opencollective.com/pokeapi)


A RESTful API for Pokémon - pokeapi.co

Beta GraphQL support is rolling out! Check out the GraphQL paragraph for more info.

Table of Contents

Setup   pyVersion312

  • Download this source code into a working directory, be sure to use the flag --recurse-submodules to clone also our submodules.

  • Install the requirements using pip:

    ```sh make install

    This will install all the required packages and libraries for using PokeAPI

    ```

  • Set up the local development environment using the following command:

    sh make setup

  • Run the server on port 8000 using the following command:

    sh make serve

Database setup

To build or rebuild the database by applying any CSV file update, run

sh make build-db

Visit localhost:8000/api/v2/ to see the running API!

Each time the build-db script is run, it will iterate over each table in the database, wipe it, and rewrite each row using the data found in data/v2/csv.

If you ever need to wipe the database use this command:

sh make wipe-sqlite-db

If the database schema has changed, generate any outstanding migrations and apply them

sh make make-migrations make migrate

Run make help to see all tasks.

Docker and Compose   docker hub

There is also a multi-container setup, managed by Docker Compose V2. This setup allows you to deploy a production-like environment, with separate containers for each service, and is recommended if you need to simply spin up PokéAPI.

Start everything by

sh make docker-setup

If you don't have make on your machine you can use the following commands

sh docker compose up -d docker compose exec -T app python manage.py migrate --settings=config.docker-compose docker compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell --settings=config.docker-compose'

Browse localhost/api/v2/ or localhost/api/v2/pokemon/bulbasaur/ on port 80.

To rebuild the database and apply any CSV file updates, run

sh make docker-build-db

If the database schema has changed, generate the migrations and apply those

sh make docker-make-migrations make docker-migrate

GraphQL  

When you start PokéAPI with the above Docker Compose setup, an Hasura Engine server is started as well. It's possible to track all the PokeAPI tables and foreign keys by simply

```sh

hasura cli needs to be installed and available in your $PATH: https://hasura.io/docs/latest/graphql/core/hasura-cli/install-hasura-cli.html

hasura cli's version has to greater than v2.48.1

make hasura-apply ```

When finished browse http://localhost:8080 and you will find the admin console. The GraphQL endpoint will be hosted at http://localhost:8080/v1/graphql.

A free public GraphiQL console is browsable at the address https://beta.pokeapi.co/graphql/console/. The relative GraphQL endpoint is accessible at https://beta.pokeapi.co/graphql/v1beta

A set of examples is provided in the directory /graphql/examples of this repository.

Kubernetes   Build Docker image and create k8s with it

Kustomize files are provided in the folder https://github.com/PokeAPI/pokeapi/tree/master/Resources/k8s/kustomize/base/. Create and change your secrets:

```sh cp Resources/k8s/kustomize/base/secrets/postgres.env.sample Resources/k8s/kustomize/base/secrets/postgres.env cp Resources/k8s/kustomize/base/secrets/graphql.env.sample Resources/k8s/kustomize/base/secrets/graphql.env cp Resources/k8s/kustomize/base/config/pokeapi.env.sample Resources/k8s/kustomize/base/config/pokeapi.env

Edit the newly created files

```

Configure kubectl to point to a cluster and then run the following commands to start a PokéAPI service.

```sh kubectl apply -k Resources/k8s/kustomize/base/ kubectl config set-context --current --namespace pokeapi # (Optional) Set pokeapi ns as the working ns

Wait for the cluster to spin up

kubectl exec --namespace pokeapi deployment/pokeapi -- python manage.py migrate --settings=config.docker-compose # Migrate the DB kubectl exec --namespace pokeapi deployment/pokeapi -- sh -c 'echo "from data.v2.build import buildall; buildall()" | python manage.py shell --settings=config.docker-compose' # Build the db kubectl wait --namespace pokeapi --timeout=120s --for=condition=complete job/load-graphql # Wait for Graphql configuration job to finish ```

This k8s setup creates all k8s resources inside the Namespace pokeapi, run kubectl delete namespace pokeapi to delete them. It also creates a Service of type LoadBalancer which is exposed on port 80 and 443. Data is persisted on 12Gi of ReadWriteOnce volumes.

Wrappers

| Official wrapper | Repository | Features | | --- | --- | --- | | Node server-side | PokeAPI/pokedex-promise-v2 | Auto caching | | Browser client-side | PokeAPI/pokeapi-js-wrapper | Auto caching, Image caching | | Java/Kotlin | PokeAPI/pokekotlin | | | Python 2/3 | PokeAPI/pokepy | Auto caching | | Python 3 | PokeAPI/pokebase | Auto caching, Image caching |

|Wrapper|Repository|Features| |---|---|---| |.Net Standard |mtrdp642/PokeApiNet|Auto caching | |Dart|prathanbomb/pokedart| | |Go|mtslzr/pokeapi-go|Auto caching | |Go|JoshGuarino/PokeGo |Auto caching | |PHP |lmerotta/phpokeapi|Auto caching, lazy loading | |PowerShell|Celerium/PokeAPI-PowerShellWrapper| | |Python|beastmatser/aiopokeapi|Auto caching, asynchronous | |Ruby|rdavid1099/poke-api-v2| | |Rust|lunik1/pokerust|Auto caching | |Scala |juliano/pokeapi-scala|Auto caching | |Spring Boot |dlfigueira/spring-pokeapi|Auto caching | |Swift |kinkofer/PokemonAPI| | |Typescript server-side/client-side|Gabb-c/Pokenode-ts|Auto caching |

Donations

Help to keep PokéAPI running! If you're using PokéAPI as a teaching resource or for a project, consider sending us a donation to help keep the service up. We get 1+ billion requests a month!

Thank you to all our backers! Become a backer

Join Us On Slack!

Warning Currently no maintainer has enough free time to support the community on Slack. Our Slack is in an unmaintained status.

Have a question or just want to discuss new ideas and improvements? Hit us up on Slack. ~~Consider talking with us here before creating a new issue.~~ This way we can keep issues here a bit more organized and helpful in the long run. Be excellent to each other :smile:

Sign up easily!

Once you've signed up visit PokéAPI on Slack

Contributing

This project exists thanks to all the people who contribute

All contributions are welcome: bug fixes, data contributions, and recommendations.

Please see the issues on GitHub before you submit a pull request or raise an issue, someone else might have beat you to it.

To contribute to this repository:

  • Fork the project to your own GitHub profile

  • Download the forked project using git clone:

    sh git clone --recurse-submodules git@github.com:<YOUR_USERNAME>/pokeapi.git

  • Create a new branch with a descriptive name:

    sh git checkout -b my_new_branch

  • Write some code, fix something, and add a test to prove that it works. No pull request will be accepted without tests passing, or without new tests if new features are added.

  • Commit your code and push it to GitHub

  • Open a new pull request and describe the changes you have made.

  • We'll accept your changes after review.

Simple!

Owner

  • Name: PokéAPI
  • Login: PokeAPI
  • Kind: organization
  • Email: team@pokeapi.co
  • Location: Kanto

The PokéAPI project

GitHub Events

Total
  • Create event: 23
  • Commit comment event: 1
  • Release event: 1
  • Issues event: 84
  • Watch event: 625
  • Delete event: 6
  • Issue comment event: 347
  • Push event: 113
  • Pull request review comment event: 8
  • Pull request review event: 24
  • Pull request event: 120
  • Fork event: 113
Last Year
  • Create event: 23
  • Commit comment event: 1
  • Release event: 1
  • Issues event: 84
  • Watch event: 625
  • Delete event: 6
  • Issue comment event: 347
  • Push event: 113
  • Pull request review comment event: 8
  • Pull request review event: 24
  • Pull request event: 120
  • Fork event: 113

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 1,306
  • Total Committers: 175
  • Avg Commits per committer: 7.463
  • Development Distribution Score (DDS): 0.641
Past Year
  • Commits: 161
  • Committers: 34
  • Avg Commits per committer: 4.735
  • Development Distribution Score (DDS): 0.528
Top Committers
Name Email Commits
Alessandro Pezzè i****i@g****m 469
Adickes z****x@g****m 89
giginet g****t@g****m 75
indyandie 1****e 58
Simply BLG 6****v 54
Julian Lawrance j****e@g****m 48
phalt p****t@g****m 41
Charles Marttinen m****l@c****a 26
Justin Marquez j****z@w****u 19
Simón Oroño s****o@p****m 18
Robert Williams r****1@g****m 17
Penelope Yong p****m@g****m 17
Sargun Vohra s****r@g****m 16
Christian Garza 1****a 14
Dalton d****s@g****m 12
bitomic 3****c 11
Wyatt Condon w****n@g****m 10
PoroCYon P****n 10
Raghav Nair n****v@h****m 8
Deleca 4****5 7
Sebastien Bürky me@n****e 7
Ryan Voice r****e@c****t 7
Christian d****r@d****v 7
PraaneshSelvaraj p****3@g****m 7
Ricky Elrod r****y@e****e 6
Benjamin Takacs b****b@b****e 5
Mordechai Zuber m****3@g****m 5
Joel Helbling h****l@g****m 5
tillfox f****x@g****m 4
gabe g****v@f****m 4
and 145 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 242
  • Total pull requests: 371
  • Average time to close issues: 4 months
  • Average time to close pull requests: 12 days
  • Total issue authors: 175
  • Total pull request authors: 103
  • Average comments per issue: 3.18
  • Average comments per pull request: 2.3
  • Merged pull requests: 288
  • Bot issues: 0
  • Bot pull requests: 12
Past Year
  • Issues: 73
  • Pull requests: 143
  • Average time to close issues: 7 days
  • Average time to close pull requests: 3 days
  • Issue authors: 54
  • Pull request authors: 33
  • Average comments per issue: 1.51
  • Average comments per pull request: 1.86
  • Merged pull requests: 114
  • Bot issues: 0
  • Bot pull requests: 12
Top Authors
Issue Authors
  • GreatNovaDragon (9)
  • Pinsplash (8)
  • Naramsim (7)
  • justingolden21 (6)
  • blevy115 (5)
  • DaltonSW (5)
  • tillfox (4)
  • FallenDeity (4)
  • SimplyBLGDev (3)
  • digitalghost-dev (3)
  • Waanma (3)
  • Deleca7755 (3)
  • giginet (3)
  • JRuffs7 (2)
  • TonyCollett (2)
Pull Request Authors
  • Naramsim (76)
  • giginet (32)
  • DaltonSW (16)
  • jemarq04 (13)
  • dependabot[bot] (12)
  • AndryCola (12)
  • Indyandie (9)
  • Deleca7755 (8)
  • SKCwillie (6)
  • GreatNovaDragon (6)
  • aserra54 (6)
  • penelopeysm (5)
  • lati111 (5)
  • KritPaoIn (5)
  • programgames (5)
Top Labels
Issue Labels
help wanted (6) question (4) bug (2) enhancement (2) duplicate (1) graphql (1) cloudflare (1) v3 (1)
Pull Request Labels
no-deploy (27) dependencies (12) docker (7) github_actions (5) v3 (2) invalid (1)

Packages

  • Total packages: 2
  • Total downloads: unknown
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 45
proxy.golang.org: github.com/PokeAPI/pokeapi
  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 6 months ago
proxy.golang.org: github.com/pokeapi/pokeapi
  • Versions: 38
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 6 months ago

Dependencies

graphql/examples/node/package-lock.json npm
  • node-fetch 2.6.1
graphql/examples/node/package.json npm
  • node-fetch ^2.6.1
requirements.txt pypi
  • Django ==2.1.15
  • Unipath ==1.1
  • coverage ==4.5.1
  • django-appconf ==1.0.4
  • django-cachalot ==2.3.5
  • django-cors-headers ==2.5.3
  • django-discover-runner ==1.0
  • django-redis ==4.10.0
  • django-tastypie ==0.14.3
  • djangorestframework ==3.9.4
  • drf-ujson ==1.2.0
  • gunicorn ==20.1.0
  • mimeparse ==0.1.3
  • psycopg2 ==2.8.6
  • python-dateutil ==2.8.1
  • python-mimeparse ==1.6.0
  • simplejson ==3.17.2
  • six ==1.15.0
test-requirements.txt pypi
  • astroid ==2.5.6
  • black ==22.3.0
  • pylint ===2.8.2
  • pylint-django ===2.4.4
.github/workflows/docker-image.yml actions
  • actions/checkout v2 composite
  • docker/build-push-action v2 composite
  • docker/login-action v1 composite
  • docker/metadata-action v3 composite
  • docker/setup-buildx-action v1 composite
  • docker/setup-qemu-action v1 composite
.github/workflows/kustomize.yml actions
  • actions/checkout v2 composite
  • helm/kind-action v1.1.0 composite
Resources/compose/docker-compose-prod-graphql.yml docker
  • hasura/graphql-engine v2.16.1
  • nginx 1.23.3-alpine
  • pokeapi/graphiql 1.0.1
  • pokeapi/pokeapi master
  • postgres 15.1
  • redis 7.0.7-alpine
Resources/docker/app/Dockerfile docker
  • python 3.10-alpine build
docker-compose.override.yml docker
  • pokeapi/pokeapi master
docker-compose.yml docker
  • hasura/graphql-engine v2.16.1
  • nginx 1.23.3-alpine
  • postgres 15.1
  • redis 7.0.7-alpine
docker-compose-dev.yml docker
.github/workflows/docker-build.yml actions
  • actions/checkout v4 composite
  • docker/build-push-action v5 composite
  • docker/metadata-action v5 composite
  • docker/setup-buildx-action v3 composite
  • docker/setup-qemu-action v3 composite