Skip to main content

Dragon-Ball-API

Api unofficial de dragon ball inspirado en su fandomhttps://dragonball.fandom.com/es/wiki/Dragon_Ball_Wiki_Hispano. Esta api nos permite obtener datos de personajes, sagas, fusiones, lugares y videojuegos de manera sencilla. Para poder utilizarlo en nuestras aplicaciones.

Requerimientos

Para instalar los requerimientos instale los requerimientos del archivo requirements.txt con el siguiente comando

pip install -r requirement.txt

Importaciones

from DragonBall.Data.Characters import Characters
from DragonBall.Data.Sagas import Sagas
from DragonBall.Data.Planets import Planets
from DragonBall.Data.Fusions import Fusions
from DragonBall.Data.VideoGames import VideoGames
from DragonBall.OutInformation import OutInformation

Instalación

pip install Dragon-Ball-API

Usage

>>> from DragonBall.Data.Characters import Characters

>>> search_goku = Characters('Goku')
>>> search_goku.character_information()

{
'name': 'Son Goku', 'image': 'https://example.com', 'description': 'descripcion', 
'names': {'japan_name': '...', 'latin_name': '...', 'pronunciation_name': '...', 'other_names': '...'}, 
'data': {'gender': '...', 'birthday': '...', 'origin': '...', 'family': ['...','...'], 'transformations': ['...', '...'], etc.. },
'debut': {'sagas': [{'title': '...', 'url': '...'}], 'debut': '...'}
}

Algunos personajes tendran más datos que otros. Eso dependera de la información que se encuentre en la wiki de dragon ball en ese momento. Si deseamos podemos pasar una lista de personajes a buscar y usar el método list para devolvernos la información de todos los personajes.

>>> from DragonBall.Data.Characters import Characters

goku_family = ['Son Gohan (abuelo)', 'Bardock', 'Gine', 'Raditz', 'Rey Gyuma', 'Milk', 'Gohan', 'Goten', 'Mr. Satán', 'Videl', 'Pan', 'Son Goku Jr.']

>>> character_list = Characters.character_list(goku_family)

[{'...'},{'...'}]

Podemos ver una lista de los personajes usando el método list de la clase. De la siguiente manera.

>>> Characters.list()

{
'Personajes por raza': ['Androides', 'Animales', 'Arlianos', 'Ángeles', '...', '...'],
'Personajes por asociación': ['...', '...', '...']
}

Si queremos imprimir los datos de manera más legible podemos utilizar el método beautiful_print_dict de la clase OutInformation

>>> OutInformation.beautiful_print_dict(Characters.list())

"Personajes por raza": [
    "Androides",
    "Animales",
    "Arlianos",
    "Ángeles",
    "..."
 ]

Todos estos metodos los podemos aplicar en todas sus clases (sagas, juegos, etc).

Release files for Dragon-Ball-API 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Dragon-Ball-API 1.0.0
File Size Uploaded
Dragon-Ball-API-1.0.0.tar.gz 7.3 kB Details

Release files / Dragon-Ball-API-1.0.0.tar.gz

Download URL Dragon-Ball-API-1.0.0.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
497d786d64e7a6d5c4070bfebee80452247edf713207726b6b272a2a435c0a88
BLAKE2b-256 checksum
How to use checksums
6276fc54e9bff4a580e9bddc4cc192734395f1eee4b0342c17f58917f6249751
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page