beancount / beangulp

Importers framework for Beancount
GNU General Public License v2.0
61 stars 24 forks source link

How is beangulp compatible with beancount v2? #132

Open ccdunder opened 2 weeks ago

ccdunder commented 2 weeks ago

Hi, I feel like I'm taking crazy pills; perhaps I'm missing something.

The README states:

beangulp is compatible with both Beancount 2.3 and the Beancount 3.0. beangulp is the evolution of beancount.ingest in Beancount 2.3 and replaces it in the Beancount 3.0 release.

But beangulp.importer.Importer and beancount.ingest.importer.ImporterProtocol don't match. They're very close, but there are slight differences in most methods such that a wrapper is required. For now I'm wrapping this, but it seems like I shouldn't have to and makes me think I'm missing something.

What am I missing? In what sense is this compatible with Beancount 2.3? Is the API mismatch intentional?

Thanks in advance for your help.

dnicolodi commented 2 weeks ago

The statement refers to the fact that beangulp does not require Beancount 3.0. beangulp requires importers implementing either the beangulp.importer.Importer ABC or that are subclasses of beangulp.importer.ImporterProtocol. The latter is the same as beancount.ingest.ImporterProtocol just with a different import path. Supporting subclasses of beancount.ingest.ImporterProtocol when executed with Beancount 2.3 is possible, however no one contributed a patch to make this possible.

ccdunder commented 1 week ago

Ah, that makes sense. Thank you!

So folks would be open to PRs to make beangulp importers work in beancount 2.3 vice versa?

I think this would be a very useful change. I see a lot of large beancount projects struggling to move to 3.0 because it's a breaking change. Making importers forward and backward compatible would make incremental upgrades possible (both within an individual codebase and across dependent codebases).

dnicolodi commented 1 week ago

So folks would be open to PRs to make beangulp importers work in beancount 2.3 vice versa?

Making importers using beangulp interfaces work in Beancount 2.3 yuo would need to patch Beancount. The Beancount 2.3 branch will receive only very important bugfixes: we do not have the resources to tend to it.

Patches to make importers using the beancount.ingest.ImporterProtocol interface work in beangulp are welcome.