janaipakos / ghibliapi

A simple API for Studio Ghibli resources. Unofficial/fan-made
https://ghibliapi.herokuapp.com
MIT License
310 stars 109 forks source link

Add new python3 wrapper #51

Closed Nekidev closed 1 year ago

Nekidev commented 1 year ago

I created a python3 wrapper for the API and added it to the README.md. I believe it is easier to use than the existent wrapper.

Some features this library has:

Example of dynamic loading:

from anime_api.apis import StudioGhibliAPI

api = StudioGhibliAPI()

# This object is loaded
anime = api.get_anime(anime_id="some-uuid-id")

# List of unloaded `Person` objects
people = anime.people

# Still unloaded
person = people[0]

# Loads when the property is accessed (delay accessing because the API request is made here). 
# Can also be loaded using `person.load()`. The loaded state can be checked using 
# `person.is_loaded`
person.name

# The object was already loaded before so this won't have a delay (nor request to the API)
person.hair_color