Skip to main content

Librería para consultar estadísticas de Pokémon por grupo a partir de un CSV.

Project description

Librería Pokemon — Proyecto Final (PJZD)

Librería sencilla para generar y consultar estadísticas de Pokémon agrupadas por sus egg groups utilizando datos reales obtenidos desde la PokeAPI.

Incluye funciones para:

  • Descargar información de Pokémon y generar un CSV automáticamente.
  • Consultar altura media y peso medio por grupo.
  • Listar todos los grupos disponibles.

Instalación

pip install CAP-PF-Pokemon-PJZD==1.0.1

Funcionalidades

1. get_grupos_pokemon(csv_path)

Devuelve una lista con todos los grupos de Pokémon disponibles en el fichero CSV.

2. get_altura_media_grupo(grupo, csv_path)

Devuelve la altura media del grupo indicado. Si el grupo no existe, devuelve None.

3. get_peso_medio_grupo(grupo, csv_path)

Devuelve el peso medio del grupo indicado. Si el grupo no existe, devuelve None.

4. generar_csv_pokemon(csv_path="pokemon_stats.csv", limite=100)

Genera automáticamente un archivo CSV con estadísticas agrupadas por egg groups.

  • Descarga datos reales desde la PokeAPI
  • Ajusta el límite si se solicita más del máximo disponible
  • Devuelve la ruta del CSV generado

Ejemplos de uso

1) Generar el CSV (descarga datos y calcula medias)

from Pokemon import generar_csv_pokemon

generar_csv_pokemon(limite=150)

Esto creará un archivo pokemon_stats.csv con las estadísticas de 150 pokemons

2) Consultar los datos del CSV generado

from Pokemon import (
    get_grupos_pokemon,
    get_altura_media_grupo,
    get_peso_medio_grupo,
)

csv = "pokemon_stats.csv"

print(get_grupos_pokemon(csv)) 
# ['monster', 'bug', 'water1', 'fairy', ...]

print(get_altura_media_grupo("monster", csv))
# 15.5

print(get_peso_medio_grupo("bug", csv))
# 20.0

Licencia

MIT License — Puedes usarlo libremente para proyectos educativos o personales.


Autor

Pedro Javier Zambudio Decillis

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cap_pf_pokemon_pjzd-1.0.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cap_pf_pokemon_pjzd-1.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file cap_pf_pokemon_pjzd-1.0.1.tar.gz.

File metadata

  • Download URL: cap_pf_pokemon_pjzd-1.0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cap_pf_pokemon_pjzd-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2b1d643492821f76f6686e409b1581bb45510bb0657994d3888c1f245746be2e
MD5 49aae7157da3b1a4c70966e91a48e57d
BLAKE2b-256 2345c278cab963297a987783605ddec6db1bff10624f33714e38d4346a0d2017

See more details on using hashes here.

File details

Details for the file cap_pf_pokemon_pjzd-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cap_pf_pokemon_pjzd-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bf91dbdf8cd03a7bcc2c430880cf8505b45380c9c9e0c6c0ddc01febfe373b6
MD5 e233e3e0e1598479245ba99bbfa85e01
BLAKE2b-256 35f12b592f796b5d06fa16761c99c3f5640d8b2db74a7305407c33ecdd9b8643

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page