MoritzR / fints2ledger

A tool for downloading transactions from FinTS banking APIs and sorting them into a ledger journal
MIT License
26 stars 8 forks source link

fints2ledger can't find data/pyfints.py #29

Closed varac closed 11 months ago

varac commented 11 months ago

So finally I'm getting to try the new version :smile:

I installed fints2ledger by downloading it into ~/bin/download, but it fails to start:

$ fints2ledger                                     
python3: can't open file '/home/varac/bin/download/data/pyfints.py': [Errno 2] No such file or directory

fints2ledger: PyFintsError "Failed to get FinTS transactions, check the message above."

When I symlink ~/bin/download/data to the data/ dir of the git project checkout it works, so I can work around this but it would be nice to fix this.

varac commented 11 months ago

I also need to place my template.txt in this directory, otherwise it's not recognized by fints2ledger. It would be great if it could stay in the config dir as before.

MoritzR commented 11 months ago

python3: can't open file '/home/varac/bin/download/data/pyfints.py'

That path looks correct though, doesn't it? Is the file present at that directory?

I am especially confused because it should specifically look for the files in the data directory next to the executable. This also works fine on my machine™. Can you explain more what you mean by symlinking to the data/ dir? I don't fully understand the file structure that works for you vs the one that does not work.

Regarding the template.txt file. I move it out of the .config directory intentionally. My reasons for this are the following:

Is fints2ledger actually picking up the template file that you want? If so, what are you customizing there? If some customization is needed, I would rather add back a more limited variation of the template file.

varac commented 11 months ago

That path looks correct though, doesn't it? Is the file present at that directory?

I am especially confused because it should specifically look for the files in the data directory next to the executable. This also works fine on my machine™. Can you explain more what you mean by symlinking to the data/ dir? I don't fully understand the file structure that works for you vs the one that does not work.

Sorry, that's on me. I'm using https://github.com/zyedidia/eget for installing binaries from GH releases, and it only extracted the binary and not the data/ dir.

varac commented 11 months ago

This could make something like https://github.com/MoritzR/fints2ledger/issues/17 easier to implement, since a fixed template wouldn't work in this case anyway.

Oh right, that makes sense, haven't thought of that !

Is fints2ledger actually picking up the template file that you want? If so, what are you customizing there? If some customization is needed, I would rather add back a more limited variation of the template file.

I overrode the shipped template with my custom template, and it works for me well. It looks like this:

{date} ? "{payee}" "{purpose}"
    ; md5sum: {md5sum}
    type: "{posting}"
    {debitAccount:<80}  {debit} {currency}
    {creditAccount:<80}   {credit} {currency}

Iirc, I needed to put the payee in quotes because of payees with spaces in them.

MoritzR commented 11 months ago

Interesting template!

Release 1.2.0 includes the following changes:

The option of using template.txt as a means for customizing the output will stay for the near (probably far) future. It's not easy to replace.