This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### This script adds metric (UK) units and unit conversions to grocy | |
### inspired by https://gist.github.com/randompherret/f772d43cb618b55997f203e023631d5f | |
### this script is by no means perfect however it can handle failed runs and restarting midway through | |
### usage: python quantity_units.py | |
### make sure to set the environment variables in a .env file in the same directory as this script | |
### GROCY_API_KEY and GROCY_BASE_URL are required | |
### LOG_TO_FILE and DELETE_EXISTING_UNITS are optional | |
### LOG_TO_FILE will log the added units and conversions to a file (not used for anythning just interesting) | |
### DELETE_EXISTING_UNITS will delete all existing units in grocy before adding new ones |