From 63bf5179a7551100cc3991551f829b1ae53574e4 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Thu, 1 Feb 2024 18:49:24 +0100 Subject: [PATCH 01/22] refactor: use compose V2 --- .dockerignore | 4 ++-- Makefile | 20 ++++++++++---------- README.md | 6 +++--- Resources/docker/app/README.md | 2 +- config/settings.py | 2 +- data/v2/cries | 1 + docker-compose-dev.yml | 2 +- 7 files changed, 19 insertions(+), 18 deletions(-) create mode 160000 data/v2/cries diff --git a/.dockerignore b/.dockerignore index dd4e3be51..284495135 100644 --- a/.dockerignore +++ b/.dockerignore @@ -18,10 +18,10 @@ graphql .vscode .github .circleci -docker-compose.yml +docker-compose* .dockerignore /*.md /*.js .env *pycache* -target \ No newline at end of file +target diff --git a/Makefile b/Makefile index 33d903101..c6c9e772f 100755 --- a/Makefile +++ b/Makefile @@ -42,38 +42,38 @@ shell: # Load a shell python manage.py shell ${local_config} docker-up: # (Docker) Create services/volumes/networks - docker-compose up -d + docker compose up -d docker-migrate: # (Docker) Run any pending migrations - docker-compose exec -T app python manage.py migrate ${docker_config} + docker compose exec -T app python manage.py migrate ${docker_config} docker-build-db: # (Docker) Build the database - docker-compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${docker_config}' + docker compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${docker_config}' docker-make-migrations: # (Docker) Create migrations files if schema has changed - docker-compose exec -T app sh -c 'python manage.py makemigrations ${docker_config}' + docker compose exec -T app sh -c 'python manage.py makemigrations ${docker_config}' docker-flush-db: # (Docker) Removes all the data present in the database but preserves tables and migrations - docker-compose exec -T app sh -c 'python manage.py flush --no-input ${docker_config}' + docker compose exec -T app sh -c 'python manage.py flush --no-input ${docker_config}' docker-destroy-db: # (Docker) Removes the volume where the database is installed on, alongside to the container itself docker rm -f pokeapi_db_1 docker volume rm pokeapi_pg_data docker-shell: # (Docker) Launch an interative shell for the pokeapi container - docker-compose exec app sh -l + docker compose exec app sh -l docker-stop: # (Docker) Stop containers - docker-compose stop + docker compose stop docker-down: # (Docker) Stop and removes containers and networks - docker-compose down + docker compose down docker-test: # (Docker) Run tests - docker-compose exec -T app python manage.py test ${local_config} + docker compose exec -T app python manage.py test ${local_config} docker-prod: - docker-compose -f docker-compose.yml -f docker-compose.override.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d + docker compose -f docker-compose.yml -f docker-compose.override.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d docker-setup: docker-up docker-migrate docker-build-db # (Docker) Start services, prepare the latest DB schema, populate the DB diff --git a/README.md b/README.md index d9cc331eb..57fa2aadf 100755 --- a/README.md +++ b/README.md @@ -83,9 +83,9 @@ 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' +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/](http://localhost/api/v2/) or [localhost/api/v2/pokemon/bulbasaur/](http://localhost/api/v2/pokemon/bulbasaur/) on port `80`. diff --git a/Resources/docker/app/README.md b/Resources/docker/app/README.md index 8e2b87794..48c5d5486 100644 --- a/Resources/docker/app/README.md +++ b/Resources/docker/app/README.md @@ -35,7 +35,7 @@ The container connects to a Redis cache via the environment variable `REDIS_CONN ### Run the container -The container exposes port `80`. It needs a PostgreSQL and a Redis instance to connect to. Refer to the section [How to use this image](./how-to-use-this-image) for mapping the environment variables. +The container exposes port `80`. It needs a PostgreSQL and a Redis instance to connect to. Refer to the section [How to use this image](#how-to-use-this-image) for mapping the environment variables. It's recommended to use the provided [docker-compose.yml](https://github.com/PokeAPI/pokeapi/blob/master/docker-compose.yml) to start a container from this image. diff --git a/config/settings.py b/config/settings.py index 8213dd2e0..5a159bd1d 100755 --- a/config/settings.py +++ b/config/settings.py @@ -9,7 +9,7 @@ TEMPLATE_DEBUG = DEBUG ADMINS = ( - os.environ.get("ADMINS", "Paul Hallett,paulandrewhallett@gmail.com").split(","), + os.environ.get("ADMINS", "Pokeapi,team@pokeapi.co").split(","), ) EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" diff --git a/data/v2/cries b/data/v2/cries new file mode 160000 index 000000000..8584048df --- /dev/null +++ b/data/v2/cries @@ -0,0 +1 @@ +Subproject commit 8584048df8f55ee1c436da23b378316e9d416a9b diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 77e0dc5e4..4df009e6f 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -6,4 +6,4 @@ services: context: . dockerfile: ./Resources/docker/app/Dockerfile -# docker-compose -f docker-compose.yml -f docker-compose-dev.yml up -d +# docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d From 02baf0b3ef2f6706f032095e9f43bf3a2da899bd Mon Sep 17 00:00:00 2001 From: FallenDeity <61227305+FallenDeity@users.noreply.github.com> Date: Sat, 3 Feb 2024 00:15:39 +0530 Subject: [PATCH 02/22] feat: :sparkles: Add pokemon cries Add pokemon cries resource field to pokemon endpoint --- data/v2/build.py | 40 +++++++++++++++++++++- pokemon_v2/migrations/0015_pokemoncries.py | 25 ++++++++++++++ pokemon_v2/models.py | 5 +++ pokemon_v2/serializers.py | 6 ++++ pokemon_v2/tests.py | 29 ++++++++++++++++ 5 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 pokemon_v2/migrations/0015_pokemoncries.py diff --git a/data/v2/build.py b/data/v2/build.py index 76561b22f..e44e74f25 100644 --- a/data/v2/build.py +++ b/data/v2/build.py @@ -36,8 +36,16 @@ "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/", ) ) +SOUND_DIR = "{prefix}{{file_name}}".format( + prefix=os.environ.get( + "POKEAPI_CRIES_PREFIX", + "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/", + ) +) IMAGE_DIR = os.getcwd() + "/data/v2/sprites/sprites/" +CRIES_DIR = os.getcwd() + "/data/v2/cries/cries/" RESOURCE_IMAGES = [] +RESOURCE_CRIES = [] for root, dirs, files in os.walk(IMAGE_DIR): for file in files: @@ -45,8 +53,18 @@ image_path = image_path.replace("\\", "/") # convert Windows-style path to Unix RESOURCE_IMAGES.append(image_path) +for root, dirs, files in os.walk(CRIES_DIR): + for file in files: + cry_path = os.path.join(root.replace(CRIES_DIR, ""), file) + cry_path = cry_path.replace("\\", "/") # convert Windows-style path to Unix + RESOURCE_CRIES.append(cry_path) -def file_path_or_none(file_name): + +def file_path_or_none(file_name, image_file=True): + if not image_file: + return ( + SOUND_DIR.format(file_name=file_name) if file_name in RESOURCE_CRIES else None + ) return ( MEDIA_DIR.format(file_name=file_name) if file_name in RESOURCE_IMAGES else None ) @@ -1931,6 +1949,26 @@ def csv_record_to_objects(info): build_generic((PokemonSprites,), "pokemon.csv", csv_record_to_objects) + def try_cry_names(path, info, extension): + file_name = "%s.%s" % (info[0], extension) + return file_path_or_none(path + file_name, image_file=False) + + def csv_record_to_objects(info): + poke_cries = "pokemon" + latest = f"{poke_cries}/latest/" + legacy = f"{poke_cries}/legacy/" + cries = { + "latest": try_cry_names(latest, info, "ogg"), + "legacy": try_cry_names(legacy, info, "ogg"), + } + yield PokemonCries( + id=int(info[0]), + pokemon=Pokemon.objects.get(pk=int(info[0])), + cries=cries, + ) + + build_generic((PokemonCries,), "pokemon.csv", csv_record_to_objects) + def csv_record_to_objects(info): yield PokemonAbility( pokemon_id=int(info[0]), diff --git a/pokemon_v2/migrations/0015_pokemoncries.py b/pokemon_v2/migrations/0015_pokemoncries.py new file mode 100644 index 000000000..da262976c --- /dev/null +++ b/pokemon_v2/migrations/0015_pokemoncries.py @@ -0,0 +1,25 @@ +# Generated by Django 3.2.23 on 2024-02-02 18:02 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('pokemon_v2', '0014_auto_20231121_1209'), + ] + + operations = [ + migrations.CreateModel( + name='PokemonCries', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cries', models.JSONField()), + ('pokemon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pokemoncries', to='pokemon_v2.pokemon')), + ], + options={ + 'abstract': False, + }, + ), + ] diff --git a/pokemon_v2/models.py b/pokemon_v2/models.py index ed6622dc3..afcddffd8 100644 --- a/pokemon_v2/models.py +++ b/pokemon_v2/models.py @@ -1796,3 +1796,8 @@ class PokemonTypePast(HasPokemon, HasType, HasGeneration): class PokemonSprites(HasPokemon): sprites = models.JSONField() + + +class PokemonCries(HasPokemon): + cries = models.JSONField() + diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index b1acff77c..381dd7cfb 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2722,6 +2722,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): held_items = serializers.SerializerMethodField("get_pokemon_held_items") location_area_encounters = serializers.SerializerMethodField("get_encounters") sprites = serializers.SerializerMethodField("get_pokemon_sprites") + cries = serializers.SerializerMethodField("get_pokemon_cries") class Meta: model = Pokemon @@ -2742,6 +2743,7 @@ class Meta: "moves", "species", "sprites", + "cries", "stats", "types", "past_types", @@ -2750,6 +2752,10 @@ class Meta: def get_pokemon_sprites(self, obj): sprites_object = PokemonSprites.objects.get(pokemon_id=obj) return sprites_object.sprites + + def get_pokemon_cries(self, obj): + cries_object = PokemonCries.objects.get(pokemon_id=obj) + return cries_object.cries def get_pokemon_moves(self, obj): version_objects = VersionGroup.objects.all() diff --git a/pokemon_v2/tests.py b/pokemon_v2/tests.py index 57ef4a14b..00f68145a 100644 --- a/pokemon_v2/tests.py +++ b/pokemon_v2/tests.py @@ -1724,6 +1724,20 @@ def setup_pokemon_sprites_data( pokemon_sprites.save() return pokemon_sprites + + @classmethod + def setup_pokemon_cries_data(cls, pokemon, latest=True, legacy=False): + cries_path = "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/%s.ogg" + cries = { + "latest": cries_path % f"latest/{pokemon.id}" if latest else None, + "legacy": cries_path % f"legacy/{pokemon.id}" if legacy else None, + } + pokemon_cries = PokemonCries.objects.create( + pokemon=pokemon, + cries=json.dumps(cries) + ) + pokemon_cries.save() + return pokemon_cries # Evolution Data @classmethod @@ -4596,6 +4610,7 @@ def test_pokemon_species_api(self): pokemon_species=pokemon_species, name="pkm for base pkmn spcs" ) self.setup_pokemon_sprites_data(pokemon) + self.setup_pokemon_cries_data(pokemon) response = self.client.get( "{}/pokemon-species/{}/".format(API_V2, pokemon_species.pk), @@ -4816,6 +4831,7 @@ def test_pokemon_api(self): ) pokemon_item = self.setup_pokemon_item_data(pokemon=pokemon) pokemon_sprites = self.setup_pokemon_sprites_data(pokemon=pokemon) + pokemon_cries = self.setup_pokemon_cries_data(pokemon, latest=True, legacy=True) pokemon_game_index = self.setup_pokemon_game_index_data( pokemon=pokemon, game_index=10 ) @@ -5052,7 +5068,9 @@ def test_pokemon_api(self): ) sprites_data = json.loads(pokemon_sprites.sprites) + cries_data = json.loads(pokemon_cries.cries) response_sprites_data = json.loads(response.data["sprites"]) + response_cries_data = json.loads(response.data["cries"]) # sprite params self.assertEqual( @@ -5070,6 +5088,17 @@ def test_pokemon_api(self): response_sprites_data["other"]["showdown"]["back_default"], ) + # cries params + self.assertEqual( + cries_data["latest"], + "{}".format(cries_data["latest"]), + ) + self.assertEqual( + cries_data["legacy"], + "{}".format(cries_data["legacy"]), + ) + + def test_pokemon_form_api(self): pokemon_species = self.setup_pokemon_species_data() pokemon = self.setup_pokemon_data(pokemon_species=pokemon_species) From 4828b938603d5f09f4d686f6ab5afd287f38551e Mon Sep 17 00:00:00 2001 From: FallenDeity <61227305+FallenDeity@users.noreply.github.com> Date: Sat, 3 Feb 2024 00:32:51 +0530 Subject: [PATCH 03/22] style: Run black formatter on source --- data/v2/build.py | 4 ++- pokemon_v2/migrations/0015_pokemoncries.py | 30 +++++++++++++++++----- pokemon_v2/models.py | 1 - pokemon_v2/serializers.py | 2 +- pokemon_v2/tests.py | 10 ++++---- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/data/v2/build.py b/data/v2/build.py index e44e74f25..4c3eae767 100644 --- a/data/v2/build.py +++ b/data/v2/build.py @@ -63,7 +63,9 @@ def file_path_or_none(file_name, image_file=True): if not image_file: return ( - SOUND_DIR.format(file_name=file_name) if file_name in RESOURCE_CRIES else None + SOUND_DIR.format(file_name=file_name) + if file_name in RESOURCE_CRIES + else None ) return ( MEDIA_DIR.format(file_name=file_name) if file_name in RESOURCE_IMAGES else None diff --git a/pokemon_v2/migrations/0015_pokemoncries.py b/pokemon_v2/migrations/0015_pokemoncries.py index da262976c..05099ce1c 100644 --- a/pokemon_v2/migrations/0015_pokemoncries.py +++ b/pokemon_v2/migrations/0015_pokemoncries.py @@ -5,21 +5,37 @@ class Migration(migrations.Migration): - dependencies = [ - ('pokemon_v2', '0014_auto_20231121_1209'), + ("pokemon_v2", "0014_auto_20231121_1209"), ] operations = [ migrations.CreateModel( - name='PokemonCries', + name="PokemonCries", fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('cries', models.JSONField()), - ('pokemon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pokemoncries', to='pokemon_v2.pokemon')), + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("cries", models.JSONField()), + ( + "pokemon", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="pokemoncries", + to="pokemon_v2.pokemon", + ), + ), ], options={ - 'abstract': False, + "abstract": False, }, ), ] diff --git a/pokemon_v2/models.py b/pokemon_v2/models.py index afcddffd8..d7d0e48a1 100644 --- a/pokemon_v2/models.py +++ b/pokemon_v2/models.py @@ -1800,4 +1800,3 @@ class PokemonSprites(HasPokemon): class PokemonCries(HasPokemon): cries = models.JSONField() - diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 381dd7cfb..c7a4773c8 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2752,7 +2752,7 @@ class Meta: def get_pokemon_sprites(self, obj): sprites_object = PokemonSprites.objects.get(pokemon_id=obj) return sprites_object.sprites - + def get_pokemon_cries(self, obj): cries_object = PokemonCries.objects.get(pokemon_id=obj) return cries_object.cries diff --git a/pokemon_v2/tests.py b/pokemon_v2/tests.py index 00f68145a..e458f467c 100644 --- a/pokemon_v2/tests.py +++ b/pokemon_v2/tests.py @@ -1724,17 +1724,18 @@ def setup_pokemon_sprites_data( pokemon_sprites.save() return pokemon_sprites - + @classmethod def setup_pokemon_cries_data(cls, pokemon, latest=True, legacy=False): - cries_path = "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/%s.ogg" + cries_path = ( + "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/%s.ogg" + ) cries = { "latest": cries_path % f"latest/{pokemon.id}" if latest else None, "legacy": cries_path % f"legacy/{pokemon.id}" if legacy else None, } pokemon_cries = PokemonCries.objects.create( - pokemon=pokemon, - cries=json.dumps(cries) + pokemon=pokemon, cries=json.dumps(cries) ) pokemon_cries.save() return pokemon_cries @@ -5098,7 +5099,6 @@ def test_pokemon_api(self): "{}".format(cries_data["legacy"]), ) - def test_pokemon_form_api(self): pokemon_species = self.setup_pokemon_species_data() pokemon = self.setup_pokemon_data(pokemon_species=pokemon_species) From e0a877be9b85ef81bc7844158d49879f97a51fcf Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Fri, 2 Feb 2024 15:16:58 -0600 Subject: [PATCH 04/22] Updating MoveDetailSerializer to change $effect_chance to actual number --- data/v2/csv/move_effect_prose.csv | 4 +--- pokemon_v2/serializers.py | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/data/v2/csv/move_effect_prose.csv b/data/v2/csv/move_effect_prose.csv index 958ddbdf4..3ad875593 100644 --- a/data/v2/csv/move_effect_prose.csv +++ b/data/v2/csv/move_effect_prose.csv @@ -153,9 +153,7 @@ This move cannot be copied by []{move:mimic} or []{move:mirror-move}, nor select The user takes damage instead of being healed if the target has []{ability:liquid-ooze}. []{move:rapid-spin} will remove this effect. - -This effect is passed on by []{move:baton-pass}." -86,9,Does nothing.,"Does nothing. +7,9,Has a $e. This move cannot be used while []{move:gravity} is in effect." 87,9,Disables the target's last used move for 1-8 turns.,"Disables the target's last used move, preventing its use for 4–7 turns, selected at random, or until the target leaves the [field]{mechanic:field}. If the target hasn't used a move since entering the [field]{mechanic:field}, if it tried to use a move this turn and [failed]{mechanic:failed}, if its last used move has 0 PP remaining, or if it already has a move disabled, this move will fail." diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index b1acff77c..b6367bc8f 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2343,7 +2343,12 @@ def get_effect_text(self, obj): data = MoveEffectEffectTextSerializer( effect_texts, many=True, context=self.context ).data - + effect_entries = data[0] + for i, k in enumerate(effect_entries): + print(i, k) + if '$effect_chance%' in effect_entries[k]: + data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') + return data def get_effect_change_text(self, obj): From ccd44796c48c756f99d82e83a030d92b4b11a731 Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Fri, 2 Feb 2024 17:06:36 -0600 Subject: [PATCH 05/22] fixing a debugging print line --- pokemon_v2/serializers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index b6367bc8f..7c45acdef 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2345,7 +2345,6 @@ def get_effect_text(self, obj): ).data effect_entries = data[0] for i, k in enumerate(effect_entries): - print(i, k) if '$effect_chance%' in effect_entries[k]: data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') From 77b974161e500d2c6ed94b4491ca3222fb1db1b5 Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Fri, 2 Feb 2024 17:24:03 -0600 Subject: [PATCH 06/22] replacing move_effect_prose.csv with original --- data/v2/csv/move_effect_prose.csv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/v2/csv/move_effect_prose.csv b/data/v2/csv/move_effect_prose.csv index 3ad875593..958ddbdf4 100644 --- a/data/v2/csv/move_effect_prose.csv +++ b/data/v2/csv/move_effect_prose.csv @@ -153,7 +153,9 @@ This move cannot be copied by []{move:mimic} or []{move:mirror-move}, nor select The user takes damage instead of being healed if the target has []{ability:liquid-ooze}. []{move:rapid-spin} will remove this effect. -7,9,Has a $e. + +This effect is passed on by []{move:baton-pass}." +86,9,Does nothing.,"Does nothing. This move cannot be used while []{move:gravity} is in effect." 87,9,Disables the target's last used move for 1-8 turns.,"Disables the target's last used move, preventing its use for 4–7 turns, selected at random, or until the target leaves the [field]{mechanic:field}. If the target hasn't used a move since entering the [field]{mechanic:field}, if it tried to use a move this turn and [failed]{mechanic:failed}, if its last used move has 0 PP remaining, or if it already has a move disabled, this move will fail." From 8f9fd71aa65b3b5d331a36489584164140fd8202 Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Sat, 3 Feb 2024 21:56:25 -0600 Subject: [PATCH 07/22] removing unnecessary line --- pokemon_v2/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 7c45acdef..ddd80eb92 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2343,10 +2343,10 @@ def get_effect_text(self, obj): data = MoveEffectEffectTextSerializer( effect_texts, many=True, context=self.context ).data + effect_entries = data[0] for i, k in enumerate(effect_entries): - if '$effect_chance%' in effect_entries[k]: - data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') + data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') return data From 12db174d1e2c6cbd0daec10a6fc91e17a4da8246 Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Sat, 3 Feb 2024 22:02:23 -0600 Subject: [PATCH 08/22] that line was needed after all --- pokemon_v2/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index ddd80eb92..7c45acdef 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2343,10 +2343,10 @@ def get_effect_text(self, obj): data = MoveEffectEffectTextSerializer( effect_texts, many=True, context=self.context ).data - effect_entries = data[0] for i, k in enumerate(effect_entries): - data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') + if '$effect_chance%' in effect_entries[k]: + data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') return data From d65c74007ce1dd2f92e4e8875b269b2fdea9e4f4 Mon Sep 17 00:00:00 2001 From: Doug Haber Date: Sun, 4 Feb 2024 12:16:07 -0500 Subject: [PATCH 09/22] Mark indeedee and oinkologne as having gender differences as per https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_with_gender_differences --- data/v2/csv/pokemon_species.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/v2/csv/pokemon_species.csv b/data/v2/csv/pokemon_species.csv index 5ef809507..df819fda2 100644 --- a/data/v2/csv/pokemon_species.csv +++ b/data/v2/csv/pokemon_species.csv @@ -874,7 +874,7 @@ id,identifier,generation_id,evolves_from_species_id,evolution_chain_id,color_id, 873,frosmoth,8,872,455,9,13,,4,75,50,0,20,0,2,0,0,0,873, 874,stonjourner,8,,456,4,7,,4,60,50,0,25,0,1,0,0,0,874, 875,eiscue,8,,457,2,6,,4,60,50,0,25,0,1,0,0,0,875, -876,indeedee,8,,458,7,6,,4,30,140,0,40,0,3,0,0,0,876, +876,indeedee,8,,458,7,6,,4,30,140,0,40,1,3,0,0,0,876, 877,morpeko,8,,459,10,12,,4,180,50,0,10,0,2,0,0,0,877, 878,cufant,8,,460,10,8,,4,190,50,0,25,0,2,0,0,0,878, 879,copperajah,8,878,460,5,8,,4,90,50,0,25,0,2,0,0,0,879, @@ -914,7 +914,7 @@ id,identifier,generation_id,evolves_from_species_id,evolution_chain_id,color_id, 913,quaxwell,9,912,480,2,,,1,45,50,0,20,0,4,0,0,0,913, 914,quaquaval,9,913,480,2,,,1,45,50,0,20,0,4,0,0,0,914, 915,lechonk,9,,481,4,,,4,255,50,0,15,0,2,0,0,0,915, -916,oinkologne,9,915,481,4,,,0,100,50,0,15,0,2,0,0,0,916, +916,oinkologne,9,915,481,4,,,0,100,50,0,15,1,2,0,0,0,916, 917,tarountula,9,,482,9,,,4,255,50,0,15,0,5,0,0,0,918, 918,spidops,9,917,482,5,,,4,120,50,0,15,0,5,0,0,0,919, 919,nymble,9,,483,4,,,4,190,20,0,20,0,2,0,0,0,920, From 2c3c7b2221ccc9bd45b36851a0eceb1119c81433 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Fri, 9 Feb 2024 19:34:47 +0100 Subject: [PATCH 10/22] chore: tweak nginx conf --- Resources/nginx/nginx.conf | 52 +++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/Resources/nginx/nginx.conf b/Resources/nginx/nginx.conf index 19797b045..0ce02689c 100644 --- a/Resources/nginx/nginx.conf +++ b/Resources/nginx/nginx.conf @@ -2,26 +2,32 @@ worker_processes 1; events { worker_connections 1024; - multi_accept on; # accept each connection as soon as you can + multi_accept on; accept_mutex off; use epoll; } http { - include mime.types; - default_type application/octet-stream; + access_log off; + log_format pokeapilogformat + '$remote_addr ' + '"$request" $status cs:$upstream_cache_status s:$bytes_sent ' + 'r:"$http_referer"'; + error_log /dev/stdout warn; + include mime.types; + default_type application/octet-stream; - server_tokens off; # dont send unnecessary server info (like version) + server_tokens off; - add_header X-XSS-Protection "1; mode=block"; # prevent XSS + add_header X-XSS-Protection "1; mode=block"; - client_body_buffer_size 10K; # raise the threshold by which requests are written to HDD instead of RAM - client_header_buffer_size 2k; - client_max_body_size 8m; # we dont accept requests larger that 8mb + client_body_buffer_size 10K; + client_header_buffer_size 1k; + client_max_body_size 8m; - sendfile on; - tcp_nopush on; - tcp_nodelay on; + sendfile on; + tcp_nopush on; + tcp_nodelay on; keepalive_timeout 5; @@ -47,6 +53,16 @@ http { 192.168.0.0/24 0; } + map $http_user_agent $exclude_ua { + "~*monitoring*" 0; + default 1; + } + + map $request_method $only_post { + default 0; + POST $exclude_ua; + } + map $limit $limit_key { 0 ""; 1 $binary_remote_addr; @@ -69,7 +85,7 @@ http { # Admin console location /graphql/admin/ { - expires 1m; # client-side caching, one minute for each API resource + expires 1m; add_header Cache-Control "public"; add_header Pragma public; proxy_http_version 1.1; @@ -89,21 +105,15 @@ http { } location /graphql/v1beta { + access_log /dev/stdout pokeapilogformat if=$only_post; include /ssl/cache.conf*; - # proxy_cache small; - # proxy_cache_valid 200 10d; - # proxy_cache_valid any 0; - # proxy_cache_methods POST; - # proxy_cache_key "$request_method$request_uri$request_body"; limit_req zone=graphqlDefaultLimit burst=100 nodelay; limit_req_status 429; - expires 30m; # client-side caching, one minute for each API resource + expires 30m; add_header Cache-Control "public"; add_header Pragma public; - # add_header X-Proxy-Cache $upstream_cache_status; proxy_hide_header Access-Control-Allow-Origin; add_header Access-Control-Allow-Origin *; - # add_header X-Cache-Date $upstream_http_date; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; @@ -115,7 +125,7 @@ http { } location /api/ { - expires 1m; # client-side caching, one minute for each API resource + expires 1m; add_header Cache-Control "public"; add_header Pragma public; proxy_set_header X-Real-IP $remote_addr; From 16f5cd4d7559b035ac1aee35ca1df508ab8b15c5 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Fri, 9 Feb 2024 19:48:52 +0100 Subject: [PATCH 11/22] chore: add logging --- Resources/compose/docker-compose-prod-graphql.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Resources/compose/docker-compose-prod-graphql.yml b/Resources/compose/docker-compose-prod-graphql.yml index a4670a123..9e8682285 100644 --- a/Resources/compose/docker-compose-prod-graphql.yml +++ b/Resources/compose/docker-compose-prod-graphql.yml @@ -13,6 +13,8 @@ services: web: volumes: - graphiql:/public-console:ro + logging: + driver: gcplogs graphql-engine: cpus: 0.7 From 9cdc44dd2dd000ca255c69de8ce73b3bc7b61e89 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Fri, 9 Feb 2024 20:13:57 +0100 Subject: [PATCH 12/22] chore: add gql metadata for cries --- .../default/tables/public_pokemon_v2_pokemon.yaml | 7 +++++++ graphql/metadata/databases/default/tables/tables.yaml | 1 + 2 files changed, 8 insertions(+) diff --git a/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemon.yaml b/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemon.yaml index 27851bc11..4c7308c5e 100644 --- a/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemon.yaml +++ b/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemon.yaml @@ -27,6 +27,13 @@ array_relationships: table: name: pokemon_v2_pokemonabilitypast schema: public + - name: pokemon_v2_pokemoncries + using: + foreign_key_constraint_on: + column: pokemon_id + table: + name: pokemon_v2_pokemoncries + schema: public - name: pokemon_v2_pokemonforms using: foreign_key_constraint_on: diff --git a/graphql/metadata/databases/default/tables/tables.yaml b/graphql/metadata/databases/default/tables/tables.yaml index 2e3301421..85ecc995e 100644 --- a/graphql/metadata/databases/default/tables/tables.yaml +++ b/graphql/metadata/databases/default/tables/tables.yaml @@ -110,6 +110,7 @@ - "!include public_pokemon_v2_pokemonabilitypast.yaml" - "!include public_pokemon_v2_pokemoncolor.yaml" - "!include public_pokemon_v2_pokemoncolorname.yaml" +- "!include public_pokemon_v2_pokemoncries.yaml" - "!include public_pokemon_v2_pokemondexnumber.yaml" - "!include public_pokemon_v2_pokemonegggroup.yaml" - "!include public_pokemon_v2_pokemonevolution.yaml" From c843a67a00dbc744530cd6dd5c528e8889b9ce7c Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Fri, 9 Feb 2024 23:30:52 -0600 Subject: [PATCH 13/22] fixing linter issue --- pokemon_v2/serializers.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 7c45acdef..d79e6cd69 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2344,10 +2344,12 @@ def get_effect_text(self, obj): effect_texts, many=True, context=self.context ).data effect_entries = data[0] - for i, k in enumerate(effect_entries): - if '$effect_chance%' in effect_entries[k]: - data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') - + for _i, k in enumerate(effect_entries): + if "$effect_chance%" in effect_entries[k]: + data[0][k] = effect_entries[k].replace( + "$effect_chance", f"{obj.move_effect_chance}" + ) + return data def get_effect_change_text(self, obj): From e7974e752003506d710f137132dc5f9fd61b93d2 Mon Sep 17 00:00:00 2001 From: Gudine Date: Sat, 10 Feb 2024 14:13:51 -0300 Subject: [PATCH 14/22] =?UTF-8?q?fix:=20sets=20is=5Fbattle=5Fonly=20to=20f?= =?UTF-8?q?alse=20on=20totem=20pok=C3=A9mon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/v2/csv/pokemon_forms.csv | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/data/v2/csv/pokemon_forms.csv b/data/v2/csv/pokemon_forms.csv index 515f9e13a..7584e404c 100644 --- a/data/v2/csv/pokemon_forms.csv +++ b/data/v2/csv/pokemon_forms.csv @@ -1218,7 +1218,7 @@ id,identifier,form_identifier,pokemon_id,introduced_in_version_group_id,is_defau 10192,beedrill-mega,mega,10090,16,1,1,1,2,20 10193,rattata-alola,alola,10091,17,1,0,0,2,26 10194,raticate-alola,alola,10092,17,1,0,0,2,28 -10195,raticate-totem-alola,totem-alola,10093,17,1,1,0,3,29 +10195,raticate-totem-alola,totem-alola,10093,17,1,0,0,3,29 10196,pikachu-original-cap,original-cap,10094,17,1,0,0,8,43 10197,pikachu-hoenn-cap,hoenn-cap,10095,17,1,0,0,9,44 10198,pikachu-sinnoh-cap,sinnoh-cap,10096,17,1,0,0,10,45 @@ -1246,15 +1246,15 @@ id,identifier,form_identifier,pokemon_id,introduced_in_version_group_id,is_defau 10220,zygarde-10-power-construct,10-power-construct,10118,17,1,0,0,3,1002 10221,zygarde-50-power-construct,50-power-construct,10119,17,1,0,0,4,1003 10222,zygarde-complete,complete,10120,17,1,0,0,5,1004 -10223,gumshoos-totem,totem,10121,17,1,1,0,2,1024 -10224,vikavolt-totem,totem,10122,17,1,1,0,2,1028 +10223,gumshoos-totem,totem,10121,17,1,0,0,2,1024 +10224,vikavolt-totem,totem,10122,17,1,0,0,2,1028 10225,oricorio-pom-pom,pom-pom,10123,17,1,0,0,2,1032 10226,oricorio-pau,pau,10124,17,1,0,0,3,1033 10227,oricorio-sensu,sensu,10125,17,1,0,0,4,1034 10228,lycanroc-midnight,midnight,10126,17,1,0,0,2,1041 10229,wishiwashi-school,school,10127,17,1,1,0,2,1044 -10230,lurantis-totem,totem,10128,17,1,1,0,2,1054 -10231,salazzle-totem,totem,10129,17,1,1,0,2,1059 +10230,lurantis-totem,totem,10128,17,1,0,0,2,1054 +10231,salazzle-totem,totem,10129,17,1,0,0,2,1059 10232,silvally-fighting,fighting,773,17,0,0,0,2,1075 10233,silvally-flying,flying,773,17,0,0,0,3,1076 10234,silvally-poison,poison,773,17,0,0,0,4,1077 @@ -1286,9 +1286,9 @@ id,identifier,form_identifier,pokemon_id,introduced_in_version_group_id,is_defau 10260,minior-indigo,indigo,10141,17,1,0,0,13,1104 10261,minior-violet,violet,10142,17,1,0,0,14,1105 10262,mimikyu-busted,busted,10143,17,1,1,0,2,1111 -10263,mimikyu-totem-disguised,totem-disguised,10144,17,1,1,0,3,1112 +10263,mimikyu-totem-disguised,totem-disguised,10144,17,1,0,0,3,1112 10264,mimikyu-totem-busted,totem-busted,10145,17,1,1,0,4,1113 -10265,kommo-o-totem,totem,10146,17,1,1,0,2,1120 +10265,kommo-o-totem,totem,10146,17,1,0,0,2,1120 10266,magearna-original,original,10147,17,1,0,0,2,1141 10267,pikachu-partner-cap,partner-cap,10148,18,1,0,0,14,49 10268,marowak-totem,totem,10149,18,1,0,0,3,167 From 2a85ddf8f51e372ce5f7c8b4a717b86f72948bea Mon Sep 17 00:00:00 2001 From: Gudine Date: Sat, 10 Feb 2024 14:20:14 -0300 Subject: [PATCH 15/22] =?UTF-8?q?fix:=20corrects=20is=5Fbattle=5Fonly=20va?= =?UTF-8?q?lue=20on=20certain=20pok=C3=A9mon=20forms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/v2/csv/pokemon_forms.csv | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/data/v2/csv/pokemon_forms.csv b/data/v2/csv/pokemon_forms.csv index 7584e404c..68f70b1c4 100644 --- a/data/v2/csv/pokemon_forms.csv +++ b/data/v2/csv/pokemon_forms.csv @@ -1245,7 +1245,7 @@ id,identifier,form_identifier,pokemon_id,introduced_in_version_group_id,is_defau 10219,greninja-ash,ash,10117,17,1,1,0,3,853 10220,zygarde-10-power-construct,10-power-construct,10118,17,1,0,0,3,1002 10221,zygarde-50-power-construct,50-power-construct,10119,17,1,0,0,4,1003 -10222,zygarde-complete,complete,10120,17,1,0,0,5,1004 +10222,zygarde-complete,complete,10120,17,1,1,0,5,1004 10223,gumshoos-totem,totem,10121,17,1,0,0,2,1024 10224,vikavolt-totem,totem,10122,17,1,0,0,2,1028 10225,oricorio-pom-pom,pom-pom,10123,17,1,0,0,2,1032 @@ -1360,12 +1360,12 @@ id,identifier,form_identifier,pokemon_id,introduced_in_version_group_id,is_defau 10334,linoone-galar,galar,10175,20,1,0,0,2,392 10335,darumaka-galar,galar,10176,20,1,0,0,2,725 10336,darmanitan-galar-standard,galar-standard,10177,20,1,0,0,3,728 -10337,darmanitan-galar-zen,galar-zen,10178,20,1,0,0,4,729 +10337,darmanitan-galar-zen,galar-zen,10178,20,1,1,0,4,729 10338,yamask-galar,galar,10179,20,1,0,0,2,737 10339,stunfisk-galar,galar,10180,20,1,0,0,2,800 10340,zygarde-10,10,10181,17,1,0,0,2,1001 -10341,cramorant-gulping,gulping,10182,20,1,0,0,2,1186 -10342,cramorant-gorging,gorging,10183,20,1,0,0,3,1187 +10341,cramorant-gulping,gulping,10182,20,1,1,0,2,1186 +10342,cramorant-gorging,gorging,10183,20,1,1,0,3,1187 10343,toxtricity-low-key,low-key,10184,20,1,0,0,2,1192 10344,sinistea-antique,antique,854,20,0,0,0,2,1198 10345,polteageist-antique,antique,855,20,0,0,0,2,1200 @@ -1377,11 +1377,11 @@ id,identifier,form_identifier,pokemon_id,introduced_in_version_group_id,is_defau 10351,alcremie-ruby-swirl,ruby-swirl,869,20,0,0,0,7,1220 10352,alcremie-caramel-swirl,caramel-swirl,869,20,0,0,0,8,1221 10353,alcremie-rainbow-swirl,rainbow-swirl,869,20,0,0,0,9,1222 -10354,eiscue-noice,noice,10185,20,1,0,0,2,1229 +10354,eiscue-noice,noice,10185,20,1,1,0,2,1229 10355,indeedee-female,female,10186,20,1,0,0,2,1231 -10356,morpeko-hangry,hangry,10187,20,1,0,0,2,1233 -10357,zacian-crowned,crowned,10188,20,1,0,0,2,1245 -10358,zamazenta-crowned,crowned,10189,20,1,0,0,2,1247 +10356,morpeko-hangry,hangry,10187,20,1,1,0,2,1233 +10357,zacian-crowned,crowned,10188,20,1,1,0,2,1245 +10358,zamazenta-crowned,crowned,10189,20,1,1,0,2,1247 10359,eternatus-eternamax,eternamax,10190,20,1,0,0,2,1249 10360,urshifu-rapid-strike,rapid-strike,10191,20,1,0,0,2,1252 10361,zarude-dada,dada,10192,20,1,0,0,2,1254 From 99f2131424ad3328465e4dba7d5b9b70e3e9a831 Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Sat, 10 Feb 2024 19:56:30 -0600 Subject: [PATCH 16/22] making simonorono's suggest changes --- pokemon_v2/serializers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 67e181a2c..cef6f6b13 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2343,12 +2343,12 @@ def get_effect_text(self, obj): data = MoveEffectEffectTextSerializer( effect_texts, many=True, context=self.context ).data - effect_entries = data[0] - for _i, k in enumerate(effect_entries): - if "$effect_chance%" in effect_entries[k]: - data[0][k] = effect_entries[k].replace( - "$effect_chance", f"{obj.move_effect_chance}" - ) + if len(data) > 0: + for key, value in data[0].items(): + if "$effect_chance%" in value: + data[0][key] = value.replace( + "$effect_chance", f"{obj.move_effect_chance}" + ) return data From e4e2cd6e721074863f14da0125e04c13e417178a Mon Sep 17 00:00:00 2001 From: Naramsim Date: Tue, 13 Feb 2024 12:38:58 +0100 Subject: [PATCH 17/22] fix: track and set permissions on talbes --- .../public_pokemon_v2_pokemonabilitypast.yaml | 7 +++++++ .../tables/public_pokemon_v2_pokemoncries.yaml | 14 ++++++++++++++ .../tables/public_pokemon_v2_typeefficacypast.yaml | 7 +++++++ 3 files changed, 28 insertions(+) create mode 100644 graphql/metadata/databases/default/tables/public_pokemon_v2_pokemoncries.yaml diff --git a/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemonabilitypast.yaml b/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemonabilitypast.yaml index 9e3491119..bd9da1548 100644 --- a/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemonabilitypast.yaml +++ b/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemonabilitypast.yaml @@ -11,3 +11,10 @@ object_relationships: - name: pokemon_v2_pokemon using: foreign_key_constraint_on: pokemon_id +select_permissions: + - role: anon + permission: + columns: '*' + filter: {} + limit: 100000 + allow_aggregations: true diff --git a/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemoncries.yaml b/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemoncries.yaml new file mode 100644 index 000000000..df3cde640 --- /dev/null +++ b/graphql/metadata/databases/default/tables/public_pokemon_v2_pokemoncries.yaml @@ -0,0 +1,14 @@ +table: + name: pokemon_v2_pokemoncries + schema: public +object_relationships: + - name: pokemon_v2_pokemon + using: + foreign_key_constraint_on: pokemon_id +select_permissions: + - role: anon + permission: + columns: '*' + filter: {} + limit: 100000 + allow_aggregations: true diff --git a/graphql/metadata/databases/default/tables/public_pokemon_v2_typeefficacypast.yaml b/graphql/metadata/databases/default/tables/public_pokemon_v2_typeefficacypast.yaml index 4c71b2b09..8c0d6de8a 100644 --- a/graphql/metadata/databases/default/tables/public_pokemon_v2_typeefficacypast.yaml +++ b/graphql/metadata/databases/default/tables/public_pokemon_v2_typeefficacypast.yaml @@ -11,3 +11,10 @@ object_relationships: - name: pokemon_v2_type using: foreign_key_constraint_on: damage_type_id +select_permissions: + - role: anon + permission: + columns: '*' + filter: {} + limit: 100000 + allow_aggregations: true From 2e531809f2b5dabcffde28e74334c46634c98089 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 2 Mar 2024 11:01:40 -0700 Subject: [PATCH 18/22] Added PowerShell wrapper and sorted table alphabetically --- README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d9cc331eb..bef287fec 100755 --- a/README.md +++ b/README.md @@ -153,19 +153,20 @@ This k8s setup creates all k8s resources inside the _Namespace_ `pokeapi`, run ` | Python 2/3 | [PokeAPI/pokepy](https://github.com/PokeAPI/pokepy) | _Auto caching_ | | Python 3 | [PokeAPI/pokebase](https://github.com/PokeAPI/pokebase) | _Auto caching_, _Image caching_ | -| Wrapper | Repository | Features | -| --- | --- | --- | -| PHP | [lmerotta/phpokeapi](https://github.com/lmerotta/phpokeapi) | _Auto caching, lazy loading_ | -| Ruby | [rdavid1099/poke-api-v2](https://github.com/rdavid1099/poke-api-v2) | | -| .Net Standard | [mtrdp642/PokeApiNet](https://github.com/mtrdp642/PokeApiNet) | _Auto caching_ | -| Go | [mtslzr/pokeapi-go](https://github.com/mtslzr/pokeapi-go) | _Auto caching_ | -| Dart | [prathanbomb/pokedart](https://github.com/prathanbomb/pokedart) | | -| Rust | [lunik1/pokerust](https://gitlab.com/lunik1/pokerust) | _Auto caching_ | -| Spring Boot | [dlfigueira/spring-pokeapi](https://github.com/dlfigueira/spring-pokeapi) | _Auto caching_ | -| Swift | [kinkofer/PokemonAPI](https://github.com/kinkofer/PokemonAPI) | | -| Typescript server-side/client-side | [Gabb-c/Pokenode-ts](https://github.com/Gabb-c/pokenode-ts) | _Auto caching_ | -| Python | [beastmatser/aiopokeapi](https://github.com/beastmatser/aiopokeapi) | _Auto caching, asynchronous_ -| Scala | [juliano/pokeapi-scala](https://github.com/juliano/pokeapi-scala) | _Auto caching_ | +|Wrapper |Repository |Features | +|----------------------------------|-------------------------------------------------------------------------------------------|---------------------------| +|.Net Standard |[mtrdp642/PokeApiNet](https://github.com/mtrdp642/PokeApiNet) |Auto caching | +|Dart |[prathanbomb/pokedart](https://github.com/prathanbomb/pokedart) | | +|Go |[mtslzr/pokeapi-go](https://github.com/mtslzr/pokeapi-go) |Auto caching | +|PHP |[lmerotta/phpokeapi](https://github.com/lmerotta/phpokeapi) |Auto caching, lazy loading | +|PowerShell |[Celerium/PokeAPI-PowerShellWrapper](https://github.com/Celerium/PokeAPI-PowerShellWrapper)| | +|Python |[beastmatser/aiopokeapi](https://github.com/beastmatser/aiopokeapi) |Auto caching, asynchronous | +|Ruby |[rdavid1099/poke-api-v2](https://github.com/rdavid1099/poke-api-v2) | | +|Rust |[lunik1/pokerust](https://gitlab.com/lunik1/pokerust) |Auto caching | +|Scala |[juliano/pokeapi-scala](https://github.com/juliano/pokeapi-scala) |Auto caching | +|Spring Boot |[dlfigueira/spring-pokeapi](https://github.com/dlfigueira/spring-pokeapi) |Auto caching | +|Swift |[kinkofer/PokemonAPI](https://github.com/kinkofer/PokemonAPI) | | +|Typescript server-side/client-side|[Gabb-c/Pokenode-ts](https://github.com/Gabb-c/pokenode-ts) |Auto caching | ## Donations From 919605456dd168d29921ee159f9b19f01661f3dd Mon Sep 17 00:00:00 2001 From: Robert Williams III Date: Mon, 4 Mar 2024 11:07:42 -0600 Subject: [PATCH 19/22] fixing eevee's has_gender_differences data --- data/v2/csv/pokemon_species.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/v2/csv/pokemon_species.csv b/data/v2/csv/pokemon_species.csv index 5760d2ccd..58e11c8c9 100644 --- a/data/v2/csv/pokemon_species.csv +++ b/data/v2/csv/pokemon_species.csv @@ -131,7 +131,7 @@ id,identifier,generation_id,evolves_from_species_id,evolution_chain_id,color_id, 130,gyarados,1,129,64,2,2,9,4,45,50,0,5,1,1,1,0,0,154,14 131,lapras,1,,65,2,3,7,4,45,50,0,40,0,1,0,0,0,155,190 132,ditto,1,,66,7,1,8,-1,35,50,0,20,0,2,0,0,0,156, -133,eevee,1,,67,3,8,8,1,45,50,0,35,0,2,0,0,0,157,1 +133,eevee,1,,67,3,8,8,1,45,50,0,35,1,2,0,0,0,157,1 134,vaporeon,1,133,67,2,8,8,1,45,50,0,35,0,2,0,0,0,158,2 135,jolteon,1,133,67,10,8,8,1,45,50,0,35,0,2,0,0,0,159,3 136,flareon,1,133,67,8,8,8,1,45,50,0,35,0,2,0,0,0,160,4 From 50ab698c4a658c01766c43adf83dda3c6cadf5e1 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 4 Mar 2024 23:59:01 +0100 Subject: [PATCH 20/22] Added french names and some typos fixes --- data/v2/csv/pokemon_form_names.csv | 168 ++++++++++++++++++----------- 1 file changed, 103 insertions(+), 65 deletions(-) diff --git a/data/v2/csv/pokemon_form_names.csv b/data/v2/csv/pokemon_form_names.csv index 7c2f0dfa6..cc2cf18c9 100644 --- a/data/v2/csv/pokemon_form_names.csv +++ b/data/v2/csv/pokemon_form_names.csv @@ -9,7 +9,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 351,1,ポワルンのすがた, 351,3,캐스퐁의 모습, 351,4,飄浮泡泡的樣子, -351,5,Forme de Morphéo, +351,5,Forme de Morphéo,Morphéo 351,6,Formeo,Formeo 351,7,Forma de Castform, 351,8,Forma Castform, @@ -19,7 +19,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 382,1,カイオーガのすがた, 382,3,가이오가의 모습, 382,4,蓋歐卡的樣子, -382,5,Kyogre, +382,5,Kyogre,Kyogre 382,6,Kyogre,Kyogre 382,7,Kyogre, 382,9,Kyogre, @@ -28,7 +28,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 383,1,グラードンのすがた, 383,3,그란돈의 모습, 383,4,固拉多的樣子, -383,5,Groudon, +383,5,Groudon,Groudon 383,6,Groudon,Groudon 383,7,Groudon, 383,9,Groudon, @@ -94,7 +94,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 479,1,ロトムのすがた, 479,3,로토무의 모습, 479,4,洛托姆的樣子, -479,5,Forme de Motisma, +479,5,Forme de Motisma,Motisma 479,6,Rotom,Rotom 479,7,Forma de Rotom, 479,8,Forma Rotom, @@ -104,7 +104,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 487,1,アナザーフォルム, 487,3,어나더폼, 487,4,別種形態, -487,5,Forme Alternative,Giratina Alternative +487,5,Forme Alternative,Giratina Alternatif 487,6,Wandelform,Giratina 487,7,Forma Modificada, 487,8,Forma Alterata, @@ -194,7 +194,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 646,1,キュレムのすがた, 646,3,큐레무의 모습, 646,4,酋雷姆的樣子, -646,5,Forme de Kyurem, +646,5,Forme de Kyurem,Kyurem 646,6,Kyurem,Kyurem 646,7,Forma de Kyurem, 646,8,Forma di Kyurem, @@ -309,7 +309,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 718,1,50%フォルム, 718,3,50%폼, 718,4,50%形態, -718,5,Forme 50 %, +718,5,Forme 50 %,Zygarde Forme 50 % 718,6,50%-Form,Zygarde (50%) 718,7,Forma 50%, 718,8,Forma 50%, @@ -319,7 +319,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 720,1,いましめられしフーパ, 720,3,굴레에 빠진 후파, 720,4,懲戒胡帕, -720,5,Hoopa Enchaîné, +720,5,Hoopa Enchaîné,Hoopa Enchaîné 720,6,Gebanntes Hoopa,Gebanntes Hoopa 720,7,Hoopa Contenido, 720,8,Hoopa Vincolato, @@ -329,7 +329,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 741,1,めらめらスタイル, 741,3,이글이글스타일, 741,4,熱辣熱辣風格, -741,5,Style Flamenco, +741,5,Style Flamenco,Plumeline Style Flamenco 741,6,Flamenco-Stil,Choreogel (Flamenco) 741,7,Estilo Apasionado, 741,8,Stile Flamenco, @@ -339,7 +339,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 745,1,まひるのすがた, 745,3,한낮의 모습, 745,4,白晝的樣子, -745,5,Forme Diurne, +745,5,Forme Diurne,Lougaroc Forme Diurne 745,6,Tagform,Wolwerock (Tag) 745,7,Forma Diurna, 745,8,Forma Giorno, @@ -349,7 +349,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 746,1,たんどくのすがた, 746,3,단독의 모습, 746,4,單獨的樣子, -746,5,Forme Solitaire, +746,5,Forme Solitaire,Froussardine Forme Solitaire 746,6,Einzelform,Lusardin 746,7,Forma Individual, 746,8,Forma Individuale, @@ -369,7 +369,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 774,1,りゅうせいのすがた, 774,3,유성의 모습, 774,4,流星的樣子, -774,5,Forme Météore, +774,5,Forme Météore,Météno Forme Météore Noyeau Rouge 774,6,Meteorform,Meteno (Meteor Rot) 774,7,Forma Meteorito, 774,8,Forma Meteora, @@ -379,7 +379,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 778,1,ばけたすがた, 778,3,둔갑한 모습, 778,4,化形的樣子, -778,5,Forme Déguisée, +778,5,Forme Déguisée,Mimiqui Déguisé 778,6,Verkleidete Form,Mimigma (Getarnt) 778,7,Forma Encubierta, 778,8,Forma Mascherata, @@ -389,7 +389,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 849,1,ハイなすがた, 849,3,하이한 모습, 849,4,高調的樣子, -849,5,Forme Aigüe, +849,5,Forme Aigüe,Salarsen Forme Aigüe 849,6,Hoch-Form,Riffex (Hochform) 849,7,Forma Aguda, 849,8,Forma Melodia, @@ -397,17 +397,19 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 849,11,ハイなすがた, 849,12,高调的样子, 854,1,がんさくフォルム, +854,5,Forme Contrefaçon,Théffroi Contrefaçon 854,6,Fälschungsform,Fatalitee (Fälschung) 854,9,Phony Form,Phony Sinistea 854,11,がんさくフォルム, 855,1,がんさくフォルム, +854,5,Forme Contrefaçon,Polthégeist Contrefaçon 855,6,Fälschungsform,Mortipot (Fälschung) 855,9,Phony Form,Phony Polteageist 855,11,がんさくフォルム, 869,1,ミルキィバニラ, 869,3,밀키바닐라, 869,4,奶香香草, -869,5,Lait Vanille, +869,5,Lait Vanille,Charmilly Lait Vanille 869,6,Vanille-Creme,Pokusan (Vanille-Creme) 869,7,Crema de Vainilla, 869,8,Lattevaniglia, @@ -417,7 +419,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 875,1,アイスフェイス, 875,3,아이스페이스, 875,4,結凍頭, -875,5,Tête de Gel, +875,5,Tête de Gel,Bekaglaçon Tête de Gel 875,6,Tiefkühlkopf,Kubuin (Tiefkühlkopf) 875,7,Cara de Hielo, 875,8,Gelofaccia, @@ -427,7 +429,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 876,1,オスのすがた, 876,3,수컷의 모습, 876,4,雄性的樣子, -876,5,Mâle, +876,5,Mâle,Wimessir Mâle 876,6,Männlich,Servol ♂ 876,7,Macho, 876,8,Maschio, @@ -437,7 +439,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 877,1,まんぷくもよう, 877,3,배부른 모양, 877,4,滿腹花紋, -877,5,Mode Rassasié, +877,5,Mode Rassasié,Morpeko Rassasié 877,6,Pappsattmuster,Morpeko (Pappsattmuster) 877,7,Forma Saciada, 877,8,Motivo Panciapiena, @@ -447,7 +449,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 888,1,れきせんのゆうしゃ, 888,3,역전의 용사, 888,4,百戰勇者, -888,5,Héros Aguerri, +888,5,Héros Aguerri,Zacian 888,6,Heldenhafter Krieger,Zacian 888,7,Guerrero Avezado, 888,8,Eroe di Mille Lotte, @@ -457,7 +459,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 889,1,れきせんのゆうしゃ, 889,3,역전의 용사, 889,4,百戰勇者, -889,5,Héros Aguerri, +889,5,Héros Aguerri,Zamazenta 889,6,Heldenhafter Krieger,Zamazenta 889,7,Guerrero Avezado, 889,8,Eroe di Mille Lotte, @@ -467,7 +469,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 892,1,いちげきのかた, 892,3,일격의 태세, 892,4,一擊流, -892,5,Style Poing Final, +892,5,Style Poing Final,Shifours Style Poing Final 892,6,Fokussierter Stil,Wulaosu (Fokussiert) 892,7,Estilo Brusco, 892,8,Stile Singolcolpo, @@ -475,42 +477,53 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 892,11,いちげきのかた, 892,12,一击流, 902,1,オスのすがた, +902,5,Mâle,Paragruel Mâle 902,9,Male,Male Basculegion 902,11,オスのすがた, 905,1,けしんフォルム, +905,5,Forme Avatar,Amovénus Avatar 905,9,Incarnate Forme,Incarnate Enamorus 905,11,けしんフォルム, 916,1,オスのすがた, +916,5,Mâle,Fragroin Mâle 916,9,Male, 916,11,オスのすがた, 925,1,4ひきかぞく, +925,5,Famille de Quatre,Famignol Famille de Quatre 925,9,Family of Four, 925,11,4ひきかぞく, 931,1,グリーンフェザー, +931,5,Plumage Vert,Tapatoès Plumage Vert 931,9,Green Plumage, 931,11,グリーンフェザー, 964,1,ナイーブフォルム, +964,5,Forme Ordinaire,Superdofin Forme Ordinaire 964,9,Zero Form, 964,11,ナイーブフォルム, 978,1,そったすがた, +978,5,Forme Courbée,Nigirigon Forme Courbée 978,9,Curly Form, 978,11,そったすがた, 982,1,ふたふしフォルム, +982,5,Forme Double,Deusolourdo Forme Double 982,9,Two-Segment Form, 982,11,ふたふしフォルム, 999,1,はこフォルム, +999,5,Forme Coffre,Mordudor Forme Coffre 999,9,Chest Form, 999,11,はこフォルム, 1007,1,かんぜんけいたい, +1007,5,Forme Finale,Koraidon Forme Finale 1007,9,Apex Build, 1007,11,かんぜんけいたい, 1008,1,コンプリートモード, +1008,5,Mode Ultime,Miraidon Mode Ultime 1008,9,Ultimate Mode, 1008,11,コンプリートモード, 1012,1,マガイモノのすがた, 1012,3,가짜배기의 모습, 1012,4,冒牌貨的樣子, -1012,5,Forme Imitation, +1012,5,Forme Imitation,Poltchageist Forme Imitation 1012,6,Imitationsform, 1012,7,Forma Fraudulenta, 1012,8,Forma Taroccata, @@ -520,7 +533,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 1013,1,ボンサクのすがた, 1013,3,범작의 모습, 1013,4,凡作的樣子, -1013,5,Forme Médiocre, +1013,5,Forme Médiocre,Théffroyable Forme Médiocre 1013,6,Simple Form, 1013,7,Forma Mediocre, 1013,8,Forma Dozzinale, @@ -530,7 +543,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 1017,1,みどりのめん, 1017,3,벽록의가면, 1017,4,碧草面具, -1017,5,Masque Turquoise, +1017,5,Masque Turquoise,Ogerpon Turquoise 1017,6,Türkisgrüne Maske, 1017,7,Máscara Turquesa, 1017,8,Maschera Turchese, @@ -538,7 +551,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 1017,11,みどりのめん, 1017,12,碧草面具, 1024,1,ノーマルフォルム, -1024,5,Forme Normale, +1024,5,Forme Normale,Terapagos Forme Normale 1024,7,Forma normal, 1024,8,Forma Normale, 1024,9,Normal Form, @@ -2105,7 +2118,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10193,1,アローラのすがた, 10193,3,알로라의 모습, 10193,4,阿羅拉的樣子, -10193,5,Forme d’Alola,Rattata d'Alola +10193,5,Forme d'Alola,Rattata d'Alola 10193,6,Alola-Form,Alola Rattfratz 10193,7,Forma de Alola, 10193,8,Forma di Alola, @@ -2115,7 +2128,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10194,1,アローラのすがた, 10194,3,알로라의 모습, 10194,4,阿羅拉的樣子, -10194,5,Forme d’Alola,Rattatac d'Alola +10194,5,Forme d'Alola,Rattatac d'Alola 10194,6,Alola-Form,Alola Rattikarl 10194,7,Forma de Alola, 10194,8,Forma di Alola, @@ -2158,7 +2171,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10199,1,イッシュキャップ, 10199,3,하나캡, 10199,4,合眾帽子, -10199,5,Casquette d’Unys,Pikachu Casquette d’Unys +10199,5,Casquette d'Unys,Pikachu Casquette d’Unys 10199,6,Einall-Kappe,Pikachu (Einall-Kappe) 10199,7,Gorra Teselia, 10199,8,Berretto Unima, @@ -2178,7 +2191,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10201,1,アローラキャップ, 10201,3,알로라캡, 10201,4,阿羅拉帽子, -10201,5,Casquette d’Alola,Pikachu Casquette d’Alola +10201,5,Casquette d'Alola,Pikachu Casquette d’Alola 10201,6,Alola-Kappe,Pikachu (Alola-Kappe) 10201,7,Gorra Alola, 10201,8,Berretto Alola, @@ -2188,7 +2201,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10202,1,アローラのすがた, 10202,3,알로라의 모습, 10202,4,阿羅拉的樣子, -10202,5,Forme d’Alola,Raichu d'Alola +10202,5,Forme d'Alola,Raichu d'Alola 10202,6,Alola-Form,Alola Raichu 10202,7,Forma de Alola, 10202,8,Forma di Alola, @@ -2198,7 +2211,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10203,1,アローラのすがた, 10203,3,알로라의 모습, 10203,4,阿羅拉的樣子, -10203,5,Forme d’Alola,Sabelette d'Alola +10203,5,Forme d'Alola,Sabelette d'Alola 10203,6,Alola-Form,Alola Sandan 10203,7,Forma de Alola, 10203,8,Forma di Alola, @@ -2208,7 +2221,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10204,1,アローラのすがた, 10204,3,알로라의 모습, 10204,4,阿羅拉的樣子, -10204,5,Forme d’Alola,Sablaireau d'Alola +10204,5,Forme d'Alola,Sablaireau d'Alola 10204,6,Alola-Form,Alola Sandamer 10204,7,Forma de Alola, 10204,8,Forma di Alola, @@ -2218,7 +2231,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10205,1,アローラのすがた, 10205,3,알로라의 모습, 10205,4,阿羅拉的樣子, -10205,5,Forme d’Alola,Goupix d'Alola +10205,5,Forme d'Alola,Goupix d'Alola 10205,6,Alola-Form,Alola Vulpix 10205,7,Forma de Alola, 10205,8,Forma di Alola, @@ -2228,7 +2241,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10206,1,アローラのすがた, 10206,3,알로라의 모습, 10206,4,阿羅拉的樣子, -10206,5,Forme d’Alola,Feunard d'Alola +10206,5,Forme d'Alola,Feunard d'Alola 10206,6,Alola-Form,Alola Vulnona 10206,7,Forma de Alola, 10206,8,Forma di Alola, @@ -2238,7 +2251,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10207,1,アローラのすがた, 10207,3,알로라의 모습, 10207,4,阿羅拉的樣子, -10207,5,Forme d’Alola,Taupiqueur d'Alola +10207,5,Forme d'Alola,Taupiqueur d'Alola 10207,6,Alola-Form,Alola Digda 10207,7,Forma de Alola, 10207,8,Forma di Alola, @@ -2248,7 +2261,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10208,1,アローラのすがた, 10208,3,알로라의 모습, 10208,4,阿羅拉的樣子, -10208,5,Forme d’Alola,Triopikeur d'Alola +10208,5,Forme d'Alola,Triopikeur d'Alola 10208,6,Alola-Form,Alola Digdri 10208,7,Forma de Alola, 10208,8,Forma di Alola, @@ -2258,7 +2271,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10209,1,アローラのすがた, 10209,3,알로라의 모습, 10209,4,阿羅拉的樣子, -10209,5,Forme d’Alola,Miaouss d'Alola +10209,5,Forme d'Alola,Miaouss d'Alola 10209,6,Alola-Form,Alola Mauzi 10209,7,Forma de Alola, 10209,8,Forma di Alola, @@ -2278,7 +2291,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10211,1,アローラのすがた, 10211,3,알로라의 모습, 10211,4,阿羅拉的樣子, -10211,5,Forme d’Alola,Racaillou d'Alola +10211,5,Forme d'Alola,Racaillou d'Alola 10211,6,Alola-Form,Alola Kleinstein 10211,7,Forma de Alola, 10211,8,Forma di Alola, @@ -2288,7 +2301,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10212,1,アローラのすがた, 10212,3,알로라의 모습, 10212,4,阿羅拉的樣子, -10212,5,Forme d’Alola,Gravalanch d'Alola +10212,5,Forme d'Alola,Gravalanch d'Alola 10212,6,Alola-Form,Alola Georok 10212,7,Forma de Alola, 10212,8,Forma di Alola, @@ -2298,7 +2311,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10213,1,アローラのすがた, 10213,3,알로라의 모습, 10213,4,阿羅拉的樣子, -10213,5,Forme d’Alola,Grolem d'Alola +10213,5,Forme d'Alola,Grolem d'Alola 10213,6,Alola-Form,Alola Geowaz 10213,7,Forma de Alola, 10213,8,Forma di Alola, @@ -2308,7 +2321,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10214,1,アローラのすがた, 10214,3,알로라의 모습, 10214,4,阿羅拉的樣子, -10214,5,Forme d’Alola,Tadmorv d'Alola +10214,5,Forme d'Alola,Tadmorv d'Alola 10214,6,Alola-Form,Alola Sleima 10214,7,Forma de Alola, 10214,8,Forma di Alola, @@ -2318,7 +2331,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10215,1,アローラのすがた, 10215,3,알로라의 모습, 10215,4,阿羅拉的樣子, -10215,5,Forme d’Alola,Grotadmorv d'Alola +10215,5,Forme d'Alola,Grotadmorv d'Alola 10215,6,Alola-Form,Alola Sleimok 10215,7,Forma de Alola, 10215,8,Forma di Alola, @@ -2328,7 +2341,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10216,1,アローラのすがた, 10216,3,알로라의 모습, 10216,4,阿羅拉的樣子, -10216,5,Forme d’Alola,Noadkoko d'Alola +10216,5,Forme d'Alola,Noadkoko d'Alola 10216,6,Alola-Form,Alola Kokowei 10216,7,Forma de Alola, 10216,8,Forma di Alola, @@ -2338,7 +2351,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10217,1,アローラのすがた, 10217,3,알로라의 모습, 10217,4,阿羅拉的樣子, -10217,5,Forme d’Alola,Ossatueur d'Alola +10217,5,Forme d'Alola,Ossatueur d'Alola 10217,6,Alola-Form,Alola Knogga 10217,7,Forma de Alola, 10217,8,Forma di Alola, @@ -2673,7 +2686,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10254,1,りゅうせいのすがた, 10254,3,유성의 모습, 10254,4,流星的樣子, -10254,5,Forme Météore,Météno NoyeaForme Météore u Violet +10254,5,Forme Météore,Météno Forme Météore Noyeau Violet 10254,6,Meteorform,Meteno (Meteor Violet) 10254,7,Forma Meteorito, 10254,8,Forma Meteora, @@ -2830,7 +2843,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10315,1,あかつきのつばさ, 10315,3,새벽의 날개, 10315,4,拂曉之翼, -10315,5,Ailes de l’Aurore,Necrozma Ailes de l’Aurore +10315,5,Ailes de l'Aurore,Necrozma Ailes de l’Aurore 10315,6,Morgenschwingen,Necrozma (Morgenschwingen) 10315,7,Alas del Alba, 10315,8,Ali dell’Aurora, @@ -3104,17 +3117,19 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10343,11,ローなすがた, 10343,12,低调的样子, 10344,1,しんさくフォルム, +10344,5,Forme Authentique,Théffroi Authentique 10344,6,Originalform,Fatalitee (Original) 10344,9,Antique Form,Antique Sinistea 10344,11,しんさくフォルム, 10345,1,しんさくフォルム, +10345,5,Forme Authentique,Polthégeist Authentique 10345,6,Originalform,Mortipot (Original) 10345,9,Antique Form,Antique Polteageist 10345,11,しんさくフォルム, 10346,1,ミルキィルビー, 10346,3,밀키루비, 10346,4,奶香紅鑽, -10346,5,Lait Ruby, +10346,5,Lait Ruby,Charmilly Lait Ruby 10346,6,Ruby-Creme,Pokusan (Ruby-Creme) 10346,7,Crema Rosa, 10346,8,Latterosa, @@ -3124,7 +3139,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10347,1,ミルキィまっちゃ, 10347,3,밀키말차, 10347,4,奶香抹茶, -10347,5,Lait Matcha, +10347,5,Lait Matcha,Charmilly Lait Matcha 10347,6,Matcha-Creme,Pokusan (Matcha-Creme) 10347,7,Crema de Té, 10347,8,Lattematcha, @@ -3134,7 +3149,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10348,1,ミルキィミント, 10348,3,밀키민트, 10348,4,奶香薄荷, -10348,5,Lait Menthe, +10348,5,Lait Menthe,Charmilly Lait Menthe 10348,6,Minz-Creme,Pokusan (Minz-Creme) 10348,7,Crema de Menta, 10348,8,Lattementa, @@ -3144,7 +3159,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10349,1,ミルキィレモン, 10349,3,밀키레몬, 10349,4,奶香檸檬, -10349,5,Lait Citron, +10349,5,Lait Citron,Charmilly Lait Citron 10349,6,Zitronen-Creme,Pokusan (Zitronen-Creme) 10349,7,Crema de Limón, 10349,8,Lattelimone, @@ -3154,7 +3169,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10350,1,ミルキィソルト, 10350,3,밀키솔트, 10350,4,奶香雪鹽, -10350,5,Lait Salé, +10350,5,Lait Salé,Charmilly Lait Salé 10350,6,Salz-Creme,Pokusan (Salz-Creme) 10350,7,Crema Salada, 10350,8,Lattesale, @@ -3164,7 +3179,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10351,1,ルビーミックス, 10351,3,루비믹스, 10351,4,紅鑽綜合, -10351,5,Mélange Ruby, +10351,5,Mélange Ruby,Charmilly Mélange Ruby 10351,6,Ruby-Mix,Pokusan (Ruby-Mix) 10351,7,Mezcla Rosa, 10351,8,Rosamix, @@ -3174,7 +3189,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10352,1,キャラメルミックス, 10352,3,캐러멜믹스, 10352,4,焦糖綜合, -10352,5,Mélange Caramel, +10352,5,Mélange Caramel,Charmilly Mélange Caramel 10352,6,Karamell-Mix,Pokusan (Karamell-Mix) 10352,7,Mezcla Caramelo, 10352,8,Caramelmix, @@ -3184,7 +3199,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10353,1,トリプルミックス, 10353,3,트리플믹스, 10353,4,三色綜合, -10353,5,Mélange Tricolore, +10353,5,Mélange Tricolore,Charmilly Mélange Tricolore 10353,6,Trio-Mix,Pokusan (Trio-Mix) 10353,7,Tres Sabores, 10353,8,Triplomix, @@ -3214,7 +3229,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10356,1,はらぺこもよう, 10356,3,배고픈 모양, 10356,4,空腹花紋, -10356,5,Mode Affamé,Morpeko Mode Affamé +10356,5,Mode Affamé,Morpeko Affamé 10356,6,Kohldampfmuster,Morpeko (Kohldampf) 10356,7,Forma Voraz, 10356,8,Motivo Panciavuota, @@ -3360,7 +3375,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10386,5,Forme Gigamax,Dratatin Gigamax 10386,6,Gigadynamax-Form,Gigadynamax-Schlapfel 10386,9,Gigantamax Form,Gigantamax Appletun -10387,5,Forme Gigamax,Dunaconda +10387,5,Forme Gigamax,Dunaconda Gigamax 10387,6,Gigadynamax-Form,Gigadynamax-Sanaconda 10387,9,Gigantamax Form,Gigantamax Sandaconda 10388,5,Forme Gigamax,Salarsen Forme Aigüe Gigamax @@ -3484,7 +3499,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10415,9,Origin Forme,Origin Palkia 10415,11,オリジンフォルム, 10416,1,しろすじのすがた, -10416,5,Motif Blanch,Basculin Blanc +10416,5,Motif Blanc,Bargantua Blanc 10416,6,Weißlinienform,Weißliniges Barschuft 10416,9,White-Striped Form,White-Striped Basculin 10416,11,しろすじのすがた, @@ -3494,80 +3509,102 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10417,9,Female,Female Basculegion 10417,11,メスのすがた, 10418,1,れいじゅうフォルム, -10418,5,Forme Avatar,Amovénus Avatar +10418,5,Forme Totémique,Amovénus Totémique 10418,6,Tiergeistform,Enamorus (Tiergeist) 10418,9,Therian Forme,Therian Enamorus 10418,11,れいじゅうフォルム, 10419,1,パルデアのすがた, +10419,5,Forme de Paldéa,Tauros de Paldéa Race Combative 10419,9,Paldean Form, 10419,11,パルデアのすがた, 10420,1,パルデアのすがた, +10420,5,Forme de Paldéa,Tauros de Paldéa Race Flamboyante 10420,9,Paldean Form, 10420,11,パルデアのすがた, 10421,1,パルデアのすがた, +10421,5,Forme de Paldéa,Tauros de Paldéa Race Aquatique 10421,9,Paldean Form, 10421,11,パルデアのすがた, 10422,1,パルデアのすがた, +10422,5,Forme de Paldéa,Axoloto de Paldéa 10422,9,Paldean Form, 10422,11,パルデアのすがた, 10423,1,メスのすがた, +10423,5,Femelle,Fragroin Femelle 10423,9,Female, 10423,11,メスのすがた, 10424,1,みつふしフォルム, +10424,5,Forme Triple,Deusolourdo Forme Triple 10424,9,Three-Segment Form, 10424,11,みつふしフォルム, 10425,1,マイティフォルム, +10425,5,Forme Super,Superdofin Forme Super 10425,9,Hero Form, 10425,11,マイティフォルム, 10426,1,3びきかぞく, +10426,5,Famille de Trois,Famignol Famille de Trois 10426,9,Family of Three, 10426,11,3びきかぞく, 10427,1,たれたすがた, +10427,5,Forme Affalée,Nigirigon Forme Affalée 10427,9,Droopy Form, 10427,11,たれたすがた, 10428,1,のびたすがた, +10428,5,Forme Raide,Nigirigon Forme Raide 10428,9,Stretchy Form, 10428,11,のびたすがた, 10429,1,ブルーフェザー, +10429,5,Plumage Bleu,Tapatoès Plumage Bleu 10429,9,Blue Plumage, 10429,11,ブルーフェザー, 10430,1,イエローフェザー, +10430,5,Plumage Jaune,Tapatoès Plumage Jaune 10430,9,Yellow Plumage, 10430,11,イエローフェザー, 10431,1,ホワイトフェザー, +10431,5,Plumage Blanc,Tapatoès Plumage Blanc 10431,9,White Plumage, 10431,11,ホワイトフェザー, 10432,1,とほフォルム, +10432,5,Forme Marche,Mordudor Forme Marche 10432,9,Roaming Form, 10432,11,とほフォルム, 10433,1,せいげんけいたい, +10433,5,Forme Limitée,Koraidon Forme Limitée 10433,9,Limited Build, 10433,11,せいげんけいたい, 10434,1,しっそうけいたい, +10433,5,Forme de Course,Koraidon Forme de Course 10434,9,Sprinting Build, 10434,11,しっそうけいたい, 10435,1,ゆうえいけいたい, +10433,5,Forme de Nage,Koraidon Forme de Nage 10435,9,Swimming Build, 10435,11,ゆうえいけいたい, 10436,1,かっくうけいたい, +10433,5,Forme de Vol,Koraidon Forme de Vol 10436,9,Gliding Build, 10436,11,かっくうけいたい, 10437,1,リミテッドモード, +10437,5,Mode Bridé,Miraidon Mode Bridé 10437,9,Low-Power Mode, 10437,11,リミテッドモード, 10438,1,ドライブモード, +10438,5,Mode Terrestre,Miraidon Mode Terrestre 10438,9,Drive Mode, 10438,11,ドライブモード, 10439,1,フロートモード, +10439,5,Mode Aquatique,Miraidon Mode Aquatique 10439,9,Aquatic Mode, 10439,11,フロートモード, 10440,1,グライドモード, +10440,5,Mode Aérien,Miraidon Mode Aérien 10440,9,Glide Mode, 10440,11,グライドモード, 10441,1,アカツキ, 10441,3,붉은 달, 10441,4,赫月, -10441,5,Lune Vermeille, +10441,5,Lune Vermeille,Ursaking Lune Vermeille 10441,6,Blutmond, 10441,7,Luna Carmesí, 10441,8,Luna Cremisi, @@ -3577,7 +3614,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10442,1,いどのめん, 10442,3,우물의가면, 10442,4,水井面具, -10442,5,Masque du Puits, +10442,5,Masque du Puits,Ogerpon du Puits 10442,6,Brunnenmaske, 10442,7,Máscara Fuente, 10442,8,Maschera Pozzo, @@ -3587,7 +3624,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10443,1,かまどのめん, 10443,3,화덕의가면, 10443,4,火灶面具, -10443,5,Masque du Fourneau, +10443,5,Masque du Fourneau,Ogerpon du Fourneau 10443,6,Ofenmaske, 10443,7,Máscara Horno, 10443,8,Maschera Focolare, @@ -3597,7 +3634,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10444,1,いしずえのめん, 10444,3,주춧돌의가면, 10444,4,礎石面具, -10444,5,Masque de la Pierre, +10444,5,Masque de la Pierre,Ogerpon de la Pierre 10444,6,Fundamentmaske, 10444,7,Máscara Cimiento, 10444,8,Maschera Fondamenta, @@ -3605,13 +3642,14 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10444,11,いしずえのめん, 10444,12,礎石面具, 10445,1,テラスタルフォルム, -10445,5,Forme Téracristal, +10445,5,Forme Téracristal,Terapagos Téracristal 10445,6,Terakristall-Form, 10445,7,Forma teracristal, 10445,8,Forma Teracristal, 10445,9,Terastal Form, 10445,11,テラスタルフォルム, 10446,1,ステラフォルム, +10446,5,Forme Stellaire,Terapagos Stellaire 10446,6,Stellarform, 10446,7,Forma astral, 10446,9,Stellar Form, @@ -3619,7 +3657,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10447,1,タカイモノのすがた, 10447,3,알짜배기의 모습, 10447,4,高檔貨的樣子, -10447,5,Forme Onéreuse, +10447,5,Forme Onéreuse,Poltchageist Forme Onéreuse 10447,6,Kostbarkeitsform, 10447,7,Forma Opulenta, 10447,8,Forma Pregiata, @@ -3629,7 +3667,7 @@ pokemon_form_id,local_language_id,form_name,pokemon_name 10448,1,ケッサクのすがた, 10448,3,걸작의 모습, 10448,4,傑作的樣子, -10448,5,Forme Exceptionnelle, +10448,5,Forme Exceptionnelle,Théffroyable Forme Exceptionnelle 10448,6,Edle Form, 10448,7,Forma Exquisita, 10448,8,Forma Eccezionale, From f364369f5e522fb8aa6a888225c576ef2b9addf8 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Thu, 1 Feb 2024 18:49:24 +0100 Subject: [PATCH 21/22] refactor: use compose V2 --- .dockerignore | 4 ++-- Makefile | 20 ++++++++++---------- README.md | 6 +++--- Resources/docker/app/README.md | 2 +- config/settings.py | 2 +- docker-compose-dev.yml | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.dockerignore b/.dockerignore index dd4e3be51..284495135 100644 --- a/.dockerignore +++ b/.dockerignore @@ -18,10 +18,10 @@ graphql .vscode .github .circleci -docker-compose.yml +docker-compose* .dockerignore /*.md /*.js .env *pycache* -target \ No newline at end of file +target diff --git a/Makefile b/Makefile index 33d903101..c6c9e772f 100755 --- a/Makefile +++ b/Makefile @@ -42,38 +42,38 @@ shell: # Load a shell python manage.py shell ${local_config} docker-up: # (Docker) Create services/volumes/networks - docker-compose up -d + docker compose up -d docker-migrate: # (Docker) Run any pending migrations - docker-compose exec -T app python manage.py migrate ${docker_config} + docker compose exec -T app python manage.py migrate ${docker_config} docker-build-db: # (Docker) Build the database - docker-compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${docker_config}' + docker compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${docker_config}' docker-make-migrations: # (Docker) Create migrations files if schema has changed - docker-compose exec -T app sh -c 'python manage.py makemigrations ${docker_config}' + docker compose exec -T app sh -c 'python manage.py makemigrations ${docker_config}' docker-flush-db: # (Docker) Removes all the data present in the database but preserves tables and migrations - docker-compose exec -T app sh -c 'python manage.py flush --no-input ${docker_config}' + docker compose exec -T app sh -c 'python manage.py flush --no-input ${docker_config}' docker-destroy-db: # (Docker) Removes the volume where the database is installed on, alongside to the container itself docker rm -f pokeapi_db_1 docker volume rm pokeapi_pg_data docker-shell: # (Docker) Launch an interative shell for the pokeapi container - docker-compose exec app sh -l + docker compose exec app sh -l docker-stop: # (Docker) Stop containers - docker-compose stop + docker compose stop docker-down: # (Docker) Stop and removes containers and networks - docker-compose down + docker compose down docker-test: # (Docker) Run tests - docker-compose exec -T app python manage.py test ${local_config} + docker compose exec -T app python manage.py test ${local_config} docker-prod: - docker-compose -f docker-compose.yml -f docker-compose.override.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d + docker compose -f docker-compose.yml -f docker-compose.override.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d docker-setup: docker-up docker-migrate docker-build-db # (Docker) Start services, prepare the latest DB schema, populate the DB diff --git a/README.md b/README.md index bef287fec..7a40f29c5 100755 --- a/README.md +++ b/README.md @@ -83,9 +83,9 @@ 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' +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/](http://localhost/api/v2/) or [localhost/api/v2/pokemon/bulbasaur/](http://localhost/api/v2/pokemon/bulbasaur/) on port `80`. diff --git a/Resources/docker/app/README.md b/Resources/docker/app/README.md index 8e2b87794..48c5d5486 100644 --- a/Resources/docker/app/README.md +++ b/Resources/docker/app/README.md @@ -35,7 +35,7 @@ The container connects to a Redis cache via the environment variable `REDIS_CONN ### Run the container -The container exposes port `80`. It needs a PostgreSQL and a Redis instance to connect to. Refer to the section [How to use this image](./how-to-use-this-image) for mapping the environment variables. +The container exposes port `80`. It needs a PostgreSQL and a Redis instance to connect to. Refer to the section [How to use this image](#how-to-use-this-image) for mapping the environment variables. It's recommended to use the provided [docker-compose.yml](https://github.com/PokeAPI/pokeapi/blob/master/docker-compose.yml) to start a container from this image. diff --git a/config/settings.py b/config/settings.py index 8213dd2e0..5a159bd1d 100755 --- a/config/settings.py +++ b/config/settings.py @@ -9,7 +9,7 @@ TEMPLATE_DEBUG = DEBUG ADMINS = ( - os.environ.get("ADMINS", "Paul Hallett,paulandrewhallett@gmail.com").split(","), + os.environ.get("ADMINS", "Pokeapi,team@pokeapi.co").split(","), ) EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 77e0dc5e4..4df009e6f 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -6,4 +6,4 @@ services: context: . dockerfile: ./Resources/docker/app/Dockerfile -# docker-compose -f docker-compose.yml -f docker-compose-dev.yml up -d +# docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d From a492d4f9d3f15428c36ccc65854f883b6ad08f74 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Fri, 22 Mar 2024 21:54:25 +0100 Subject: [PATCH 22/22] refactor: style --- config/settings.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/settings.py b/config/settings.py index 5a159bd1d..3dfa4af1b 100755 --- a/config/settings.py +++ b/config/settings.py @@ -8,9 +8,7 @@ TEMPLATE_DEBUG = DEBUG -ADMINS = ( - os.environ.get("ADMINS", "Pokeapi,team@pokeapi.co").split(","), -) +ADMINS = (os.environ.get("ADMINS", "Pokeapi,team@pokeapi.co").split(","),) EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"