beangulp icon indicating copy to clipboard operation
beangulp copied to clipboard

How is beangulp compatible with beancount v2?

Open ccdunder opened this issue 1 year ago • 3 comments

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.

ccdunder avatar Nov 08 '24 04:11 ccdunder

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.

dnicolodi avatar Nov 08 '24 13:11 dnicolodi

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).

ccdunder avatar Nov 15 '24 05:11 ccdunder

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.

dnicolodi avatar Nov 15 '24 08:11 dnicolodi