Morphex's blogologue (Life, technology, music, politics, business, mental health and more)

This is the blog of Morten W. Petersen, aka. morphex in various places. I blog about my life, and what I find interesting and/or important. This is a personal blog without any editor or a lot of oversight so treat it as such. :)

My email is morphex@gmail.com.

I am leavingnorway.info.

An OGG/Vorbis player, implemented in Javascript.

My Kiva bragging page
My shared (open source) code on GitHub

Morphex's Blogodex

News
Me on Instagram
Slashdot

Zope hosting by Nidelven IT

Morten Petersen on Linkedin

Morten Petersen on Facebook

Morten Petersen on SoundCloud

Morten Petersen on MixCloud

Blogologue on Twitter



Older entries



Atom - Subscribe - Categories

Facebook icon Share on Facebook Google+ icon Share on Google+ Twitter icon Share on Twitter LinkedIn icon Share on LinkedIn

Exchange rate file parsing for ravencoin taxman

I hacked a little more on the

https://github.com/morphex/ravencoin-taxman/

Ravencoin accounting tool today, it takes a lighter approach than ethereum-classic-taxman, downloading a CSV file of transactions instead of running through all the blocks in a blockchain node to find relevant transactions.

Since it does that, it makes things a bit less mentally demanding to work with, and I need to get FIFO sorted out for accounting purposes, so that it is possible to calculate loss and gains for capital tax.

Ravencoin-taxman works with data from different sources, one part is the Ravencoin transactions, another is the rate in USD for RVN at any given time (day) and finally a local currency is often necessary, in my case NOK, Norwegian kroner, to calculate things correctly for accounting and tax purposes.

Working a bit with CSV files, it is easy to appreciate their simplicity, on the other hand, they're not what you can call "well-defined" formats, for example the date fields in them can have different meanings based on where the CSV file is generated. YY/MM/DD or YY/DD/MM or even DD/MM/YY.

So I worked on that today. I think there is a little CSV tool that can be refactored into a separate Python package for working with CSV files, or data that isn't strictly declared or formatted.

CSV files are great in their simplicity and utility, but as this code shows:

https://github.com/morphex/ravencoin-taxman/commit/62fe3c364...

It takes quite a bit of work to make sure that data from CSV files is interpreted correctly, and if you're working with a limited amount of data, it is possible for that code to interpret a date wrong, switching the month and day fields the wrong way around.

[Permalink] [By morphex] [Ravencoin and ethereum (classic) accounting tools (Atom feed)] [29 May 14:40 Europe/Oslo]