On Fri, Jan 6, 2017 at 12:17 AM, Christopher Singley <[email protected]> wrote:
> Thanks Martin. Yeah I need datetime not just date type, which is of > course not terribly compatible with the mandate for human-friendly input > format. > > I'm browsing through beancount.core.inventory.add_amount(), which seems > to assume that the units have pre-matched against the positions in > inventory.... if you specify cost=None it'll just operate on the first item > in the list without further iteration, yes? Does this matching happen > elsewhere in the code, or is it a straight pass-through from JEs listed in > a text file? > Astute observation. There are two phases: parsing, and then booking. The parsing outputs incomplete costs, which are interpreted as aspects to be matched against the list of available positions during the booking phase. After booking, the postings all have instances of "Cost" resolved to match exactly against existing positions. Therefore, the Inventory code can afford to be simple and just look for an exact match. I hope this helps, On Thursday, 5 January 2017 22:55:17 UTC-6, Martin Blais wrote: >> >> On Thu, Jan 5, 2017 at 12:09 PM, Christopher Singley <[email protected]> >> wrote: >> >>> Hi, I'm writing some accounting applications in Python, and thereby >>> stumbled upon beancount. >>> >>> It occurs to me that you might be interested in my OFX parser: >>> >>> https://github.com/csingley/ofxtools >>> >>> It handles a pretty decent subset of the OFX spec, it handles OFX >>> versions 1 & 2, and it has no dependencies beyond stdlib. >>> >> >> Thanks for the link. >> Looks nice. >> >> One of the example importers in beancount.ingest does OFX. However, it's >> not intended to be a full-fledged OFX thing... it's really just a good >> example of how to build a custom importer with some basic and admittedly >> sloppy OFX parsing. Ideally people would use something like your library. >> >> >> I'm investigating using beancount as an accounting >>> engine...human-readable text files are great. >>> >>> The main focus of my present work is booking investment transactions >>> from data downloads, and from reading your document "Trading with >>> Beancount" I'm wondering if it's a good fit. >>> >> >> It's good for personal finance level work. If you're a day trader and are >> pumping 20+ trades/day, you'll probably want to make something more >> specialized, that takes into account time and that has specialized P/L >> reporting. As an example, I use it to track my own portfolio with perhaps >> 20 trades/month, across 3-4 accounts, some pre-tax/retirement, some active, >> including occasional currency trading/hedging, so not "active" but also a >> fair bit more than most people's retirement-only activity. >> >> >> Have you ever solved the problem of preserving lot opening dates through >>> various reorganizations (splits, mergers, spinoffs, basis reductions, >>> etc.)? In general, assets can be booked in with an opening date different >>> than the transaction date, and it doesn't appear that beancount handles >>> that. >>> >> >> Yes. >> I've done splits and cost basis adjustments, no problem. >> Right now the way to do this is to empty the lot (like you're selling it) >> and in the same transaction replace it on another posting. >> The replacement lot can accept a date override, which gets carried on the >> new lot. >> You put the date in the {...} cost specifier. >> There's no check that the date matches the other lot... you could put any >> date you want, so be careful. >> Otherwise, by default, an augmenting lot acquires the date of its >> transaction. >> >> For splits, the current methodology is to keep the same symbol. An >> alternative would be to automatically generate appropriate symbols >> internally and have some sort of syntax to indicate that the symbol's >> "version number" has moved on, but I haven't done work on that yet, nor do >> I feel it's a great hindrance so far. The price database does, on the other >> hand, have wonky kinks when that happens. >> >> I don't know about mergers and spinoffs, but I presume the same technique >> would work. >> >> Hope this helps, >> >> >> >> >> Thanks, >>> Chris >>> >>> -- >>> 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 post to this group, send email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/beancount/af40974c-cd6f-4155-a4ea-5d533d4f47b2%40googlegroups.com >>> <https://groups.google.com/d/msgid/beancount/af40974c-cd6f-4155-a4ea-5d533d4f47b2%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > 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 post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/beancount/4c5c6f5e-e827-40e9-92b8-31f255987dfe%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/4c5c6f5e-e827-40e9-92b8-31f255987dfe%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhN1swSChxkkejJ4RwOCyTu7wEwqx56o1TDB9iVvAjszQw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
