Well, I would use the pandas library to read the Excel files. Then you just
need to iterate over those rows and create the Beancount syntax. I have
started similar work by using pandas to store the data I had read from
Quicken files, see the github https://github.com/UweZiegenhagen/PyQIF-Parser.
Your task may be a bit easier as you do not have to parse the QIF file
first, you already have the Excel. For you the following function inside
PyQifParser.py could be interesting


def to_beancount(self, outputfile):
"""
Exports the transactions, accounts, classifications and
categories from pandas dataframe into an Excel-file
@TODO: waits for detailed specifications, currency is still hardwired
"""
self.transactions['bcdate'] = self.transactions['Date'].dt.strftime(
'%Y-%m-%d')
with open(outputfile, "w", encoding="utf-8") as writer:
for entry in self.transactions.index:
writer.write(self.transactions['bcdate'][entry] + ' * "' + str(self.
transactions['Description'][entry])[:50] + '"\n')
writer.write('\t' + self.transactions['Category'][entry] + '\t'*10 + str(
self.transactions['Amount'][entry]) + ' EUR\n')
writer.write('\t' + self.transactions['Category'][entry] + '\t'*10 + str(-1
* self.transactions['Amount'][entry]) + ' EUR\n\n')




Am So., 24. Mai 2020 um 12:52 Uhr schrieb Chary Chary <[email protected]>:

>
> Dear all,
>
> can you please comment on the following my idea.
>
> I keep all my data in Excel spreadsheets and I am kind of hesitant to move
> it all to text format.
>
> Let us say for simplicity I have the following spreadsheets
>
>
>    -
>
>    Euro paying account
>    -
>
>    USD paying account
>    -
>
>    Cash spending spreadsheet (for all currencies). I use
>    https://toshl.com/ for this.
>
>
> In each of these spreadsheets I use the same set of categories to assign
> to transactions (e.g. grosseries, entertainment etc).
>
> So my idea is to keep data in these spreadsheets, but to use beancount to
> pull data together, and analyze this all together. I assume, that I may be
> adding some limited  transactions in traditional beancount textual format
> (e.g. to link transfers between accounts)
>
> To achieve this I propose to write plugins, which will read Excel file and
> return entries in beancount format.
>
> Any thoughts on this?
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beancount/4db1ccc9-6e45-43d0-88ca-762d3868f0da%40googlegroups.com
> <https://groups.google.com/d/msgid/beancount/4db1ccc9-6e45-43d0-88ca-762d3868f0da%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Dr. Uwe Ziegenhagen
0179-7476050
<http://www.uweziegenhagen.de>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAML7JCgCcWTMBY-3%2BOdZ80unKJ%2BwHXXqOT8hofCFkxy9O%3D1xDA%40mail.gmail.com.

Reply via email to