I use these tools to calculate my tax reports. They need to be adapted for your own use, but might be useful as a reference so I decided to publish them.
lifo and fifo require CSV reports from several services, some of them as they were downloaded others slightly adapted.
If you need help in creating your own reports, contact me at pharesim@protonmail.com for a deal.