A python (3.10+) script to transfer your trade data from a freqtrade SQL database to Google Sheets.
- Clone the repo
git clone https://github.com/ecoppen/ft-to-gsheets.git
- Go into the ft-to-gsheets folder
cd ft-to-gsheets
- Install pipenv
pip install pipenv
- Adjust the Pipfile if you want to use Python 3.8 or 3.9 (last line)
nano edit Pipfile
- Install the requirements
pipenv install
- Add/check variables for Google Sheets (lines 9-12)
nano edit transfer.py
- Create
client_secret.json
using instructions from https://pygsheets.readthedocs.io/en/latest/authorization.htmlnano client_secret.json
pipenv run python transfer.py
- Edit cron
crontab -e
- Add line at bottom
3-59/5 * * * * /bin/bash -c "/root/ft-to-gsheets/transfer.sh"
3-59/5 * * * *
means every 5 minutes starting at minute 3, visit here to decide your ownhttps://crontab.guru/#3-59/5_*_*_*_*
- Install requirements to the pipenv
/usr/local/bin/pipenv install gspread pandas
/usr/local/bin/pipenv
is where pipenv can be found, typewhich pipenv
to find your own- Make the shell script executable
chmod +x /root/ft-to-gsheets/transfer.sh
- Edit the
transfer.sh
script as necessary if you have moved/changed the directory structure