This is a collection of tools to retrieve the GC -> OC code mappings used on the Opencaching.de site.
Make sure you have
installed on your device.
- Retrieve an OKAPI key and download a database snapshot.
- Unpack the downloaded file into a directory starting with
fulldump
(to ignore it on commit by default). - Rename the
configuration-example.py
file toconfiguration.py
. Edit the file and change the parameters to match your setup. - Run
python3 -m load_fulldump
to load the data from the fulldump into the database.
- Run
python3 -m perform_update
to update the database. This needs to be executed at least every 10 days, but should not be used with less than 5 minutes apart. - Run
python3 -m export_csv
to create the CSV file with the mapping.
- Run
python3 -m upload_changes
to push the changes to the Git repository.
Please note that this performs a forced push of a re-initialized repository, overwriting the existing Git history. This is done for privacy reasons, as deactivated accounts with their cache data being deleted due to GDPR would still be mappable otherwise. For this reason you should make sure that the remote branch is not protected so it does not deny forced pushes (should be no problem with the default setup on GitHub).
After installing black, you should be able to run black .
from the root directory of this repository to apply auto-formatting.
To check formatting itself, use flake8 --max-line-length 88 *.py
after installing flake8.
The tools inside this repository are licensed under the MIT License (see the LICENSE.md
file for details).
The actual data retrieved from the OKAPI follows the Opencaching.de data license, which means you can use them under the terms of the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Germany (CC BY-NC-ND 3.0 DE) license.