Liber Revelio

Posted by in Technology

Just a quick update.

Characters and their appearances in books and films have now been mapped – and boy was it a long task. I’ve made a sweeping decision that appearances, as well as mentions of a characters constitute them being associated with the book or film. For example, Algie (Neville’s great-uncle) doesn’t appear in the books or films but is mentioned in The Philosophers Stone as well as in The Order of the Phoenix. As such, Algie has been mapped to those two books.

A future development point might be to split out these mappings and assign them a type so that appearances and mentions can be differentiated, but for now they are grouped in together.

So the data available to date is:

  • Characters
  • Spells
  • Books
  • Films
  • Hogwarts Houses

Characters will have properties identifying their films and books as well as their Hogwarts House where appropriate. Houses will also have properties identifying their Ghost (this will be a reference to the Ghosts character ID) as well as their founder and current head of house. Here are a few examples:

Character

{
    "character": {
        "animagus": "Cat", 
        "books": [
            {
                "book_id": 1, 
                "name": "Harry Potter and the Philosopher's Stone", 
                "url": "http://localhost:5000/books/1"
            }, 
            {
                "book_id": 2, 
                "name": "Harry Potter and the Chamber of Secrets", 
                "url": "http://localhost:5000/books/2"
            }, 
            {
                "book_id": 3, 
                "name": "Harry Potter and the Prisoner of Azkaban", 
                "url": "http://localhost:5000/books/3"
            }, 
            {
                "book_id": 4, 
                "name": "Harry Potter and the Goblet of Fire", 
                "url": "http://localhost:5000/books/4"
            }, 
            {
                "book_id": 5, 
                "name": "Harry Potter and the Order of the Phoenix", 
                "url": "http://localhost:5000/books/5"
            }, 
            {
                "book_id": 6, 
                "name": "Harry Potter and the Half-Blood Prince", 
                "url": "http://localhost:5000/books/6"
            }, 
            {
                "book_id": 7, 
                "name": "Harry Potter and the Deathly Hallows", 
                "url": "http://localhost:5000/books/7"
            }
        ], 
        "character_id": 114, 
        "eye_colour": "Green", 
        "films": [
            {
                "film_id": 1, 
                "name": "Harry Potter and the Philosopher's Stone", 
                "url": "http://localhost:5000/films/1"
            }, 
            {
                "film_id": 2, 
                "name": "Harry Potter and the Chamber of Secrets", 
                "url": "http://localhost:5000/films/2"
            }, 
            {
                "film_id": 3, 
                "name": "Harry Potter and the Prisoner of Azkaban", 
                "url": "http://localhost:5000/films/3"
            }, 
            {
                "film_id": 4, 
                "name": "Harry Potter and the Goblet of Fire", 
                "url": "http://localhost:5000/films/4"
            }, 
            {
                "film_id": 5, 
                "name": "Harry Potter and the Order of the Phoenix", 
                "url": "http://localhost:5000/films/5"
            }, 
            {
                "film_id": 6, 
                "name": "Harry Potter and the Half-Blood Prince", 
                "url": "http://localhost:5000/films/6"
            }, 
            {
                "film_id": 8, 
                "name": "Harry Potter and the Deathly Hallows: Part 2", 
                "url": "http://localhost:5000/films/8"
            }
        ], 
        "gender": "Female", 
        "hair_colour": "Black", 
        "hogwarts_house": {
            "house_id": 1, 
            "name": "Gryffindor", 
            "url": "http://localhost:5000/houses/1"
        }, 
        "name": "Minerva McGonagall", 
        "patronus": "Cat", 
        "species": "Human", 
        "url": "http://localhost:5000/characters/114", 
        "wand": "Fir and dragon heartstring, nine and a half inches, stiff"
    }
}

Hogwarts House

{
    "house": {
        "animal": "Eagle", 
        "colours": "Blue and Bronze", 
        "common_room": "Ravenclaw Tower", 
        "element": "Air", 
        "founder": {
            "character_id": 158, 
            "name": "Rowena Ravenclaw", 
            "url": "http://localhost:5000/characters/158"
        }, 
        "ghost": {
            "character_id": 84, 
            "name": "Helena Ravenclaw", 
            "url": "http://localhost:5000/characters/84"
        }, 
        "head_of_house": {
            "character_id": 63, 
            "name": "Filius Flitwick", 
            "url": "http://localhost:5000/characters/63"
        }, 
        "house_id": 3, 
        "name": "Ravenclaw", 
        "url": "http://localhost:5000/houses/3", 
        "values": [
            {
                "name": "Creativity", 
                "url": "http://localhost:5000/values/5", 
                "value_id": 5
            }, 
            {
                "name": "Intelligence", 
                "url": "http://localhost:5000/values/8", 
                "value_id": 8
            }, 
            {
                "name": "Learning", 
                "url": "http://localhost:5000/values/11", 
                "value_id": 11
            }, 
            {
                "name": "Wit", 
                "url": "http://localhost:5000/values/16", 
                "value_id": 16
            }
        ]
    }
}

Still to do?
* Code maintenance / tidying
* Rate limiting (don’t worry, it’ll be more than generous)
* Documentation
* Pagination for large responses