Arkindex Export
Easily build queries for Arkindex SQLite exports
Usage
The only requirement is to have an Arkindex export database. The Arkindex documentation includes how to obtain one and what it contains.
This Python package offers up-to-date Peewee models to build queries against the database through the ORM, instead of writing raw SQL.
Upgrade the version of an existing export
If you have an older version of the export, a script may help you update it directly. These scripts are located in the upgrades folder of the Git repository. They must exactly match the existing export version, please use them carefully. We strongly recommend backing up the database before migrating it!
Example usage:
sqlite3 -bail export_version_10.sqlite < upgrades/10_to_11.sql
Development
For development and tests purpose it may be useful to install the project as an editable package with pip.
-
Use a virtualenv (e.g. with virtualenvwrapper
mkvirtualenv -a . export) -
Install export as a package (e.g.
pip install -e .)
Linter
Code syntax is analyzed before submitting the code. To run the linter tools suite you may use pre-commit.
pip install pre-commit
pre-commit run -a
Run tests
Tests are executed with tox using pytest.
pip install tox
tox
To reload the test virtual environment you can use tox -r
Run a single test module: tox — <test_path>
Run a single test: tox — <test_path>::<test_function>