Coder Social home page Coder Social logo

joakimskoog / anapioficeandfire Goto Github PK

View Code? Open in Web Editor NEW
343.0 343.0 68.0 2.54 MB

An API of Ice And Fire is the world's greatest source for quantified and structured data from the universe of Ice and Fire (as well as the HBO series Game of Thrones).

License: Other

C# 92.78% CSS 1.98% HTML 5.24%

anapioficeandfire's People

Contributors

afram avatar arbazsiddiqui avatar avatoo avatar dependabot-support avatar endi1 avatar imsodin avatar joakimskoog avatar kberger avatar m-dinardo avatar nthun avatar stevostabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anapioficeandfire's Issues

403 Forbidden Responses on Python urllib.request.urlopen calls

Accessing any portion of the API through the urlopen function of Python 3's urllib.request library results in a 403 code being returned. This includes even the main homepage, not just calls to the API. However, access through the browser seems to work as intended, as I'm able to access JSON data directly by entering resource URLs into the navigation bar (at least, on Chrome).

ETag support

We need support for using ETag headers so that clients can use If-None-Match for cache

Async Books

Retrieving the books should be made async

Normalize dataset (add tables & foreign keys for redundat data).

Transform this:

{"Id":38,"Name":"Aegon I","Culture":"Valyrian","Titles":["King of All Westeros","Shield of His People","King of the Andals, the Rhoynar and the First Men","Lord of the Seven Kingdoms","Protector of the Realm","Lord of Dragonstone"],"Aliases":["Aegon the Conqueror","Aegon the Dragon","Aegon the Dragonlord"],"Born":"27 BC, at Dragonstone","Died":"37 AC, at Dragonstone","Father":59,"Mother":1070,"Spouse":2071,"Children":[57,694],"Allegiances":[],"Books":[11,9,4,6,7,1,2,3,5,8],"PovBooks":[],"PlayedBy":[""],"TvSeries":[]}

Into:

{"Id":38,"Name":"Aegon I","Culture": 1,"Titles":[1, 2, 3, 4, 5, 6],"Aliases":["Aegon the Conqueror","Aegon the Dragon","Aegon the Dragonlord"],"Born":"27 BC, at Dragonstone","Died":"37 AC, at Dragonstone","Father":59,"Mother":1070,"Spouse":2071,"Children":[57,694],"Allegiances":[],"Books":[11,9,4,6,7,1,2,3,5,8],"PovBooks":[],"PlayedBy":[""],"TvSeries":[]},

Culture:

{"Id": 1, "Value": "Valyrian"}

Title:

{"Id": 1, "Value": "King of All Westeros"},
{"Id": 2, "Value": "Shield of His People"},
{"Id": 3, "Value": "King of the Andals, the Rhoynar and the First Men"},
{"Id": 4, "Value": "Lord of the Seven Kingdoms"},
{"Id": 5, "Value": "Protector of the Realm"},
{"Id": 6, "Value": "Lord of Dragonstone"}

etc.

Retrieve entities by name

Retrieving entities by name seems to be a pretty sought after feature, this would also be really simple to implement. It can either be implemented via a new action or adding filter functionality to the existing actions.

Root endpoint

Get request to root endpoint should return all other endpoints

Gzip support

We need support for gzip on all actions to save bandwidth

Versioning

Versioning of controllers via accept headers

Make the Feeder run quicker

At the moment a whole seed of the database with the Feeder takes about 1 min. It would be nice if the whole seeding operation could take under 10 seconds.

Adding data via pull-requests is not sustainable.

Users should be allowed to suggest new data/corrections directly (via API). System could track these suggestions separately in the server DB, and the changes could be reviewed by people and saved to the dataset files in a batch.

Rate limiting

We want some kind of rate limiting to prevent malicious consumers

Remove keys with empty (null, []) values from datafiles.

If the schema is defined, replacing

{"Id":38,"Name":"Aegon I","Culture":"","Titles":["King of All Westeros","Shield of His People","King of the Andals, the Rhoynar and the First Men","Lord of the Seven Kingdoms","Protector of the Realm","Lord of Dragonstone"],"Aliases":["Aegon the Conqueror","Aegon the Dragon","Aegon the Dragonlord"],"Born":"27 BC, at Dragonstone","Died":"37 AC, at Dragonstone","Father":59,"Mother":1070,"Spouse":2071,"Children":[57,694],"Allegiances":[],"Books":[11,9,4,6,7,1,2,3,5,8],"PovBooks":[],"PlayedBy":[""],"TvSeries":[]}

with

{"Id":38,"Name":"Aegon I","Titles":["King of All Westeros","Shield of His People","King of the Andals, the Rhoynar and the First Men","Lord of the Seven Kingdoms","Protector of the Realm","Lord of Dragonstone"],"Aliases":["Aegon the Conqueror","Aegon the Dragon","Aegon the Dragonlord"],"Born":"27 BC, at Dragonstone","Died":"37 AC, at Dragonstone","Father":59,"Mother":1070,"Spouse":2071,"Children":[57,694],"Books":[11,9,4,6,7,1,2,3,5,8]}

will save significant space.

Use summary objects instead of links to api calls

I don't really think that the api should reference a link to itself, because

  1. Any code that could reasonably parse the information from the url, would know how to make a request for a given ID anyway.
  2. The information isn't useful in and of itself

eg.

"allegiances": [  
            "http://anapioficeandfire.com/api/houses/362"
    ],

I know you probably didn't include the entire "house" object in the allegiance array because it would really bloat up the size of the request, however, if you instead used a "house summary" object, it could contain useful information, and still not be too bloated.

eg.

    "allegiances": [  
    {"ID":362,
      "name":"House Stark of Winterfell",
       "region":"The North"}
    ],

This way, some useful information can be displayed from a single API call, but the ID is still included so that additional API calls can be made for more information

Pagination for links in resources.

We might want to implement pagination for links in resources to prevent a too big payload. A good example is Book.Characters which can have several hundreds (or even thousands) links to different Character resources.

Styling

Decide a style and implement it

Add API versioning.

The data schema is going to change rapidly (initially at least), so to make the life of client developers easier, they should be able to rely on at least one stable API version.

Unhandled exceptions

Unhandled exceptions should not show stack trace to consumers. Instead show a 500 error with a message that we're working on fixing the problem.

Pagination

Support for pagination in Link header

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.