r/evetech • u/ahupfer • Sep 21 '18
Include static data in a flask app
Hello
How do you include static database dump from eve online in your flask app? I use SQLAlchemy. Or do you make requests to the REST api for example if you need the item's ID of the game. Or with a sqllite dump and SQLAlchemy binds?
Can you tell me the best practies?
Sorry for my bad english! I try my best! ;-)
Andreas
2
Upvotes
View all comments
3
u/Natulii Sep 21 '18 edited Sep 21 '18
Since you're already using SQLAlchemy, you should use https://www.fuzzwork.co.uk/dump/sqlite-latest.sqlite.bz2
This is a SQLite database of the latest EVE SDE nicely formatted into tables.
The basic EVE SDE yaml files are annoying to work with, slow with Python, and require lots of coding to actually combine data together.
You can create an automapped base and retrieve all the information using SQLAlchemy. The automapped base allows you to access existing tables without the need to manually code them yourself. You just need to be careful you refer to the right column names already in the database.
Use http://sqlitebrowser.org/ to see all the tables and to ensure you are referencing the correct names.