Code Monkey home page Code Monkey logo

westwood's Introduction

Westwood

Westwood stores high-quality Pokemon game data in a human-readable format that is easy to extend and use.

Westwood can be used in any Pokemon software project that requires Pokemon data. The API and final data representation are flexible because they can be defined by the client software project. Westwood does not enforce a particular API or data representation.

Data Format

XML has been chosen as the primary data storage format. XML is human-readable, easy to understand for non-programmers, widely supported by many different programming languages, and is verifiable for correctness through the use of XML Schema Definition (XSD) files. Human-readability should be prioritized over implementation wherever possible. It is intended that the data set be easily extensible for new official Pokemon games, and popular fan-made content (such as ROM hacks).

Usage

Westwood contains Python scripts to verify the correctness of all XML data, and to convert the XML data to a format that lends itself to generating a relational database.

Westwood data can be converted to any data format, if support is added. To start with, Westwood will only support conversion to Django models, which can then be populated with a Django management command. If other formats are required (such as JSON or CSV), support can be added at a later date. Westwood is intended to be easily extensible and adaptable.

Python 3 is required. To install all Python requirements:

pip install -r requirements.txt

To validate the XML data, run the following command:

python3 validate.py

To auto-generate Django models inside the django-westwood app, run the following command:

python3 convert_to_django.py

This will read every XSD file and generate Python classes that describe each model. Then, a database can be generated using the models, and populated from the XML data by running a Django management command.

Add the Westwood Django app to a Django project by copying the django-westwood/westwood directory to the project, and editing the project's settings.py file:

INSTALLED_APPS = [
    'westwood.apps.WestwoodConfig',
    ...
]

Next, copy the provided westwood_router.py file to the Django project. This will direct all Westwood models and data to a separate database. Then, edit settings.py again:

DATABASE_ROUTERS = ['SampleDjangoProject.westwood_router.WestwoodDatabaseRouter']

Next, run the migration to create the Westwood database:

python manage.py migrate --database=westwood

Finally, run the management command to populate the Westwood database:

python manage.py import_westwood_data

If all was successful, a westwood.sqlite3 file (or other database) should now exist with all Westwood data.

Contributing

If you notice any errors in the data or would like to contribute, there are several ways you can help:

  • Open an issue on GitHub
  • Fix the issue and open a pull request on GitHub (be sure to follow the rules on the Contributing page)
  • Contact EverOddish on Twitter

Name Origin

The name "Westwood" comes from Professor Westwood, a Pokedex programmer. https://bulbapedia.bulbagarden.net/wiki/Professor_Westwood_V

Disclaimer

All Pokemon data is owned by The Pokemon Company International. This project should not be used for commercial purposes.

westwood's People

Contributors

dependabot[bot] avatar everoddish avatar thesupernoob avatar

Watchers

 avatar

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.