Nookipedia / nookipedia-api

Nookipedia's custom API for querying data from the Animal Crossing video game series.
https://api.nookipedia.com/
MIT License
40 stars 12 forks source link
api flask hacktoberfest nookipedia wiki

nookipedia-api

The Nookipedia API is a free RESTful service provides endpoints for retrieving Animal Crossing data pulled from the Nookipedia wiki, the largest community-driven encyclopedia about the series. Built using Python and Flask, the key benefit of using this API is access to clean structured data spanning the entire Animal Crossing series, pulled from information that is constantly updated and expanding as editors work on the wiki.

Visit https://api.nookipedia.com/ for more information.

Support

Our primary method of supporting users and developers is through the Nookipedia Discord; API users and contributors are granted access to the private #wiki-api channel where they can participate in a community of practice and receive near round-the-clock support.

You may also open an issue here on GitHub if you need help, would like to request a feature, or have a bug to report.

Contributing

Anyone is welcome and encouraged to contribute to this API!

See the contributing guide for full details and guidance.

Technical Overview

Nookipedia, which runs on the MediaWiki wiki software (same as Wikipedia), utilizes the Cargo extension. Cargo lets editors store data from templates in structured databases. For example, if you visit any villager's article on Nookipedia (e.g. Rosie), there is an infobox at the top-right of the page; all that information as defined in the infobox is also stored in a database on the backend so that it can be queried elsewhere on the wiki, or externally by third parties. See Nookipedia's Project Database for more information.

This API is essentially a wrapper for the MediaWiki Cargo API that comes as part of the extension. See the MediaWiki cargoquery endpoint for how Cargo tables can be queried directly.

While the Cargo API is freely available for querying, we have our custom-built API for the following reasons:

Deployment

This application requires Python 3 and venv.

This application has the following dependencies from apt get:

Before running this application:

$ sudo sqlite3 <desired_db_name>.db
sqlite3> CREATE TABLE <keys_table_name> ( key varchar(32), email TEXT, project TEXT );
sqlite3> CREATE TABLE <admin_keys_table_name> ( key varchar(32) );
sqlite3> INSERT INTO <keys_table_name> VALUES ( "<uuid>", "test", "test" );
sqlite3> .exit 0;

Local / Dev

flask run --host=0.0.0.0. Easy.

Note that Flask's built-in server is not suitable for production.

Production

There are a variety of options out there for setting up a proper production server (cloud services, Gunicorn, uWSGI, etc.). Visit Flask's deployment page for a list of options.

Nookipedia's API is deployed via uWSGI and nginx. If you'd like to set up something similar and need help, feel free to get in touch.

Licensing

The Nookipedia API codebase is licensed under the MIT license. See license file for full text.

Dependencies are copyright their respective authors and used under their respective licenses.