Issue #290: 2nd level account name may no longer start with digits (blais/beancount)

2018-05-04 Thread Martin Michlmayr
New issue 290: 2nd level account name may no longer start with digits
https://bitbucket.org/blais/beancount/issues/290/2nd-level-account-name-may-no-longer-start

Martin Michlmayr:

The changes accepted last night result in:

```
ValueError: Invalid account name: Assets:99Test
```

Whereas `Assets:Vouchers:99Ranch` is accepted. It seems 2nd level account names 
may no longer start with digits.  I assume this change was not intentional.

Test case:

```
2010-01-01 open Assets:99Test
2010-01-01 open Assets:Vouchers:99Ranch
2010-01-01 open Equity:Opening-Balance

2018-03-26 * "Commodity after amount"
  Assets:99Test 1 EUR
  Equity:Opening-Balance

2018-03-26 * "Commodity after amount"
  Assets:Vouchers:99Ranch   1 EUR
  Equity:Opening-Balance
```


-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20180504075212.3270.89642%40celery-worker-110.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.


Re: document organization: unifying statements with everything else

2018-05-04 Thread Justus Pendleton
On Friday, May 4, 2018 at 1:42:11 PM UTC+7, Stefano Zacchiroli wrote:
>
> It seems to me we lack a Beancount *native* (as opposed to 
>
Fava-supported) way of associating documents to either transactions or 
> postings. Or am I missing something here? Is this planned and/or being 
> discussed anywhere else? 


Isn't the link_statements plugin just a regular beancount plugin that can 
be used even if you don't use fava? What would be the difference between 
that plugin and a beancount native way? I'm not quite following what you 
want here; could you elaborate?

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/70da149a-e60e-4925-bcb8-5ff15f17baee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: use of plugins

2018-05-04 Thread Martin Blais
On Tue, May 1, 2018 at 2:40 PM,  wrote:

> Very new to the game here and looking for a bit of help to close the loop
> on plugin usage.  I apologize in advance for what it, I think, a very
> remedial question but I haven't been able to figure it out in the existing
> documentation.
>
> As far as I can tell, to enable the unrealized plugin I should add the
> plugin directive to my beancount file.
>

Correct.



> However when I perform various operations on this file, I don't see the
> expected output of the plugin.
>

The plugins modify the streams of transactions/directives. They don't do
anything else. You should be able to find transactions that were inserted
by this plugin.

In fact, internally (in the code), the entire result of parsing the
Beancount file produces three things: a stream of transactions/directives,
a read-only mapping of global options, and a list of errors produced during
parsing. That's it. There is no tree of objects, no complex data structure,
and especially no giant "application" class containing all sorts of mutable
things. The purpose of loading a Beancount file is to ascertain the
double-entry constraint, book sales/reductions to the contents of accounts
("inventories") and produce that stream of transactions. Even the price
mapping is derived from the stream of directives after the fact.



> Is there another bean tool I should be using to generate the output?
>

No.



> or are plugins meant to be used solely for scripting and I should be
> using/generating outputs from a python script?
>

Scripting is optional, to be used when you can't extract info using the SQL
client or web interface, or want to do something custom.



>
> Thanks in advance!
>
>
> --
> 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 beancount+unsubscr...@googlegroups.com.
> To post to this group, send email to beancount@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/8c9d4feb-721e-4c97-a629-47d7c56bc854%40googlegroups.com
> 
> .
> 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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhNURODW8eE%3DYT7R24pu28NN%2BgnmcQBfXb4vsDd2zUy%2Bsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: document organization: unifying statements with everything else

2018-05-04 Thread Martin Blais
On Fri, May 4, 2018 at 2:42 AM, Stefano Zacchiroli  wrote:

> Heya beancounters,
>
>   I'm struggling to organize my financial documents in a way that is
> both consistent and supported by Beancount/Fava and I'd like to hear
> from others what best practices you're using.
>
> The main disconnect I notice is between statements documents and
> everything else:
>
> 1) via the "documents" option beancount has great support for bank
>statements and similar documents. You just drop them using a name
>like documents/Assets/Bank/Checking/-MM-DD.pdf and they show up
>in your ledger. I want no more/less than this.
>

In relational terms, this is a join of the list of accounts and the
documents.
You obtain an association list of
  (account, document)
  ...
Where each document belongs to at most one account.


2) but I also want to store other documents and associate them to either
>transactions as a whole or even individual transaction postings.
>Examples are: receipts (for payments, donations, etc.), invoices,
>paychecks, etc.
>

In relational terms, this is a join of the transactions and the documents.
You want to obtain an association list of
  (transaction, document)
Where each document belongs to at most one transaction.


As far as I can tell Beancount itself has not direct support for (2),
> please correct me if I'm wrong.


It supports neither. The web interface performs the first join implicitly
by grouping all the directives by account and then rendering journals for
any account.


You can drop them into the same
> directory structure for (1), but that doesn't associate them with
> individual transactions or postings.  Fava, OTOH, has the
> "link_statement" plugin which supports (2). Aside from a lack of
> generality[^], that allows to link documents to transactions/legs.
>
> [^]: https://github.com/beancount/fava/issues/740
>
> But where do you store the documents for use case (2)? If you store them
> in the same directory for (1), there is a use clash, and documents
> appear both as associated to transactions and in the journal flow --- at
> least conceptually, no matter what Fava actually does, which I find
> annoying.
>
> It seems to me we lack a Beancount *native* (as opposed to
> Fava-supported) way of associating documents to either transactions or
> postings. Or am I missing something here? Is this planned and/or being
> discussed anywhere else?
>

I could add clean APIs to perform either of these joins, given a particular
meta-data field.
For the transactions/documents join, the match could be partial (e.g.
unique substring on the document filenames).
Let me know.

Also, how do you need to query this?
What do you want to produce?




>
> Thanks in advance for your thoughts / comments on this.
> Cheers
> --
> Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack . . o . . . o . o
> Computer Science Professor . CTO Software Heritage . . . . . o . . . o o
> Former Debian Project Leader & OSI Board Director  . . . o o o . . . o .
> « the first rule of tautology club is the first rule of tautology club »
>
> --
> 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 beancount+unsubscr...@googlegroups.com.
> To post to this group, send email to beancount@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/20180504064209.GI11188%40upsilon.cc.
> 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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhOi_TS6-41XMsFf%3DMDsctDeenOAd%2BSV1vQU3jN-uLQU5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Inventory as dict

2018-05-04 Thread Martin Blais
I finally merged PR64 from Jakob Schnitzer which converts the Inventory
from a list of Position instances to its natural implementation as a dict.
This results in significant performance gains in files with non-trivial
inventory bookings.
On my personal file (pretty large),  I get a 25% speedup (6.7s -> 5.0s).
Thank you Jakob,

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhMpC-Q24UuOu_6nro%3DoresKNGDrRO1NZm%3D92iEv-9QGpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.