Re: [ANN] beangrep - grep-like filter for Beancount

2024-05-15 Thread Stefano Zacchiroli
On Mon, May 13, 2024 at 07:36:15PM -0700, Justus Pendleton wrote:
> - Maybe make -s/--somewhere/--anywhere a flag-less default so you can use 
> it more like regular grep? That is: bean-grep foo my.beancount is 
> equivalent to bean-grep -s foo my.beancount
> - A way to filter out transactions from closed accounts? Maybe even make 
> that the default?
> 
> It feels like it might be nice to have it auto-infer the type of search. 
> 2002-12-30 means --date. #tag means --tag. I think you could do it for 
> --meta, too? But maybe there's no good way to handle --account, --payee, 
> and --narration without just turning it into --anywhere.

Both done in version 0.3.0. They provide a much nicer user experience,
thanks for the idea! In terms of what is auto-detectable, I stopped at:
(full!) dates, #tag, ^link, and key:val for metadata. I don't think one
can go much further than that without usability issues, but shout if you
have other ideas.

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20240515162752.6j7nguanpifv2r3j%40upsilon.cc.


Re: [ANN] beangrep - grep-like filter for Beancount

2024-05-14 Thread Stefano Zacchiroli
Thanks for your feedback Justus.

I've noted down your suggestions as issues here
https://github.com/zacchiro/beangrep/issues

The first one (making --somewhere a flag-less default) is something I've
played with already. I ended up not including it, because it was a bit
tricky to detect the "no criteria given" situation, but I'll give it
another stab.

The second one (auto-detect predicate type where possible) is a great
idea. A sweet spot need to be found to avoid making the heuristic over
zealous (e.g., you want to detect 2024-05-14 and 2024-05 as dates, but
probably not 2734, which is more likely to be an amount), but I'll give
it a try.

Also remember: patches welcome ;-))

Meanwhile, I've uploaded beangrep to pypi, so it can now be installed
with a simple "pip install beangrep".

Cheers

On Mon, May 13, 2024 at 07:36:15PM -0700, Justus Pendleton wrote:
> This is pretty great! I often need to find some previous transaction and 
> don't remember where it is across multiple beancount files. I'll do a grep, 
> which really just tells me which file(s) and line(s) to look at. Then I 
> need to switch to an editor to actually see more context.
> 
> Anyway, a few thoughts from using it for a few minutes.
> 
> - Maybe make -s/--somewhere/--anywhere a flag-less default so you can use 
> it more like regular grep? That is: bean-grep foo my.beancount is 
> equivalent to bean-grep -s foo my.beancount
> - A way to filter out transactions from closed accounts? Maybe even make 
> that the default?
> 
> It feels like it might be nice to have it auto-infer the type of search. 
> 2002-12-30 means --date. #tag means --tag. I think you could do it for 
> --meta, too? But maybe there's no good way to handle --account, --payee, 
> and --narration without just turning it into --anywhere.
> 
> On Sunday, May 12, 2024 at 7:35:00 PM UTC+7 Stefano Zacchiroli wrote:
> 
> > Hello beancounters, I've just released a little tool that I've needed
> > for quite a while but didn't have[^]: beangrep, a grep-like filter for
> > Beancount ledgers.
> >
> > [^]: with the exception of grep.py from beanlabs at
> > https://github.com/beancount/beanlabs/blob/master/beanlabs/scripts/grep.py
> > which is more limited than my needs.
> >
> > It is meant to be way simpler than beanquery, but is super useful for
> > quick queries via the CLI.
> >
> > Beangrep is available at: https://github.com/zacchiro/beangrep
> > Its README is also attached to this email.
> >
> > The tool is almost feature complete for me, so it doesn't really have a
> > roadmap. But I welcome feedback and suggestions for improvements (or,
> > even better, patches!), that I'll be happy to consider. It is also not
> > uploaded to pypi yet, but if that's useful for others I'll be happy to
> > take care of that too.
> >
> > Thanks for all the beans!
> > Cheers
> > -- 
> > Stefano Zacchiroli . za...@upsilon.cc . https://upsilon.cc/zack _. ^ ._
> > Full professor of Computer Science o o o \/|V|\/
> > Télécom Paris, Polytechnic Institute of Paris o o o  <\>
> > Co-founder & CTO Software Heritage o o o o /\|^|/\
> > https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro '" V "'
> >
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/beancount/1a6bab93-fa16-4271-8382-b55c70a19d07n%40googlegroups.com.


-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20240514081816.n2rqftupxt7ffvyj%40upsilon.cc.


[ANN] beangrep - grep-like filter for Beancount

2024-05-12 Thread Stefano Zacchiroli
Hello beancounters, I've just released a little tool that I've needed
for quite a while but didn't have[^]: beangrep, a grep-like filter for
Beancount ledgers.

[^]: with the exception of grep.py from beanlabs at
https://github.com/beancount/beanlabs/blob/master/beanlabs/scripts/grep.py
which is more limited than my needs.

It is meant to be way simpler than beanquery, but is super useful for
quick queries via the CLI.

Beangrep is available at: https://github.com/zacchiro/beangrep
Its README is also attached to this email.

The tool is almost feature complete for me, so it doesn't really have a
roadmap. But I welcome feedback and suggestions for improvements (or,
even better, patches!), that I'll be happy to consider. It is also not
uploaded to pypi yet, but if that's useful for others I'll be happy to
take care of that too.

Thanks for all the beans!
Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20240512123454.mjq5j7lr66sep6e6%40upsilon.cc.
![CI status](https://github.com/zacchiro/beangrep/actions/workflows/python-package.yml/badge.svg)


Beangrep - grep-like filter for Beancount
=

[Beangrep][beangrep-home] is a grep-like filter for the [Beancount][beancount-home] plain text accounting system.

[beangrep-home]: https://github.com/zacchiro/beangrep
[beancount-home]: http://beancount.github.io/


Installation


### Installing from source

```console
$ git clone https://github.com/zacchiro/beangrep
$ cd beangrep

$ python3 -m venv ./venv# optional but recommended
$ source venv/bin/activate
(venv) $ pip install -e .
...
Successfully installed beancount-2.3.6 beangrep-...

$ bean-grep --help
Usage: bean-grep [OPTIONS] FILENAME
[...]
```


Usage
-

The CLI says it all when invoked as `bean-grep --help`:

```
Usage: bean-grep [OPTIONS] FILENAME

  Search for entries matching given criteria in a Beancount ledger. Pretty
  print matching entries to standard output.

  The granularity of matching (and results) is that of individual entries,
  e.g., full transactions, balances, notes, etc. By default only transactions
  are returned; use the --type/-T option to override.

  To read from standard input, pass "-" as FILENAME, but beware that it
  implies on-disk buffering of stdin.

Options:
  -a, --account REGEX Only return entries referencing accounts
  with names matching given regex.
  -A, --amount "[OP]AMOUNT [REGEX]"
  Only return entries with amounts matching
  the given amount predicate. An amount
  predicate start with an optional comparison
  operator (one of '<', '<=', '=', '>=', '>',
  with '=' being the default), followed by a
  decimal number (using '.' as decimal
  separator), followed by an optional currency
  regex. Multiple amount predicates can be
  given to express complex amount ranges.
  -d, --date [OP]DATE Only return entries with dates matching the
  given date predicate. A date predicate start
  with an optional comparison operator (one of
  '<', '<=', '=', '>=', '>', with '=' being
  the default), and is followed by a date in
  the form -[MM[-DD]]. Multiple date
  predicates can be given to express complex
  date ranges.
  -m, --meta, --metadata REGEX[:REGEX]
  Only return entries with at least one
  metadata key/value pair matching given
  pattern. A pattern is a pair of regexs
  separated by ':', the former matching on
  metadata key, the latter on metadata value.
  The second regex is optional and defaults to
  '.*'.
  

Equity:RoundingError [Was: Cost basis adjustment for average cost booking]

2024-02-14 Thread Stefano Zacchiroli
On Sun, Feb 11, 2024 at 12:46:00PM -0500, Martin Blais wrote:
> Practical solution: just add a little Equity:RoundingError posting to
> absorb the fraction of a cent and move on.

Do people usually use Equity as top-level category for rounding errors?
(And is there a relevant best practice from good accounting practices?)

I'm using Expenses myself, but it is indeed annoying, because some times
one ends up recording negative expenses...

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20240214205314.aq556owzxatmiq4c%40upsilon.cc.


Re: Tools to help sort the beancount file by date

2023-10-24 Thread Stefano Zacchiroli
On Tue, Oct 24, 2023 at 01:47:01AM -0700, berkes wrote:
> I'm looking for a way to sort the transactions and balances in my file by 
> date. 

Not exactly that, but the file_ordering.py plugin here:
https://github.com/zacchiro/beancount-plugins-zack/blob/master/file_ordering.py
verifies that entries in your beancount file are ordered by date.

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20231024103855.3htzwa37cvlmpfq2%40upsilon.cc.


Re: ValueError: String too long (66 lines) - why?

2023-08-02 Thread Stefano Zacchiroli
On Wed, Aug 02, 2023 at 09:39:40PM +0800, Martin Blais wrote:
> Happy to raise or remove the limit in v2 if you want.

That would be nice (+ publishing a new minor version on PyPI ;-)),
thanks! And thanks also to Daniele for explaining the rationale behind
this limitation.

My 2 cents on the rationale is that it's an odd trade-off. It doesn't go
all the way of trying to detect that the long string is *actually*
beancount markup that ended up in a string by mistake; hence when it is
the case it provides a potentially misleading error message ("string too
long"); and at the same time rejects (arguably) valid inputs like mine.
These for me are good arguments for dropping removing the limit
entirely. YMMV.

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20230802184546.fvytscxwgcaiguci%40upsilon.cc.


ValueError: String too long (66 lines) - why?

2023-08-02 Thread Stefano Zacchiroli
Heya, I'm hitting this error in the beancount v2 C parser (quoting from
beancount/parser/tokens.c):

if (lines > LONG_STRING_LINES_MAX) {
PyErr_Format(PyExc_ValueError, "String too long (%d lines)", lines);
free(unescaped);
return NULL;
}

What's the reason for that test/check?

(Curiously enough, I'm hitting it only from within Fava, whereas
bean-check standalone does not complain about that, not sure why.)

In case you're curious, such a long string comes from a specification
for the validate plugin:
https://github.com/zacchiro/beancount-plugins-zack/blob/master/validate.py
Arguably, it could/should just go to a separate file, referenced from
the beancount ledger, which would make the string trivially short, but
meh, it still seems to be an arbitrary restriction in the parser. What
am I missing?

Cheers

PS No, I cannot just switch to v3 and make this goes away, as Fava is
   still on v2.

-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20230802094325.dyjm4gofe2vovxdx%40upsilon.cc.


Re: BQL for non-transactions?

2023-05-21 Thread Stefano Zacchiroli
On Sat, May 20, 2023 at 06:02:30PM -0400, Martin Blais wrote:
> Here, expand as desired:

Thanks!

Might be worth a (small) place in the Beancount API.

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20230521065208.4llfqkadrbhmtkie%40upsilon.cc.


Re: BQL for non-transactions?

2023-05-20 Thread Stefano Zacchiroli
On Sat, May 20, 2023 at 04:57:44PM -0400, Martin Blais wrote:
> (Note that you could build a little Python script and use petl to achieve
> this in ~20LOC or something.)

Is there an existing mapping from Beancount data to Petl that I'm
missing?

I'm aware of Petl usage for importing data into Beancount, which makes a
lot of sense, because you usually have tabular data before ingesting
into Beancount. But I'm not aware of any bridge between Beancount
(presumably and more specifically: the tabular data model on which BQL
evaluate queries) and Petl. Would love to hear about it.

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20230520213125.q3j7mvfhks3q7pwd%40upsilon.cc.


Re: Beancount grammar for tree-sitter

2023-01-28 Thread Stefano Zacchiroli
On Fri, Jan 27, 2023 at 10:19:20PM -0500, Martin Blais wrote:
> I have no opinion on this, happy to move the polarmutex repo into the
> beancount org as well if you want, and it's true you've been at this for
> a long while and very active.
> (Can you choose unique names? Looks like you both choose the very same repo
> name.)
> FWIW, "official" isn't all that meaningful other than it makes it easier
> for people to find related repos to Beancount, especially things like
> syntax parsers.

If I may, as a mere user, having a repo located under
github.com/beancount/ is quite meaningful to me, precisely because it's
more prominent than other repos out there (both on github and
elsewhere). It comes with an expectation that the repo implements the
"recommended" Beancount way of doing something for which alternative
implementations exist. I understand you Martin doesn't mean it that way,
but it *will* be interpreted that way by users, especially those who are
not following closely this list.

Re tree-sitter (which is something I might be interested in using myself
in the future), I'd be better served by having either 0 or exactly 1
tree sitter grammar implementation available under beancount/ on github.
The ideal way forward here would be for Daniele and polarmutex to work
together into a single project and having that one located at
https://github.com/beancount/tree-sitter-something.

Just my 0.02 EUR,
Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20230128080135.sldrzkksgrhomzhu%40upsilon.cc.


Re: how to get the number of transactions with BQL

2022-10-22 Thread Stefano Zacchiroli
On Sat, Oct 22, 2022 at 02:27:53PM +0200, Daniele Nicolodi wrote:
> For backward compatibility, if a table is not specified in the FROM clause,
> beanquery operates on the "postings" table. Expressions in the FROM clause
> are still supported and are merged with the WHERE clause at query
> compilation time. This requires a way to disambiguate between column names
> part of an expression and table names in the FROM clause and is the reason
> why table names need to be prefixed with "#".

This is all very exciting, thanks for your work on this!

User question: will the new #tables be integrated in the documentation
at https://beancount.github.io/docs/beancount_query_language.html or
should we (users) look somewhere else? I feel like BQL is moving fast
and I'm not yet sure where to look for up-to-date doc. TIA!

-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20221022163227.6eb6hjcvzfgh6fwu%40upsilon.cc.


Re: BQL: filtering on positive/negative amounts

2022-10-19 Thread Stefano Zacchiroli
On Wed, Oct 19, 2022 at 05:17:57PM +0200, Daniele Nicolodi wrote:
> You can use the number() function to get the number part of an Amount:

Ah, great! I had even looked for that name (more or less randomly) at
https://beancount.github.io/docs/beancount_query_language.html , without
luck. I guess I should've searched the code. Thanks for the help :)

-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20221019171804.6urxn5ldw67we4ii%40upsilon.cc.


BQL: filtering on positive/negative amounts

2022-10-19 Thread Stefano Zacchiroli
I'm trying to filter postings based on whether the corresponding amount
is positive or negative, e.g.:

  select position where account ~ "^Expenses:Medical" and value(position) > 0;

but this fails with:

  error: Operator greater(Amount, int) not supported

(using today's beanquery from git master branch).

I understand an Amount is not an integer, but a (number, currency)
pair. But I don't know how to peak into the number field using BQL.

Any suggestion?
-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20221019151203.r2umwm632y3wnwue%40upsilon.cc.


Re: autobean.refactor: an ergonomic and lossless beancount editing library

2022-10-06 Thread Stefano Zacchiroli
On Wed, Oct 05, 2022 at 02:39:31PM -0700, Archimedes Smith wrote:
> Anyone interested in this project? Any bug reports / suggestions would be 
> appreciated.

This is an amazing project. I wanted to have something similar for a
very long time. Now, in terms of suggestions/questions:

- I had already bookmarked in the past your repo (due to other cool
  stuff you've in there). In spite of that I'd have never found this
  project in there without this announcement email of yours. Would you
  consider splitting autobean.refactor out into its own project? It'd
  help a lot with visibility.

- I could really use some API reference documentation for the library,
  as the tests are hard to navigate to understand how the manipulation
  logics works.

- My initial UX idea for something like this was more like a user
  language connected to some CLI driver (in the style of sed/awk/perl,
  but with a DSL for Beancount). Is that something you've considered? Of
  course, if it will ever come to be, it will be "just" an additional
  layer on top of the manipulation library that you've now.

Ere are some of my frequent use cases for these manipulations, in case
it helps you double-checking if they are already supported or not:

- Rename accounts in batch, without messing up indentation. Bonus point:
  detect that the rename is not creating clashes (unless explicitly
  requested).

- Change the alignment column of amounts (purely syntactical change).

- Move metadata "up", from postings to the main transactions or
  vice-versa (move them "down").

- Select transactions by some predicate (e.g., they have a given
  narration or metadata) and perform in batch modifications to selected
  ones (e.g., add/remove a metadata, set the narration to something,
  etc.)

- Ensure consistent ordering in metadata postings (e.g., "bank-label" is
  always first, followed by "author", then "card", etc.).

Hope this helps,
Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20221006104942.csa2yvpdygvtex5k%40upsilon.cc.


Re: Beancount v3 progress

2022-09-09 Thread Stefano Zacchiroli
On Fri, Sep 09, 2022 at 10:00:26AM +0200, Daniele Nicolodi wrote:
> > Same here. I've been postponing improving my bean-ingest pipeline
> > because it's not worth investing in the "old" API anymore than I already
> > did. Being able to jump to beangulp without having to wait for Beancount
> > v3 would unblock that for me.
> 
> beangulp is now compatible with Beancount v2.

That was quick! Awesome, thank you.

-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20220909115903.qpxy5shhtjvyfsa5%40upsilon.cc.


Re: Beancount v3 progress

2022-09-08 Thread Stefano Zacchiroli
On Thu, Sep 08, 2022 at 07:19:54PM +0800, Martin Michlmayr wrote:
> Making beangulp available for v2 (as the other tools are) would
> be a great help for me.

Same here. I've been postponing improving my bean-ingest pipeline
because it's not worth investing in the "old" API anymore than I already
did. Being able to jump to beangulp without having to wait for Beancount
v3 would unblock that for me.

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20220908121943.f3mbtuuhgdbifkyt%40upsilon.cc.


Re: Payees, Subaccounts, Channels

2022-07-27 Thread Stefano Zacchiroli
On Sun, Jul 24, 2022 at 12:25:45PM -0400, Martin Blais wrote:
> One of the topics we've discussed in the past is regarding the use of
> subaccounts over payees.

As a general comment: +1 on the fact that this divide between payees
(or, more generally, per-posting metadata) and sub-accounts is a
problem. I consider sub-accounts to be better in general (they are more
controlled and easier to query), but they come with additional burden
(e.g., you need to declare them, open/close them, etc.) Having to
constantly decide "is this worth a sub-account" is for me recurringly
annoying.

> Another idea, one that we never discussed, is the idea to have a
> special marker as part of the account name, marker which would
> automatically identify a portion of an account name as being a leaf,
> e.g.,
> 
> 2018-05-01 * "VISIT PATREON.COM/INSAN FRANCISCO   CA" "OPSNT_CMEVT
> 1234567890"
>   Liabilities:US:Amex-10.00 USD
>   Expenses:Online:Media/Safecast   3.00 USD
>   Expenses:Online:Media/AbroadInJapan  3.00 USD
>   Expenses:Online:Media/OnlyInJapan2.00 USD

I like the idea of having a given prefix of an account marked as
something under which you can freely create new leaf sub-accounts. But
why does it need an additional core concept and syntax? There might be
advantages, which I'm not seeing yet, but the cost of doing so seems to
be pretty high --- both in terms of code for the codebase and cognitive
overhead for users.

It seems to me that the same idea can be implemented, as you suggested
earlier on, with a directive associate to the, in the example above,
"Expenses:Online:Media" account, which says "this account can contain
any number of leaf sub-accounts".

Anyway, this is totally worth exploring, as it's an annoying problem in
the current state of affairs. Thanks for raising this.

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20220727081845.bh7uwx7yyi5xgiea%40upsilon.cc.


Re: looking up prices by ISIN [Was: bean-price has now moved to https://github.com/beancount/beanprice]

2022-04-11 Thread Stefano Zacchiroli
On Sun, Apr 10, 2022 at 09:12:22AM -0700, Pranesh Prakash wrote:
> I'm not sure if necro-bumping is frowned down upon in this mailing list. If 
> so, my apologies.  I just came across this and thought I'd share some 
> comments, since I didn't see a direct response to this question.

This is super-useful and following up to old threads helps in preserving
contexts for future searches. Thanks a lot!

-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/   
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20220411061422.6boy3gppgvocr5a6%40upsilon.cc.


Re: Google groups spam

2022-02-24 Thread Stefano Zacchiroli
On Wed, Feb 23, 2022 at 11:51:53PM -0800, redst...@gmail.com wrote:
> Messages in the google groups archive can be deleted from the archive any 
> time after they arrive, which is a request I'd made earlier in this thread 
> when spam was starting to be annoying but still rare, and which Martin did. 
> That's why you aren't seeing them here.

I am aware of this process, but I don't think that's the reason here.
Martin reported having deleted only one and not having seen any other
similar messages; others (including myself) have seen dozens.

-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/   
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20220224091627.s3ba5fnwob6dmmjl%40upsilon.cc.


Re: Google groups spam

2022-02-23 Thread Stefano Zacchiroli
On Wed, Feb 23, 2022 at 11:10:59PM -0500, Martin Blais wrote:
> I'm seeing none of that. I deleted one earlier, and I'm looking
> through the archive https://groups.google.com/g/beancount and I can't
> see what you're talking about. I really can't. I'm not getting these
> emails.

I've received all of those as well, and I presume that's also what
everyone else who's complaining is complaining about, because they have
increased a lot in the last few weeks (in the past it was 1 every couple
of months or so). It's reasonable that those messages are less likely to
trigger my spam filter than yours, as I routinely receive legitimate
messages in Italian, but this still doesn't explain why they do not show
up in the group archive. (Unless google groups apply some personalized
SPAM filtering based on the user that visits the archive? I have no
better explanation.) Very weird.

-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/   
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20220224065302.wfjilauudn3ahbbi%40upsilon.cc.


Re: BQL: Exclude zero sum accounts

2022-01-23 Thread Stefano Zacchiroli
On Sun, Jan 23, 2022 at 12:11:24PM +0100, Daniele Nicolodi wrote:
> As of now, my recommendation is to install beanquery along Beancount v3.
> Except for the backward compatibility break noted above, v3 is expected to
> work on v2 ledgers. Wanting to keep using v2 for other things, I would
> install this combination in a dedicated venv from which to run the
> bean-query command.

Thanks for this background and explanation. Installing beanquery
together with beancount v3 worked for me as well.

(Unfortunately I cannot actually use bean-query on my own v2 beancount
 ledger, because I use as extension Fava's auto_commit, and Fava is
 incompatible with beancount v3, as discussed early on in this thread,
 but that's an unrelated problem.)

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/   
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20220123121432.2fbmukhf353ca5bn%40upsilon.cc.


Re: BQL: Exclude zero sum accounts

2022-01-23 Thread Stefano Zacchiroli
On Sat, Jan 22, 2022 at 11:00:18PM +0100, Daniele Nicolodi wrote:
> > I am currently using beancount2 and fava (python3 -m pip install
> > beancount fava). Is it possible to integrate this unreleased beanquery
> > into this flow?
> 
> beangulp should work fine with Beancount v2 thus you should be able to
> install it just fine.

(You meant beanquery above, right? I'm assuming you did.)

I've tried this in a fresh virtualenv and it doesn't work out of the
box. beanquery depends on "beancount>=3.0.dev0", so it cannot be
installed side by side with beancount at least as shipped from pypi.
What's the recommended way to achieve that with the current split code
base? I'm interested too.

Thanks!
-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/   
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20220123081956.3h7pm5b5aqqa7fzk%40upsilon.cc.


Re: scripting: Is there a function to get value of an account on a given date?

2021-11-27 Thread Stefano Zacchiroli
On Fri, Nov 26, 2021 at 09:08:18AM -0500, Martin Blais wrote:
> https://github.com/beancount/beancount/blob/master/beancount/ops/summarize.py#L589

Thanks a lot Martin, I didn't know about
beancount.ops.summarize.balance_by_accounts(), and now that I know it
helped me simplify some code I had around.

While I'm at it, the code in question compute the average daily balance
in a given account for a given year and currency (which matters for
fiscal reasons in Italy, don't ask...). The core of it looks like this:

# XXX naive approach: we re-calculate realizations from the beginning of 
the ledger
# to each day in the target year. It is acceptably fast, so we didn't 
bother making
# it more efficient than this (for now).
for day in tqdm(list(year_days(year))):
inventory = balance_by_account(entries, date=day)[0][account]
amount = inventory.get_currency_units(currency)
balances.append(amount.number)

As per comment, it is good enough (takes ~20 seconds on my main ledger),
but it's not great. What would be the best way/internal API to implement
this "right", i.e., with a running balance that is updated with daily
batches of entries?

TIA,
Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack  _. ^ ._
Full professor of Computer Science  o o   o \/|V|\/   
Télécom Paris, Polytechnic Institute of Paris o o o   <\>
Co-founder & CTO Software Heritageo o o o   /\|^|/\
Former Debian Project Leader & OSI Board Director   '" V "'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20211127101046.tw5yy4x6b4ooxvmp%40upsilon.cc.


Re: Currency exchange rates sources

2021-04-10 Thread Stefano Zacchiroli
On Sat, Apr 10, 2021 at 05:52:41PM +0200, 'Patrick Ruckstuhl' via Beancount 
wrote:
> you can use https://ratesapi.io/ same api as exchangeratesapi before, simply
> switching the host is enough.
> 
> Besides that, https://www.alphavantage.co/ free tier works also pretty well.
> Price fetchers available at https://github.com/tarioch/beancounttools

This is awesome, thank you !

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20210410174311.gwwq4g3yhppjauwh%40upsilon.cc.


Re: Currency exchange rates sources

2021-04-10 Thread Stefano Zacchiroli
On Sat, Nov 07, 2020 at 12:29:37AM +0100, Daniele Nicolodi wrote:
> For example, OANDA https://www1.oanda.com and fxtop https://fxtop.com/
> have web data sources that could be easily scraped for data.

At the time this thread started, I was using
https://exchangeratesapi.io/ which Martin (M.) also mentioned in the
thread. Since then, they have changed their terms of use: it is no
longer possible to use the API at all without an API key, and even with
an API key it is not possible to set the base currency if you are on the
free API usage tier.

I have checked a couple of other similar services, and it seems that
this is now a common restriction: no base currency selection within the
free API usage tiers.

I'm hence about to scrape one of the two sources mentioned by Daniele
above. Doing so makes me sad, but it's better than nothing.

If in the meantime others have found viable alternatives, please shout!

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20210410151344.r7lgggioinkow7by%40upsilon.cc.


Bazel in Debian [fwd: Google Press Release]

2021-03-04 Thread Stefano Zacchiroli
FYI (it's something we have discussed on list in the past, as a
requirement to ease distribution of Beancount 3.x to users)

- Forwarded message from Olek Wojnar  -

Date: Thu, 4 Mar 2021 18:43:19 -0500
From: Olek Wojnar 
To: debian-public...@lists.debian.org
Cc: Debian Bazel Packaging Team , "Michael R.
 Crusoe" 
Subject: Google Press Release
Message-ID: 
Resent-From: debian-public...@lists.debian.org

Hello Publicity Team,

Here's the press release I mentioned the other day. [1] Also, here's the
link to the talk I did at the Google Open Source Live (online)
conference.[2] Not my best performance but good info about some recent
packaging efforts in Debian.

Please let me know if you'd like any additional information.

-Olek

[1] https://blog.bazel.build/2021/03/04/bazel-debian-packaging.html
[2]
https://opensourcelive.withgoogle.com/events/bazel?talk=debian-ubuntu-packaging

- End forwarded message -

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20210305070930.bqrayeqnlh55cd2w%40upsilon.cc.


Re: Net worth over time examples?

2021-02-14 Thread Stefano Zacchiroli
On Sun, Feb 14, 2021 at 09:46:32AM -0600, Aaron Stacy wrote:
> Hi all, my I’ve seen some references to net worth over time
> scripts/queries, but I’m having trouble finding specifics. Anyone have
> quick links to share? Thanks!

I don't have a script ready to share for this... but that's because
you've net worth over time readily available in Fava, and that's what I
use. You can see it in action on the live Fava demo here:

  https://fava.pythonanywhere.com/example-beancount-file/balance_sheet/

Does that address your need?

I'm not sure if it's possible to obtain the same result in tabular form
with just BQL (because you can't add/subtract columns to generate other
columns, IIRC), but it should be trivial to script from the output of a
BQL query that returns Assets and Liabilities GROUP-ed BY the
periodicity you want.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20210214162557.rtjnmeycwxlse55f%40upsilon.cc.


Re: Programmatically Rewriting Ledgers

2020-12-01 Thread Stefano Zacchiroli
On Mon, Nov 30, 2020 at 02:11:58PM -0800, Aaron Lindsay wrote:
 Is there a better way to programmatically rewrite ledgers by hooking into 
> pieces of the beancount internals today? If not, will v3 have any impact on 
> this?

As a side comment on this topic, I'm more and more convinced that the
ability to programmatically edit the syntax of textual ledgers is
(should be) a key feature for plain text accounting. And that such a
feature would naturally complement the great support that Beancount
already has for plugins (which modify the semantics, rather than the
syntax, of textual ledgers).

The reason is that, thanks to version control, when doing plain text
accounting with a computer we routinely alter the *historical* records,
e.g., by improving how we book past transactions, fixing mistakes,
etc. --- which is something both great and novel in comparison to
traditional accounting practices.

Now the problem lies in programmatically editing *concrete* syntax,
which is a complicated problem in general, due to the amount of
information that parsers tend to throw away when converting to ASTs.
So, Martin, everything the new Beancount parsers manage to keep
(locations, comments, etc.) would be definitely welcome in this respect.

Another ingredient that would help is a very-opinionated,
fully-automated formatter for Beancount syntax, similar to what Black[1]
is to Python. With something like that an hypothetical "sed" equivalent
for Beancount syntax would be able to worry less about getting right
details such as spacing, indentation, etc. --- it will just have to pipe
its output to bean-format(-ng) and be done with it. (But of course this
is assuming that nothing is lost in the concrete syntax -> AST
translation, and most notably comments.)

Cheers

[1]: https://github.com/psf/black
-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20201201135838.elqx5kitsmhefygy%40upsilon.cc.


Re: Split beancpunt.el into its own repository

2020-10-11 Thread Stefano Zacchiroli
On Sun, Oct 11, 2020 at 11:06:23AM +0200, Stefano Zacchiroli wrote:
> Yeah, that would be `git filter-branch` with the `--tree-filter` for

s/tree-filter/subdirectory-filter/

(which is newer and better)

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20201011090714.y62gghuftxr3rxkq%40upsilon.cc.


Re: Split beancpunt.el into its own repository

2020-10-11 Thread Stefano Zacchiroli
On Sun, Oct 11, 2020 at 09:53:56AM +0200, Daniele Nicolodi wrote:
> I would also like to preserve the history of the files imported into the
> new repository. I am sure there is a git incantation to do this.

Yeah, that would be `git filter-branch` with the `--tree-filter` for
selecting only the `emacs/` dir, whose content you can them move out of
that dir in a final commit. I've (unfortunately for me) had to often
merge/separate git repos often, so feel free to ping me offline if you
need a hand with that.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20201011090623.2szzforvhv4gupbe%40upsilon.cc.


Re: Split beancount.el into its own repository

2020-10-07 Thread Stefano Zacchiroli
On Wed, Oct 07, 2020 at 06:50:38AM -0400, Martin Blais wrote:
> I mean I don't care that much, I can create a repo in the org and move it
> there (and open up maintainers list), but it seems to me one could just as
> well pick it up from HEAD of v2 or master. Just trying to understand.

Yeah, I'm sure you can piggy back a release process for beancount.el
alone on top of the current beancount repo. But you lose clarity, e.g.,
it becomes cumbersome to bump the beancount.el version without bumping
the beancount one. You can work around that with, I guess, a dedicated
namespace in tag names, but meh...

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20201007105726.47bmqepptxyvgnqa%40upsilon.cc.


Re: Split beancount.el into its own repository

2020-10-07 Thread Stefano Zacchiroli
On Wed, Oct 07, 2020 at 06:20:04AM -0400, Martin Blais wrote:
> Given its small size, a whole dedicated repo is a bit much, don't you think?
> Always happy to take patches.

The main point is release independence. I'd love to be able to receive
beancount.el releases (e.g., via MELPA or similar repos) without having
to wait for a Beancount release.  In fact, as a user, I don't see why
the release processes of the two should be tightly coupled at all.

git repositories are cheap.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20201007103846.ln2sbaekba4nsnck%40upsilon.cc.


Re: Linear git history

2020-08-03 Thread Stefano Zacchiroli
On Mon, Aug 03, 2020 at 09:41:03AM +0800, Martin Michlmayr wrote:
> > Looking around in the web interface, it seems that it is not
> > possible to change the default method used
> 
> I *believe* it remembers the type of the last merge you did and offers
> that as the default.

That's also my (unscientific) feeling based on personal experience.

There seems to also exists a per-repo setting about what is *allowed*,
(not the default):

  
https://docs.github.com/en/github/administering-a-repository/configuring-commit-rebasing-for-pull-requests

So if we end up choosing one method, we can disable the others.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200803091122.fujj4hryf2r3x6hx%40upsilon.cc.


looking up prices by ISIN [Was: bean-price has now moved to https://github.com/beancount/beanprice]

2020-07-26 Thread Stefano Zacchiroli
This announcement by Martin made me look again into bean-price (at the
moment I'm using horrible hand-written scrapers for my bank websites).

What I'd be interested in is (1) a service that allow to fetch prices
based on ISINs (as in:
https://en.wikipedia.org/wiki/International_Securities_Identification_Number
) and (2) a bean-price data source for it.

(2) would be trivial to add, but I haven't found a solution for (1) yet.
It seems that neither Google Finance nor Yahoo Finance offer that
service, although I found that very surprising.

Does anyone know of a (free) service allowing to lookup current prices
by ISIN?

Thanks in advance,
Cheers

On Sat, Jul 25, 2020 at 01:14:36PM -0400, Martin Blais wrote:
> Hi,
> As discussed prior on this mailing-list, bean-price has now moved away from
> the beancount repository to a new repository under the same umbrella
> organization:
> 
> https://github.com/beancount/beanprice
> 
> The code has been removed from beancount/master, yet it lingers in
> beancount/v2 (where the plan is to minimize disruption).
> All new tickets related to bean-price will be redirected to this new
> repository; existing tickets in Beancount will be migrated.
> 
> New price sources are welcome into the new repo. Barrier to entry is a bit
> lower (since I'm not planning to do all the maintenance work myself),
> basically if you can write unit tests for a new price source that call both
> the latest and historical functions (without actually making requests to
> the network), compliant with the API and the style guide, your new price
> source is likely welcome, send a PR. This may be a good time to consolidate
> some of your custom price sources into one place if you want.
> 
> Note that in terms of code dependencies bean-price still depends on
> beancount.ops.find_prices, where routines to enumerate commodities for
> price enumeration remain. I plan to keep maintaining code the enumerates
> prices required from a Beancount ledger there, as they are purely
> processing Beancount directives. If they need to be extended for
> bean-price, patches are welcome. I'm not too sure how importing from the v3
> Bazel build will work yet, but I've kept the BUILD files for now, as they
> will perhaps become necessary when the C++ build becomes the norm there.
> 
> Note that the new beanprice repo could be extended to work for Ledger and
> HLedger as well; after all, the output is just text to be inserted in one's
> ledger file, and only a change of output syntax.
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/beancount/CAK21%2BhO98B71fjdp6RmH5z2e9-aSGntrJjnzceSesEkavavurA%40mail.gmail.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200726083642.x4rbzpgv7463siip%40upsilon.cc.


Re: Beancount v3

2020-07-14 Thread Stefano Zacchiroli
On Tue, Jul 14, 2020 at 09:45:05AM -0400, Martin Blais wrote:
> In the meantime you can use posting metadata, but I think it's
> sensible syntax (aside from being inside a [comment]).  We'll have to
> figure out a reasonable schema modification.

*nod*

To be clear: I don't think the fact it's inside a comment is a feature.
It's Ledger-inherited design (and personal bad practice...) which I
don't think Beancount should replicate. But that's a minor point.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200714140508.kk7dzy72vf4xka2s%40upsilon.cc.


Re: Beancount v3

2020-07-14 Thread Stefano Zacchiroli
Thanks for your feedback Martin.

On Tue, Jul 14, 2020 at 01:33:34AM -0400, Martin Blais wrote:
> Yes, that should be the goal, though I have in mind a perhaps more
> restricted version where, like today, the options have to be set in the
> top-level file; the only difference is that it'll barf when you try to set
> options in included files (which it always should have, this is essentially
> a bug fix).

But why? What's the added value of restricting options to only be in the
master file? I'm having other family members read the textual version of
our books and they can make sense of the double-accounting part, but the
beancount-specific options don't make sense for them, so I'd really like
to hide them away with a simple oneliner include at the beginning of the
books.

FWIW I do something similar with other textual document system (e.g.,
LaTeX), and I find that hiding low-level details in a single "you
shouldn't care about this stuff" file has a lot of value.

> > The main feature I lack to have feature parity with Ledger-CLI is
> > the ability to add tags to individual transaction legs. I'm assuming
> > this will go hand-in-hand with relaxing the distinction between
> > metadata/ tags/ links (by making them syntactic sugar for metadata,
> > I'm guessing), which is great, thanks!
> 
> You mean you'd like to have the ability to add # at the end of a
> posting line?  That should be easy to add, but I'd have to change the
> schema.  Can you motivate it?  When / how / why do you need to tag
> individual postings whereby tagging the transaction isn't enough?
> That would be added in v2.

(This is https://github.com/beancount/beancount/issues/144 and we should
probably have the discussion there, but just in case: )

A classic example for me is:

  2020-07-08 * "foobar bookshop" "books + card game"
  Expenses:Books 32.90 EUR ; book A, B, and C
  Expenses:Games 15.00 EUR ; card game for kid  
#hulk
  Assets:Checking   -47.90 EUR

where I want to tag one of the lag has pertaining to my kid (no, he is
not actually called Hulk), but not the rest of the transaction.

(Yes, I can refactor this using two transactions, but it's annoying.)

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200714125021.ttl7dnzl4jdho2ao%40upsilon.cc.


Re: Beancount v3

2020-07-07 Thread Stefano Zacchiroli
On Mon, Jul 06, 2020 at 04:18:41PM -0600, Daniele Nicolodi wrote:
> > In particular, I'd like to know if the raw/syntactic directives you
> > imagine coming out of the new Beancount core would be close enough
> > to the book concrete syntax to allow manipulation such as meddling
> > with spacing Provided that, and a good pretty printer for concrete
> > syntax, a "bean-sed" project with a dedicated manipulation language
> > can probably be created and maintained separately of core.
> 
> I am far from being a parsing expert, but I think having the parser
> emit a syntax tree suitable to reconstruct the input file without
> modifications is going to be very complex: the scanner would need to
> emit many more tokens for input that is now simply ignored (ie
> trailing whitespace) and the grammar would need to handle those,
> making it more complex. The representation of the parsing results
> would also be more complex. A lot of work to support a single tool.
> 
> I think that a tool like the one you describe should use the syntax
> tree and the actual file content in combination to rewrite the input
> file: the syntax tree allows to identify which elements need to be
> modified and from these the position in the input files where text
> changes need to happen. Sounds complex, but I believe less complex
> than augmenting the parser.

All good points. Its indeed a bit tricky (I've done it in the past for
an unrelated project) and it boils down to keeping around both a
concrete syntax tree (with all the spacing, for instance) and an
abstract syntax tree. The former is particularly annoying because to
have one that round-trips with textual input you often have to adapt the
lexer too.

I agree it looks like quite a burden for a single tool --- even though I
think it's a very important one to have, due to the intrinsic nature of
plain text accounting. And also, the alternative looks worse to me:
people just sed or search/replace in their ledgers messing up spacing or
worse. I don't think the user experience in doing that is great, and
that affects our user base.

There is an alternative though. Define a single canonical way to indent
Beancount textual ledgers and have a tool like Python's Black that
reformats a Beancount ledger (or even isolated directives) that way.
Right now there are some ambiguities, e.g., do you indent a metadata
attached to a transaction leg or not? Do you put them on the same line
of the transaction leg or on the line beneath it? Etc. And it gets
tricky with comments (which generally you want to keep as-is), both in
general and even more so when they are mixed with tags. If you have such
an "opinionated" pretty printer you can do all your changes on the AST
and just pretty print your result.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200707070826.jbauj3cn66uq7kve%40upsilon.cc.


Re: Beancount v3

2020-07-06 Thread Stefano Zacchiroli
On Sat, Jul 04, 2020 at 11:48:00PM -0700, Justus Pendleton wrote:
> * Have a "bugmaster". This is a community member who isn't even necessarily 
> that acquainted with the code base (perhaps not even technical at all) but 
> they are engaged with the project and can help reply to new bug reports 
> quickly and triage them. Close duplicates, ask for more information & 
> reproduction steps quickly (i.e. while the reporter is still paying 
> attention), and help bring important issues to the attention of Martin & 
> other people doing development.

FWIW, based on my experience in maintaining very popular packages in
Debian (a long time ago...), this idea is appealing but doesn't work
well in practice. Bug triaging isn't in the end a lot of time, in
comparison to development, and a maintainer who knows the code well is
going to be extremely more efficient than someone less into the code. So
you don't gain much and you also incur the risks of mis-triaging bugs,
that are gonna cost you time to re-triage properly later. YMMV.

> * Martin mentions "monthly team meetings" which I think is a good idea
> --  it provides a synchronization point for things like the bugmaster
> or the  code reviewer to agitate for action on something that seems to
> have been  stalled. Though I'm less sure about the exact style &
> format. Monthly  versus quarterly? Zoom video style versus Discord
> text style? I think we'd  have to see some proposed agendas of what
> such a team meeting might be  about to say much more.

This one is pretty cool on the other hand. In my experience what works
super well are in person hackatons, ideally over more than 1 day. I've
never tried the pure online version of them, but I guess by now there
should be some experience in how to manage them effectively (assuming
they could be made to work). Not sure if just short meetings (with no
actual coding time) would be worth it --- don't we all already have way
too many meetings anyway? --- but it might be worth a try.

I'm not sure I'll have much to contribute, given my very sporadic track
record of contributing to Beancount, but I'll be happy to try if any of
these happens.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200706141338.lzseanftqwslrf75%40upsilon.cc.


Re: Beancount v3

2020-07-06 Thread Stefano Zacchiroli
On Sat, Jul 04, 2020 at 03:09:34AM -0700, Andre Engelbrecht wrote:
> *Disclosure*: I've converted a couple of people from using webapps or
> spreadsheets to use ledger. They love ledger despite some of the
> nuance. I've been trying to move them over to beancount, but having a
> bit harder time because of the python dependency.  Fava and being able
> to run it locally has been a great driver to have people at least
> consider installing python and giving beancount a test run.

Same for me. I've converted some people to Beancount thanks to the fact
that "pip install beancount" was simple enough (although indeed still a
barrier for non-dev people) for them to install. Bazel will be a much
higher barrier for people to install/use Beancount. I totally understand
switching to it from a dev point of view, but it would be great to
maintain the ability to install via pip.

I've used pypi to ship weird python code depending on a huge java
bundle, and I know it works well. If there is a way to ship (and then
select) static binaries for the non-Python parts for multiple
architectures (the most popular ones) via pip, I think it'd be totally
worth it in terms of user base.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200706115807.atdlpr3oai3guake%40upsilon.cc.


Re: Beancount v3

2020-07-06 Thread Stefano Zacchiroli
signed debit and credit
-

This is a very concrete need, which I routinely struggle with when
showing accounting reports extracted from Beancount (or Fava) to other
family members. But I'm surprised you mention it as a potential feature
for Beancount itself. Wouldn't it belong to front-ends, like Fava (or
maybe Ulque in the future), instead? In the view of "Beancount as an
accounting calculator", which I've always adhered too, that seems to
belong elsewhere.


bean-sed


This is something which is not in your design documents, but seems
important enough to me to be mentioned in light of a new Beancount
generation. In plain text accounting we maintain two things at once: the
semantic information captured in our books, and the syntax of those
books, which matters more than the syntax of paper-based books (which is
why we use Git to version and often allow ourselves to amend/curate very
old transactions, which is something you never do with paper-based
books, and for sure not reaching further in the past before the most
recent book closure).

But our textual books grow larger and we often need to perform batch
changes. E.g., split an account category, merge some, rename accounts,
etc., spanning all our books. Some of these operations are purely
syntactic, some have impact on the semantics of our accounting data. I
think we need a tool to automate this, more powerful than search and
replace in vim/emacs, and with some knowledge of the data it's
manipulating.

The current style of plugins is not useful for this need. It is OK to
patch transactions/directives post parsing, but cannot reflect those
changes back to the textual books.

Would something like this fit your vision for Beancount 3? In
particular, I'd like to know if the raw/syntactic directives you imagine
coming out of the new Beancount core would be close enough to the book
concrete syntax to allow manipulation such as meddling with spacing
Provided that, and a good pretty printer for concrete syntax, a
"bean-sed" project with a dedicated manipulation language can probably
be created and maintained separately of core.   


==


> The short version is that v3's core is going to be ported to C++ using a
> Bazel build, and the codebase will be sectioned between core and the rest.
> I just merged the new build definition in master.

Bazel is indeed a great build system, but you should know that, at least
for now, it is not in Debian/Ubuntu yet. So for the time being it will
be impossible to ship Beancount v3 on those distros (and any other
Debian-based distro) until Bazel itself is part of Debian. Work is
ongoing (see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782654
), but I'm unable to guess when it will actually happen.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200706090020.xr73ygh3ivlme433%40upsilon.cc.


Re: Beancount Migration to Github

2020-05-24 Thread Stefano Zacchiroli
On Sat, May 23, 2020 at 11:57:43AM -0400, Martin Blais wrote:
> I agree, but "Build pushed pull requests" is already enabled.
> I changed the settings this morning so it's possible previous PRs haven't
> been built.

Yup, it was indeed a race condition between my request here and you
enabling it. All is good now.

Thanks!
-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200524190904.wwpc6zduw6762cs2%40upsilon.cc.


Re: Beancount Migration to Github

2020-05-23 Thread Stefano Zacchiroli
Hi again Martin,

On Fri, May 22, 2020 at 05:56:33PM -0400, Martin Blais wrote:
> The Beancount repository and issue tracker has been migrated to Github, at
> this location:

as far as I can tell from:

  https://travis-ci.org/github/beancount/beancount/pull_requests

CI builds are not enabled for pull requests. Can you enable them?

It's gonna help both you and PR submitters in shortening feedback loops,
I think. To enable them all that should be needed is going here:

  https://travis-ci.org/github/beancount/beancount/settings

and flipping the switch "Build pushed pull requests" (there's also
"Build pushed branches", but that concerns only the people with direct
push access).

Thanks for considering,
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200523155310.hxufpc4fg5praz5v%40upsilon.cc.


Re: Beancount Migration to Github

2020-05-23 Thread Stefano Zacchiroli
On Fri, May 22, 2020 at 05:56:33PM -0400, Martin Blais wrote:
> The Beancount repository and issue tracker has been migrated to Github, at
> this location:
[...]
> Special thanks to Martin Michlmayr, Kirill Goncharov and Dominik Aumayr for
> figuring out most of the details to make this happen smoothly. This
> wouldn't have happened so quickly without your input.

Great work. Thanks a lot to bot you personally and all the people who
have helped to make this happen.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200523081201.cgdn2se35fbmhuen%40upsilon.cc.


Re: Beancount issues

2020-04-25 Thread Stefano Zacchiroli
On Sat, Mar 28, 2020 at 03:10:52PM -0400, Martin Blais wrote:
> I had ruled out Heptapod as it seemed to have only a few projects it
> itself owned just even last week (and now I see the list growing, so it's
> morphing into a hosting solution).

Looks like this has been made official now:

  https://heptapod.host/

the non-payware part for FOSS projects is at:

  https://foss.heptapod.net/

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200425064036.x72hwv6guqz6wzcu%40upsilon.cc.


Re: Categorizing transactions automatically on import

2020-04-10 Thread Stefano Zacchiroli
On Fri, Apr 10, 2020 at 12:14:55PM +0800, Martin Michlmayr wrote:
> Zack's approach seems simpler to me, but the problem is that it's a
> sub-class of ofx.Importer whereas I was hoping for a wrapper that
> I could apply to any importer.  In the case I'm trying to solve,
> I only have OFX so I might go with this approach.

I'm pretty sure it can be made fully general with a mixin that takes any
importer and use your categorizer before returning results. Try
something like this (again, untested):



class CategorizerMixin():

@staticmethod
def categorize_entry(entry):
entry.meta['test'] = 'foo'
return entry

def extract(self, file, existing_entries=None):
entries = super().extract(file, existing_entries)
return list(map(self.categorize_entry, entries))


class MyOFX(ofx.Importer, CategorizerMixin): pass


class MyOtherImporter(OtherImporter, CategorizerMixin): pass


CONFIG = [
myOFX('1...', 'Assets:...'),
MyOtherImporter(...),
]



There might be some issues with MRO that I haven't got right without
testing, but there's definitely a way along the above lines to make a
fully general wrapper that "lifts" any (non-categorizing) importer to
one that categorizes as you please.  Happy to chat more offline if you
want to give this a try.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200410082338.pey2zhst3nho2wue%40upsilon.cc.


Re: Categorizing transactions automatically on import

2020-04-09 Thread Stefano Zacchiroli
On Thu, Apr 09, 2020 at 06:20:18PM +0800, Martin Michlmayr wrote:
> CONFIG = [
> mywrapper(ofx.Importer('1234', 'Assets:ABC')),
> ...
> 
> and then mywrapper would exactly act like any importer (i.e. it would
> just call the original importer) except that extract() would first
> call the original importer and then iterate over the entries and
> fix them up.
> 
> I'm sure this is basic Python stuff but unfortunately I can't figure
> out how to do it.  Has anyone done this and can give an example of
> such a wrapper?

Here's an untested sketch:



class mywrapper(ofx.Importer):

def extract(self, file, existing_entries=None):
entries = super().extract(file, existing_entries)
return list(map(categorize_entry, entries))



where categorize_entry is your function that takes an input an entry and
returns an improved version of it. (Note that due to the extract
interface your function should really handle all possible Beancount
entries, not only transactions. Presumably you'll return all other
entries unchanged.)

Let me know if it works :-)

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200409113514.e3dpjfdquydxaexn%40upsilon.cc.


Re: Categorizing transactions automatically on import

2020-04-09 Thread Stefano Zacchiroli
On Thu, Apr 09, 2020 at 10:15:23AM +0800, Martin Michlmayr wrote:
> The "Importing External Data in Beancount" document says:
> 
> "Beancount does not currently provide a mechanism to automatically
> categorize transactions. You can build this into your importer code. I
> want to provide a hook for the user to register a completion function
> that could run across all the importers where you could hook that code
> in."
[...]
> What would be an elegant way to wrap the importers into code that
> can run over the entries and improve the transactions?

For I'm using only a custom CSV importer, which inherits from the
built-in CSV importer, and the only thing I'm doing is categorizing
transactions, i.e., determining the account of one leg of the
transaction.  To that end, I'm reusing the notion of "categorizer"
supported by the built-in CSV importer. It's a function from and to
entries; so even if I'm using it only for changing the account, you
could in theory change whatever you want of the extracted entries. But I
understand you're not using the CSV importer, so the categorizer
abstraction is probably not what you're looking for.

Still, the importer.py protocol, which you've probably implemented, has
this:

  extract(): Extract directives from a file's contents and return of
  list of entries.

which:

  Returns:
  A list of new, imported directives (usually mostly Transactions)
  extracted from the file.

So, assuming you already have an importer that returns "raw"
transactions, you can just have a function that improves your
transactions and map it onto the output of extract(), I believe. It can
also be a wrapper class around any importer that turns a "dumb" importer
into a "smart" one, that enriches transactions as you please.

Is that what you're looking for here?

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200409091305.pzq43psennr4eshb%40upsilon.cc.


Re: Beancount issues

2020-03-23 Thread Stefano Zacchiroli
On Sun, Mar 22, 2020 at 10:06:01PM -0400, Martin Blais wrote:
> Ahh yes, now I know why. It's just the software, it's not hosting.
> I need a hosted solution.

They do hosting too. The only restriction is that the project should be
under a FOSS license, which is the case for Beancount. I think you can
just create an account here https://foss.heptapod.net/explore and then
create a project. (But, again, I haven't tried it myself.) If you want
to explore this and encounter troubles, let me know and I can put you in
touch with the maintainers.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200323083027.iptrypc5qe6bzwfq%40upsilon.cc.


Re: Beancount issues

2020-03-22 Thread Stefano Zacchiroli
On Sun, Mar 22, 2020 at 01:58:53PM -0400, Martin Blais wrote:
> So either I find another Hg hosting (doesn't seem to be anything foss
> friendly with issue tracking out there I feel confident about), or try
> a move to github.

It's known™ that I'd personally favor a move to a git-based hosting.
But. In case it would make things easier for you, I've checked with a
friend who's also an upstream Mercurial developer what he recommends as
an alternative to Bitbucket. He pointed that this hosting:

  https://foss.heptapod.net/

offers free hosting for FOSS projects. It's GitLab, but extended with
Mercurial software. It's developed and maintained by Mercurial upstream
devs, so it should be reasonably well integrated and safe mid-term (not
that I've tested it myself though...).

I've no idea how to migrate issues from bitbucket to GitLab, but I can
ask.

Hope this helps,
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200322192957.37lc7iluz6gkptes%40upsilon.cc.


Re: The end of Mercurial on Bitbucket

2020-02-20 Thread Stefano Zacchiroli
On Fri, Aug 23, 2019 at 12:15:19AM -0400, Martin Blais wrote:
> I suppose I could revive hg.furius.ca...
> 
> It sucks. Let's wait and see if some alternative doesn't come up.

The removal of Mercurial support from Bitbucket is now imminent (we have
~3 months left).

Have you decided where the official Beancount repository is gonna be
after that?

Thank you in advance for your answer,
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20200220170043.ajvd2qn6cz552v5p%40upsilon.cc.


Re: Patch for beancount.el

2019-12-18 Thread Stefano Zacchiroli
On Wed, Dec 18, 2019 at 10:39:13AM -0700, Daniele Nicolodi wrote:
> > - Add a M-RET binding that inserts the date part of a new transaction.
> 
> I don't enter many transactions manually, but this addition seems
> reasonable. What about a M-S-RET binding that asks for the transaction
> date with org-read-date (using the calendar to choose the date)?

I'm very much looking forward for this functionality, thanks for it
Stefan.

In terms of which date to enter upon M-S-RET, I think a reasonable
default would be the date in the beancount entry that precedes the place
where the date is being inserted. That might be the default date shown
in the calendar, as you propose, or just the date directly inserted in
the file.

My 0.02 EUR,
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20191218184000.buhsr4f7mfkmjmj2%40upsilon.cc.


Re: Documentation is now read-only

2019-08-03 Thread Stefano Zacchiroli
On Fri, Aug 02, 2019 at 02:18:20AM -0700, Kirill Goncharov wrote:
> Docs now available at GitHub Pages: https://xuhcc.github.io/beancount-docs/

Thanks a lot for doing this, it's awesome !

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20190803104202.wrthhvup6q4f7xsx%40upsilon.cc.


Re: load_file omits some entries (balances)

2019-05-17 Thread Stefano Zacchiroli
On Thu, May 16, 2019 at 07:01:12PM -0400, Martin Blais wrote:
> Alright now I see what you want to do.
> You want to rewrite your payees, but in the source file itself.
> That's a nice idea.

JFTR, a source-to-source equivalent of the current plugin system is
something I'd love to have too. My typical use case is "fixing the
past", e.g., when I refactor the account hierarchy or more generally
find a better way to account for something and I want to automate the
process of fixing past entries.

-- 
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/20190517083742.srr6437tld6rd33j%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: How to fix the income statement so that incomes are positive and expenses are negative?

2019-05-09 Thread Stefano Zacchiroli
On Thu, May 09, 2019 at 04:51:15AM -0400, Zhuoyun Wei wrote:
> Perhaps Fava could provide a fava-option that flips the signs to
> generate a "traditional" Income Statement and Balance Sheet?

There are indeed two different aspects here that have been conflated in
this thread.

One is what Beancount internally uses --- and I'm pretty sure that's not
gonna change.

One is how Fava shows (or not) signs to users. I agree it would make a
sense to have a UI option in Fava that make signs more "standard" and
less puzzling for traditional debit/credit double-entry accounting
users. This is a question for the Fava devs though, that usually react
quickly to this kind of suggestions via the GitHub issue tracker
https://github.com/beancount/fava

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/20190509091837.ut5jm6vm2gelcev3%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [Bitbucket] Issue #392: Booking method not applied when used in included file (blais/beancount)

2019-05-06 Thread Stefano Zacchiroli
On Sun, May 05, 2019 at 03:05:28PM -0400, Martin Blais wrote:
> BTW, as a quick note, purely textual include should be doable with a simple
> wrapper script that invokes the c++ preprocessor frontend.
> (I can't remember why I didn't implement it as such at the time.)

Yeah, that's what I was referring to with using a "dumb" preprocessor
for dealing with includes. It would be the best solution for settling
once and for all all include surprises.

-- 
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/20190506065857.dh327o6fa6riqxrw%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Fwd: [Bitbucket] Issue #392: Booking method not applied when used in included file (blais/beancount)

2019-05-05 Thread Stefano Zacchiroli
On Sun, May 05, 2019 at 08:09:30AM -0400, Martin Blais wrote:
> One often recurring issue is that of new users getting confused about
> options in included files.  I'm contemplating simply disabling them to
> avoid confusion.  Does anyone care for options in included files, or
> use them for anything useful?  (AFAIK they shouldn't be working.)

What is confusing is that they work in the main file but not in included
ones. Disabling them completely from included files (which is what I'm
assuming your proposal here is) wouldn't make it any less confusing.

More generally, when you have file inclusion support in some sort of
language/templating system, the general expectation is that it is should
be completely transparent and that you can always "refactor" your files
any way you like without incurring in semantically meaningful changes.
I have no idea how hard it would be to get that with Beancount (maybe
inclusion should just become a purely textual operation, delegated to a
"dump" file processor?), but IMHO *that* is what will make file
inclusion not confusing at all.

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/20190505122950.ykny3trnimpwmbo3%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Create a balance from the API

2019-05-05 Thread Stefano Zacchiroli
On Sun, May 05, 2019 at 08:02:25AM -0400, Martin Blais wrote:
> As such, I'd make all dataclasses frozen...

Sure, frozen dataclasses are great, and they would be great and an
improvement on the front of default arguments wrt to the current named
tuples approach.

I'm myself a functional programmer, so I don't need any convincing on
the usefulness of immutability :-)

-- 
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/20190505122353.2km4ulwdbqpflkbb%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Create a balance from the API

2019-05-04 Thread Stefano Zacchiroli
On Fri, May 03, 2019 at 10:48:27PM -0400, Martin Blais wrote:
> On Thu, May 2, 2019 at 4:26 AM Florian Lindner  wrote:
> > Just omitting the optional arguments doesn't work and gives a TypeError.
> >
> 
> Python Namedtyples don't come with defaults in their constructor.
> I've been meaning to add this eventually - by inheriting and providing such
> a constructor.
> It could make the entire codebase a little simpler and less error-prone,
> it's a bit annoying to always use the full set of positional arguments.
> The tags and links empty sets could be handled there automatically as well.

Python data classes might come in handy here:
https://docs.python.org/3/library/dataclasses.html

-- 
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/20190504070007.zvhdj2w4zqixixjb%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: ledger2beancount

2019-04-23 Thread Stefano Zacchiroli
On Tue, Apr 23, 2019 at 08:03:42AM -0700, Alen Šiljak wrote:
> It's sad that something like this could not have been implemented in
> Python and shared as modules so that others can transform their source
> files (or databases) into beancount format.

Have you ever tried using the ledger Python bindings?

If not, please do, then we'll discuss why it's been done this way :-)

-- 
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/20190423154738.gaqu4dvl34yq5a7m%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: LWN reviews beancount

2019-04-17 Thread Stefano Zacchiroli
On Wed, Apr 17, 2019 at 04:29:03PM +0300, Aamer Abbas wrote:
> I don't want to speak on his behalf, but I think his concern is a bit
> different. In your example, I think he wants his checking balance to
> reflect that he has $1000 less than the actual amount. Because at any
> moment, that check could be cashed and he needs to ensure he is setting it
> aside so that money is not spent (and also I guess he wants to recognize it
> that way for tax purposes).

Right. I didn't mention it explicitly in my previous post, but I do face
that very same problem for my personal finances: I've a bank account and
I want to make sure that the amount of known outstanding payments that
might hit it cannot make it go red. (In my cases those payments include
not a lot of cheques, but a potentially substantial monthly credit card
bill.)

> Your example does certainly make that possible, but it requires you to do
> two queries and then subtract Liabilities:Payable from Assets:Checking.

... and that is precisely what I do. I have Beancount canned queries
that takes into account the relevant accounts (unintended pun :-)) and
show me the total. If it's below 0, I should better move money from
savings accounts back to that checking account.

(Arguably, those queries could be simplified if we had tags/metadata on
accounts and the ability to filter accounts based on those, rather than
only string matching. But that is a separate topic, which IIRC we have
discussed in the past on this list.)

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/20190417133923.4wzxa6hecmpqryug%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: LWN reviews beancount

2019-04-17 Thread Stefano Zacchiroli
Hi Jonathan, nice to read you here!

On Tue, Apr 16, 2019 at 12:03:39PM -0600, Jonathan Corbet wrote:
> OK, for purposes of illustration, imagine that we send a check for,
> say, $1000 to an author on December 20; they cash it on January 4.
> The statement from the bank at the end of December will not include
> that check, but we know that we have $1000 less than the bank thinks;
> that money is spent. The lower balance is what I was referring to as
> the "real" balance - the amount of money we actually have.

The traditional way of tracking this in Beancount/Ledger (and, in fact,
in double-entry accounting with accrual basis) would be:

  2018-12-20 * "author payment" "Mr Foo Bar"
  ; cheque: "12345678"
  Expenses:Writing 1000.00 USD
  Liabilities:Payables-1000.00 USD

  2019-01-04 * "cashing in author cheque" "Mr Foo Bar"
  ; cheque: "12345678"
  Liabilities:Payables 1000.00 USD
  Assets:Checking -1000.00 USD

Unless I'm misunderstanding your needs, this allows to verify at any
point in time both (1) the amount of money you are supposed to have in
the bank (by querying Assets:Checking) and (2) what you called the
"real" balance, by querying Income/Expenses over the year of
interest. ... or any variations of it you might need: a common one is
your Net worth, i.e., Assets - Liabilities.

I've never used a GUI accounting tool, nor I'm an actual accounting
expert. But what I'm guessing from the conversation here is that the
accounting systems you're used to actually do the above, but "hide" the
two transactions behind a single transaction with a "cleared" flag,
whose state changes are timestamped and monitored by the system.


This is not to say that Beancount is or isn't suitable for specific use
cases (yours or others). I see value in both "low level" accounting
tools like Beancount (and I've enjoyed learning more about accounting
theory thanks to that) and in higher-level ones that focus more on other
aspects of accounting. Take your pick :)


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/20190417125602.pdcdofpgkdqfsdhg%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Beancount with large journals

2019-04-15 Thread Stefano Zacchiroli
On Mon, Apr 15, 2019 at 03:10:31PM +0300, Aamer Abbas wrote:
> Stefano, does it already do caching? Where is the pickle cache stored? I
> see __pycache__ files in my importer folders, but not anywhere else. Sorry,
> I have not really done much python in the past, so I am probably asking a
> dumb question.

Not dump at all, especially because it's not entirely trivial to
reproduce :-) If you have a foo.beancount file, Beancount will use a
.foo.beancount.picklecache cache file, but *only* if loading the textual
file took more than 1 second. See:

  
https://bitbucket.org/blais/beancount/src/fa1edde3bcd02a277fac193f460a39c9a1461161/beancount/loader.py?at=default=file-view-default#loader.py-53

Hence it will probably not create the cache file in artificial examples
like running bean-check on the output of bean-example. But it will use
cache files in any real-life scenario with a significant number of
transactions.

Hope this helps,
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/20190415122528.gxeqgrgcsiimcgog%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Beancount with large journals

2019-04-15 Thread Stefano Zacchiroli
On Mon, Apr 15, 2019 at 05:01:57AM -0700, Alen Šiljak wrote:
> Just out of curiosity - would changing the data format shorten the time 
> required for processing? I know this is plain-text-accounting but it would 
> be interesting to see what effect would using SQLite have on the 
> performance.
> It might help in reducing the load time of transactions simply due to the 
> nature of the technology.

It won't help in the (common) scenario in which you don't actually parse
the text file, but rely on the Pickle cache instead. My understanding is
that Martin wants to improve performances in that scenario as well.

-- 
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/20190415120638.nrme4od3zj3zdlje%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: LWN reviews beancount

2019-04-15 Thread Stefano Zacchiroli
On Sun, Apr 14, 2019 at 11:34:13AM -0400, Martin Blais wrote:
> RECONCILIATION.
[...]
> one can just use a SQL command, something like SELECT location WHERE
> date >= 2019-02-01 and flag ='!' and iterate using "next-error" in
> Emacs. Perhaps that should be documented better.

I totally missed this was a possibility and it is indeed really cool.

I randomly checked the BQL documentation (which is what I used to learn
about the query syntax at the time) and there is no mention of "SELECT
location" which, OTOH, is well documented in "help select" in the BQL
shell. Quoting from it for others who might have missed it to:

  'location': The filename:lineno where the posting was parsed from or
created.  If you select this column as the first column, because it
renders like errors, Emacs is able to pick those up and you can
navigate between an arbitrary list of transactions with next-error
and previous-error. Type: str.

It might indeed deserve some mention in the main BQL documentation, as a
relevant use case.

> CHECKS & TRANSACTION NUMBERS.
[...]
> of support is provided for checks, for example, all I can imagine is
> (a) checking that no two check numbers are repeated, and/or that all
> consecutive numbers from the smallest one are present, or (b) special

Just as a random feedback: some banks here in France give out
chequebooks where check numbers are randomized (within the chequebook).
So any strict check on sequentially should allow some sort of override.

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/20190415075724.c734otkk7ys6qv2v%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


strict metadata and tags

2019-04-14 Thread Stefano Zacchiroli
Heya, has anyone already written a Beancount plugin that emulates what
ledger --strict does? Namely, that tags and metadata fields must be
predefined in order to be allowed?[^]

It's trivial to do with a plugin, but if someone has already done it,
I'll avoid re-implementing it :-)

TIA,
Cheers

[^]: ledger's --strict also requires commodities to be pre-declared, but
 Beancount is strict by default in that respect, so there is no need
 to emulate it.
-- 
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/20190414121519.gufl6g5tkoiqflfx%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-03-31 Thread Stefano Zacchiroli
On Sun, Mar 17, 2019 at 05:41:16PM -0600, Daniele Nicolodi wrote:
> I would like to upstream my changes, however, now that I know how I
> would like the code to look like at the end, I would need to break up
> my changes in a patchset and submit if for inclusion. This would
> require some time investment. I haven't seen any interested from
> Martin about those changes, thus am I reluctant to put that last bit
> of work in.

Martin: can you comment on this?

Many thanks in advance,
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/20190331121529.mld6za2i22fijp2r%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Beancount with large journals

2019-02-19 Thread Stefano Zacchiroli
On Mon, Feb 18, 2019 at 04:45:23PM -0500, Martin Blais wrote:
> Plugins would probably have to be written in C++ (though the API would
> be very simple, as it is now), but if possibly a Python API for them
> would also be there (it might just slow down your processing a
> bit).

Requiring end users to write plugins in C++ would be a major set back
w.r.t. the current state of affairs.  So, yeah, if you go that way
(which is an understandable requirement if you notice that *some*
plugins require considerable speedup) you should also have as a
requirement that of *also* supporting native Python plugins. That way
the trade-off between the flexibility of Python plugins and the
efficiency of C++ ones will be up to users.  You will have to pay the
price of supporting multiple ways of writing plugins, but I speculate it
will be entirely worth it in terms of user adoption.

(I realize this kind of feedback is pointless until it turns into actual
code, but you seem to be welcoming the discussion, so I bite :-))

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/20190219152344.ae323ewa6xyxgxt4%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


SELECT [arithmetic_expression] in BQL

2019-02-14 Thread Stefano Zacchiroli
Is there a way to perform simple arithmetic expression in BQL, e.g.,
additions/differences between other columns?

My use case is queries like this one:

3000-01-01 query "investments" "
  SELECT account, UNITS(SUM(position)) AS units, COST(SUM(position)) AS cost, 
VALUE(SUM(position)) AS value
  WHERE account ~ '^Assets:.*Investments'
  GROUP BY account, currency
  ORDER BY account, currency
  "

where I'd like to have an extra column showing "value - cost".

TIA,
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/20190214103611.zwqcosxaepskwlkv%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Beancount with large journals

2019-02-13 Thread Stefano Zacchiroli
On Sun, Feb 10, 2019 at 11:07:03PM -0500, Martin Blais wrote:
> You can view the breakdown in time with the -v option to bean-check:

You've probably already thought about that, so out of curiosity: how
much of this is potentially parallelizable, as an avenue for "easily"
getting a performance boost? I guess not much, due to either I/O
constraints or the GIL lock, right? I'm curious about whether
validation, booking, and plugins might be made parallelizable in the
future.

-- 
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/20190214074406.e4d4h2yobs2rc4ac%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: beancount-mode as a major mode

2019-01-23 Thread Stefano Zacchiroli
On Wed, Jan 23, 2019 at 09:08:40AM -0700, Daniele Nicolodi wrote:
> I renamed the two variables that control alignment. Now they are
> beancount-transaction-indent and beancount-number-alignment-column. I
> think those names are better than my old choice. I mentioned that in a
> previous email, but you may have missed it.

Oh, yeah, that's it, sorry for the noise.

> I also forgot to mention that this version drops the cache for account
> names used for completion. I tested it on a ledger of mines with more
> than two years of personal transactions and completion is instantaneous.
> However, I would appreciate if users with very large ledgers would test
> it and let me know how responsive it feels.

I've tried it on my ledger --- 5 years, 8 K transactions, 2 MB ledger in
beancount format --- and it still feels very responsive; I wouldn't say
it feels *instantaneous*, but it's still waaaay acceptable.

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/20190123162213.4cqfxxelfhkqzlz6%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-20 Thread Stefano Zacchiroli
On Sun, Jan 20, 2019 at 09:32:24AM -0700, Daniele Nicolodi wrote:
> (setq beancount-posting-alignment-column 4)

Nice :-)

-- 
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/20190120164800.xpqczk2tnirfqhhp%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-20 Thread Stefano Zacchiroli
On Sat, Jan 19, 2019 at 10:59:36PM -0700, Daniele Nicolodi wrote:
> I have now re-implemented number alignment.  It is automatically
> triggered on newline and on tab.  I also implemented
> beancount-align-transaction that you can bind to C-C C-q to obtain the
> ledger-mode functionality.

I've tested this, and it works great!

I was initially surprised that the function doesn't also align each line
of the transaction before aligning the amounts (i.e., doing the
equivalent of hitting TAB on each line and *then* align the amounts),
but that is indeed consistent with ledger-mode's behavior.

> By default numbers are aligned to the 52nd column, controlled by the
> beancount-posting-amount-alignment-column defcustom variable. If that
> variable is set to nil the column is computed in a similar way asin
> beancount-align-numbers. This is probably quite slow for huge ledger
> files, and I personally prefer to have the alignment independent of
> the length of the account names.

That is my own preference too, but it's nice to have the re-align
everything option, for those who really want to.

Since we're talking about customizability, it would be nice to have a
local variable to set the desired amount of indentation. I know
beancount goes for 2 spaces by default, but I currently use 4, for
consistency with ledger. YMMV.

Also, on your yesterday's point about breaking the current behavior, I
guess this list is a good start to check if there really are people who
want TAB to trigger autocompletion when the cursor is in the middle of
an account name. But anyway, I'm guessing you'll eventually submit these
amazing improvements to Martin B. as PR, so you can also let him be the
arbiter of the preferred behavior there.

Thanks a lot for all this!

Ciao,
-- 
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/20190120162658.tmm5fa6m45w2tdxy%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-19 Thread Stefano Zacchiroli
Ciao Daniele,

On Thu, Jan 17, 2019 at 04:19:14PM -0700, Daniele Nicolodi wrote:
> I found some time to hack on beancount-mode. You can find the progress
> here
> https://bitbucket.org/daniele/beancount/src/default/editors/emacs/beancount.el

great work! thanks a lot for this, more detailed feedback below.

> On 04/01/2019 06:25, Stefano Zacchiroli wrote:
> > - completion: I'm not sure how that is supposed to work. beancount-tab
> >   as a function works well for accounts and tags (but not metadata
> >   key/values, apparently), but if I bind it to TAB I lose indentation,
> >   whereas in ledger-mode the two seems to work well together. Maybe I'm
> >   not using it right
> > 
> > - indentation: as above, is there a function to auto-indent the first
> >   character of the current line at the right column that I'm not
> >   finding? in ledger-mode that's TAB, similarly to what happens with
> >   most other major modes for programming languages
> 
> Those two points have been fixed following Stefan advice. It works for
> me using fundamental-mode as major mode. I haven't implemented
> completion of metadata yet.

Account completion works perfectly for me now. Ditto for indentation.

The only glitch I've noticed is in the interaction between the two.
Consider the case of a badly indented line: you hit TAB on it and it
gets properly indented, if you hit TAB *again*, it will most often
triggers account completion (e.g., when you're on a account line),
generally overwriting the previous account name, which is generally not
what you want.

I've compared with the ledger-mode UX, and I think the key difference is
that in ledger-mode account completion is triggered only when the cursor
is at the end of the account name, not when it is anywhere else on an
account line. I haven't checked how that is actually detected in the
implementation though. I think it would make sense to do the same in
beancount-mode.

> > - highlighting: there's no highlighting of the current entry (usually a
> >   transaction), arguably a very minor point, but annoying when you're
> >   editing transactions with many postings/tags/metadata
> 
> This was easy to implement. You need something like
> 
> (setq beancount-highlight-transaction-at-point t)

This works perfectly.

Thanks a lot Daniele!,
hope this feedback helps,
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/20190119160905.ghll7axvsdlgjn2k%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Cookbook comment/question

2019-01-10 Thread Stefano Zacchiroli
On Thu, Jan 10, 2019 at 04:04:31PM -0800, jonathanto...@gmail.com wrote:
> Am I missing an important use for which it's good to have income/expense 
> category nested below, rather than above, account?

I don't remember if it is part of the current doc but Martin presented,
and we discussed on list a while a go, a very convincing view in which
the different parts of an account name are really just "facets".

In your example one would be the major account type imposed by
double-entry accounting, one would be the country, etc.  If you think of
it that way, the different linearizations into strictly hierarchical
taxonomies become pretty arbitrary.

You should pick what makes the most sense for you in terms of how often
you add up the result of queries at a given node in the taxonomy, and do
the other groupings by hand when you really need to (he fact that with
BQL you generally match accounts using regular expression makes this
very convenient to do.) But there is no "strong right" or "strong wrong"
way of doing it.

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/20190111074926.idwstluziezjzekj%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-06 Thread Stefano Zacchiroli
Hi Stefan,

On Sun, Jan 06, 2019 at 12:37:14PM -0500, Stefan Monnier wrote:
> AFAIK, this is because your major mode is org-mode which does its own
> thing with TAB.

Right.

Do you have any advice (and/or related work examples) on how to make
beancount-mode works both as a major and minor mode?

I've never seen anything of the sort (and I know well that Martin is
keen in keeping beancount available as minor mode), but it should be
easy to do with different top-level entry points (M-x
beancount-{minor,major}-mode) that reuse most of the common code behind
the scenes, right?

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/20190106192425.rnl2n7y3kaxncb4x%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: beancount and fava now available in Debian

2019-01-05 Thread Stefano Zacchiroli
On Sat, Jan 05, 2019 at 08:29:32PM +1100, Martin Blais wrote:
> Beyond baking a release for Beancount, is there anything else that's needed
> to be patched in?

Not really. For dogfooding reasons I've myself switched to use the
packaged version rather than the mercurial checkout and I haven't
noticed anything missing or too annoying, even in light of long term
support.

Baking a release would be nice. It's not strictly needed, but it'd
indeed give users more confidence they're not building on top of a shaky
VCS snapshot.

Another nice to have would be documentation shipped with the package, to
allow for offline reading, which is something generally expected for
Debian packages. Right now I'm only shipping this README:

  
https://bitbucket.org/blais/beancount/src/ccc6dff1b7b4c29c48d41f666c0850ce2ce66bb7/docs/README?at=default=file-view-default

I understand it's probably too short time to properly bake the
documentation using the Google Docs -> rst pipeline, but maybe you'd
consider shipping a one-off rst export with the upcoming release? Again,
nothing blocking, just a nice to have if it's doable with little effort.

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/20190105102908.r56exzjagqiucruh%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-04 Thread Stefano Zacchiroli
Ciao Daniele, first of all thanks a lot for your feedback.

On Thu, Jan 03, 2019 at 10:30:43AM +0100, Daniele Nicolodi wrote:
> I agree that ledger-mode provides some functionality that would be
> nice to have in beancount-mode and I started to work on some, however
> I'm far from fluent in Elisp and I don't have much free time to work
> on this right now.
[...]
> Time permitting the next thing I will look into is probably
> investigate a way to have beancount-mode work as a major mode in
> addition to a minor mode, but I haven't found another mode that does
> something similar to take inspiration from, and my Elisp knowledge is
> too scattered to know if that is really a possibility.

I'm in a similar situation, but I'll be happy to land a hand if you
start hacking around in that direction.

> Which functionalities do you miss the most in beancount-mode?

- completion: I'm not sure how that is supposed to work. beancount-tab
  as a function works well for accounts and tags (but not metadata
  key/values, apparently), but if I bind it to TAB I lose indentation,
  whereas in ledger-mode the two seems to work well together. Maybe I'm
  not using it right

- indentation: as above, is there a function to auto-indent the first
  character of the current line at the right column that I'm not
  finding? in ledger-mode that's TAB, similarly to what happens with
  most other major modes for programming languages

- number alignment: I'm missing ledger-mode's equivalent of C-c C-q.
  beancount-align-numbers is supposed to do that (well, I guess), but:

  - it doesn't work on the current transaction by default, you have to
select it as a region first, which is time consuming; and

  - is inconsistent across transactions: if you align numbers in
separate transactions your ledger will "wiggle" horizontally

  there is bean-format for that, so I can use it and remap C-c C-q to
  pipe the current transaction to it as an external filter, but it's
  weird that such a basic function doesn't work out of the box so I
  think I'm missing something

- highlighting: there's no highlighting of the current entry (usually a
  transaction), arguably a very minor point, but annoying when you're
  editing transactions with many postings/tags/metadata

All in all it's entirely possible this is just me using the mode
"wrong", or expecting it to do things it's not supposed to do, but it's
hard to tell.

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/20190104132524.5jo6ufp5oglh4pki%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


beancount and fava now available in Debian

2019-01-04 Thread Stefano Zacchiroli
TL;DR: you can now: sudo apt install beancount fava

Dear beancounters,
  just a quick note that you can now apt install both Beancount and Fava
in Debian/unstable; in a few days this should also work for Debian
testing.

The packaging is courtesy by yours truly as well as Nicolas Dandrimont
(who did most of the Beancount packaging) and Pierre-Elliott Bécue (who
helped with Fava dependencies that weren't available in Debian yet). If
you use (Debian AND (beancount OR fava)) your feedback on the packages
would be very welcome, ideally via the Debian bug tracking system.

For Beancount and Fava upstream, this is a great time to let us know if
you want specific versions (or fixes) of either package to be part of
the next Debian stable release, which will be released later this year
and stick around for a few years. Debian development will be frozen mid
February [1] so that's packagers deadline to get major changes in.

[1]: https://release.debian.org/buster/freeze_policy.html

Currently the version of Fava shipped in Debian is 1.9.0; while the
Beancount version is a mercurial development snapshot as of December
25th, because we needed several recent commits to make the Beancount
test suite pass.

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/20190104085832.qquof3dxv37ujxz2%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


[emacs] using ledger-mode for beancount

2019-01-02 Thread Stefano Zacchiroli
Is any of the Emacs & Beancount users on this list using ledger-mode to
edit Beancount ledgers?

I've never found my way around beancount-mode and I really wanted a
major mode dedicated to accounting, so I've started playing with using
ledger-mode for Beancount.

The basics (indentation, account completion) work surprisingly well out
of the box. Plus, one can add beancount-mode on top of it as a minor
mode and get stuff like bean-context.  There are some glitches, e.g.,
transaction highlighting is completely broken, but nothing unbearable.

Is anyone using ledger-mode for Beancount and can point to tips or
suitable configuration snippets?

If the ledger-mode-for-Beancount user base is non nil we might have
chances of adapting it and pushing upstream changes that make it work
very well for Beancount.

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/20190102124254.7dsgeaikysp2tx4h%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Cumulative sum in bean-query?

2018-11-01 Thread Stefano Zacchiroli
On Thu, Nov 01, 2018 at 11:49:36AM -0700, ethan.glasser.c...@gmail.com wrote:
> Is there a bean-query mechanism for doing accumulation or "running count" 
> operations? I could "roll my own" using a subquery but I see from the 
> documentation that sub-selects aren't supported.

You have the balance "column", as in:

  SELECT balance WHERE account ~ '^(Liabilities|Assets)' ORDER BY date;

See: "The “balance” Column" in the BQL documentation here:

  
https://docs.google.com/document/d/1s0GOZMcrKKCLlP29MD7kHO4L88evrwWdIO0p4EwRBE0/

It's not a fully generic running count, but AFAICT is what is used by
the BALANCES shorthand query which you cited as initial example.

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/20181101190147.75d3a224xwe7gi2d%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Issue #334: prefix matching when running custom queries (blais/beancount)

2018-09-25 Thread Stefano Zacchiroli
New issue 334: prefix matching when running custom queries
https://bitbucket.org/blais/beancount/issues/334/prefix-matching-when-running-custom

Stefano Zacchiroli:

BQL "run QUERY_NAME" command currently expects a precise match on QUERY_NAME.

It would be nice to make it select the best match for QUERY_NAME, based on 
prefix matching. That is, any prefix of existing queries would work, as long as 
it is non-ambiguous, i.e., it identifies a single query.

The attached patch implements this.


-- 
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/20180925123426.1222.56089%40celery-worker-110.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.


Re: custom SimilarityComparator for bean-extract

2018-09-02 Thread Stefano Zacchiroli
On Sun, Sep 02, 2018 at 01:01:42PM -0400, Martin Blais wrote:
> I made a change a little while ago that allows you to turn your import
> file into a script:
> 
> from beancount.ingest.scripts_utils import ingest

So basically in the relatively short period elapsed from my last "hg
pull" and me asking about this here, you implemented the solution for a
problem I didn't know I had yet :-)

Amazing, thank you! (And, in passing, I also like the design a lot.)

I'll report back here if it's not flexible enough for my needs, but at
first sight it totally fits the bill.

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/20180902175311.GC27063%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


custom SimilarityComparator for bean-extract

2018-09-02 Thread Stefano Zacchiroli
Heya,
  I'm using the built-in CSV importer (beancount.ingest.importers.csv)
with bean-extract and, in spite of being documented as bare bone, it
works perfectly fine for my need :)

The only issue I'm facing is that I want to customize the behavior of
beancount.ingest.similar.SimilarityComparator and I didn't find a way to
do so.

(In short, I've a special metadata key, bank-label, which I import from
my CSV files and which I trust as quasi-unique ID for deduplicating
transactions. That key + transaction date would be my ideal
deduplication criteria. SimilarityComparator() is both more strict,
e.g., it requires dates to be relatively near in time, without a way to
pass a different time window; and more lax, e.g., allow amounts to vary
a bit; than what I want.)

Ideally, I'd like to write my own SimilarityComparator and pass it down
to bean-extract via the importer configuration, but the configuration
API doesn't allow to do so ATM. Would such a generalization be welcome
to you, Martin? (as bug report and/or patch)

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/20180902122320.GA27063%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: document organization: unifying statements with everything else

2018-05-06 Thread Stefano Zacchiroli
On Sun, May 06, 2018 at 12:34:17PM -0400, Martin Blais wrote:
> It would be possible to not list the documents that are associated with
> transactions in the journals, if that's what you mean.
> That's a web UI option.
[...]
> Same as I describe above. Imagine a plugin that runs the join I'm proposing
> and removes matched Document directives from the list and moves them to
> metadata.

This is the part that wasn't entirely I clear to me. I thought that the
intended meaning of document directives was to stick document to a
specific point in time in the transaction journal.

While the interpretation you're suggesting here is that it just makes
Beancount aware of the existence of documents, the date is just an
attribute documents will have (because it's required for all Beancount
directives); but documents have no special meanings other than what
plugins / UIs make of them.

This addresses my concern, thank you. I will stop worrying about mixing
transaction-specific documents and statements.

> BTW, I'm happy to support something like this in Beancount itself,
> that functionality could move out of Fava, it's not web-specific.

That would be helpful and make more users use documents associated to
transactions, I think. But is of course up to the Fava people to decide
if they want to move the plugin over or not.

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/20180506170107.GJ1361%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


document organization: unifying statements with everything else

2018-05-04 Thread Stefano Zacchiroli
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.

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.

As far as I can tell Beancount itself has not direct support for (2),
please correct me if I'm wrong. 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?

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.


icsv2ledger compatible categorizer for CSV importer

2018-04-23 Thread Stefano Zacchiroli
On the Ledger side, I've been using icsv2ledger[1] for many years. That
means I've a pretty rich mapping DB in the format of that tool.

[1]: https://github.com/quentinsf/icsv2ledger

When I started to play with bean-extract and the builtin CSV importer
(beancount.ingest.importers.csv), it occurred to me that it'd be nice to
have a categorizer for it that used the icsv2ledger mapping file as a
backend. Hence I wrote it, and you can find it attached to this mail.

Comments welcome.

In particular, this is my first attempt as using the internal Beancount
data structures, so I'd love to hear what I'm doing wrong.

Also, is the built-in CSV importer meant to be used this way
(sub-classing and all) or am I missing something?

Please let me knkow if this adapter is of interest to others than me. In
that case I can publish it on a more suitable place than this list.

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/20180423140752.GA23447%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.
"""categorizer for Beancount CSV importer based on icsv2ledger mapping DB

Given as input a mapping_file for `icsv2ledger
<https://github.com/quentinsf/icsv2ledger>`_, return a function from Beancount
transactions to Beancount transactions, suitable as categorizer argument for
Beancount built-in CSV importer
(:class:`beancount.ingest.importers.csv.Importer`).

This categorizer hence provides compatibility between icsv2ledger maintained
mapping DBs and Beancount importers, allowing to share mappings between the
Ledger and Beancount worlds.

"""
__copyright__ = "Copyright (C) 2018  Stefano Zacchiroli"
__license__ = "GPL-2.0-or-later"


import csv
import re

from beancount.core.data import Posting, Transaction


tag_kv_sep_RE = re.compile(r':\s*')


def read_mappings(mapping_file):
"""read a icsv2ledger mapping file and return a list of parsed mappings

each parsed mapping is a dict with keys: "pattern" (a regexp),
"description", "account", "metadata" (a list of key/value pairs), "tags"

note that the order is significant: as per icsv2ledger semantics, the
*last* match wins

"""
mappings = []

with open(mapping_file) as csvfile:
reader = csv.reader(csvfile)
for fields in reader:
mapping = {}

mapping['pattern'] = re.compile(fields[0].strip('/'))
mapping['description'] = fields[1]
mapping['account'] = fields[2]
mapping['metadata'] = []
mapping['tags'] = []
for tag in fields[3:]:
try:  # if it's a metadata entry, split key/value
k, v = tag_kv_sep_RE.split(tag)
mapping['metadata'].append((k, v))
except ValueError:  # it's a tag, not a metadata entry
mapping['tags'].append(tag.strip(':'))

mappings.append(mapping)

return mappings


def categorize_txn(mappings, unknown_acct, txn):
"""categorize a transaction using icsv2ledger mappings

find best (i.e., last) match and return a transaction which is a fresh copy
of the input one, updated with all the info given in the matching mapping
entry

"""
assert txn.postings
txn_amount = txn.postings[0].units

matches = (m for m in reversed(mappings)  # look for best match
   if m['pattern'].search(txn.narration))

new_txn = None
try:  # match found: set narration, add metadata, tags, categorization leg
mapping = next(matches)

narration = mapping['description']

meta = txn.meta
meta.update(dict(mapping['metadata']))  # merge meta
tags = txn.tags.union(set(mapping['tags']))  # merge tags

new_posting = Posting(mapping['account'], -txn_amount,
  None, None, None, None)
postings = txn.postings + [new_posting]  # add category

# make txn point to a new, updated transaction, and quit
new_txn = Transaction(meta, txn.date, txn.flag,
  txn.payee, narration,
  tags, txn.links, postings)
except StopIteration:  # no match: add "unkown acc

Issue #274: allow single document option to span multiple per-year directories (blais/beancount)

2018-04-08 Thread Stefano Zacchiroli
New issue 274: allow single document option to span multiple per-year 
directories
https://bitbucket.org/blais/beancount/issues/274/allow-single-document-option-to-span

Stefano Zacchiroli:

As suggested by the documentation, it is handy to split documents like bank 
statements into per-year sub-directories. To support all of them, one currently 
needs to specify the document option multiple times, e.g. (real-example from my 
own beancount file):
```
#!beancount
option "documents" "documents/2018"
option "documents" "documents/2017"
option "documents" "documents/2016"
option "documents" "documents/2015"
option "documents" "documents/2014"
option "documents" "documents/2013"
option "documents" "documents/2012"
option "documents" "documents/2011"
option "documents" "documents/2010"
option "documents" "documents/2009"
```
Having to maintain this list is tiresome and bloated.

Given how popular this arrangement is, it would be nice if beancount would look 
for both DOCUMENT_DIR/ACCOUNT_NAME/-MM-DD.file.pdf and 
DOCUMENT_DIR//ACCOUNT_NAME/-MM-DD.file.pdf . With that, it will become 
possible to specify a single document option, like this:
```
#!beancount
option "documents" "documents"
```


-- 
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/20180408071400.10827.85762%40celery-worker-109.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.


Re: Website down?

2018-04-08 Thread Stefano Zacchiroli
On Sat, Apr 07, 2018 at 07:02:53PM -0600, Daniele Nicolodi wrote:
> is it just me or the project website http://furius.ca/beancount is down?


-- 
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/20180408070732.GJ21013%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.
--- Begin Message ---
My website is down for a few days as it's being reset to a new IP address
for an administrative reason;
the main problem with this is that a lot of the documentation links go
through redirects from furius.ca.

However, you can find all the docs from the index page, which use direct
links to Google Drive.
The index page is located here:
https://docs.google.com/document/d/1RaondTJCS_IUPBHFNdT8oqFKJjVJDsfsn6JEjBG04eA/

The source code can be found at:
http://bitbucket.org/blais/beancount

Apologies for the temporary inconvenience,



On Mon, Apr 2, 2018 at 5:51 PM, John Rakestraw <john.a.rakest...@gmail.com>
wrote:

> Hi, all --
>
> I'm a long-time ledger user. A recent thread on the ledger list leads me
> to look more closely at Beancount. But I couldn't get the web site (
> http://furius.ca/beancount) to load and it still doesn't load today -- it
> times out. Is that a known problem? And is this where I should download and
> learn more about the program?
>
> Thanks --
>
> John
>
> --
> 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/e60fb01b-90db-47ec-85ab-458e7882bd76%40googlegroups.com
> <https://groups.google.com/d/msgid/beancount/e60fb01b-90db-47ec-85ab-458e7882bd76%40googlegroups.com?utm_medium=email_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 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%2BhO0gupsq%2BhHPKn8Uk%3DdNYE2OXzp-brmtq%2B4UoEvHVo_2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--- End Message ---


Re: CI [Was: moving to GitHub?]

2018-03-31 Thread Stefano Zacchiroli
On Sat, Mar 31, 2018 at 12:45:12PM -0400, Martin Blais wrote:
> CI only makes it easier to run the test, it doesn't write the tests.
> Running the tests is easy ("make test" locally)

My point was that it gives actionable incentives to write the tests to
wannabe contributors.

-- 
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/20180331170301.GE13350%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


CI [Was: moving to GitHub?]

2018-03-31 Thread Stefano Zacchiroli
On Thu, Mar 29, 2018 at 08:30:30PM -0400, Martin Blais wrote:
> You speak as if a little bit of untested code is worth anything. It's
> not. Let me explain.

Oh, no, I agree it's not worth it. And it's great that you, as Beancount
maintainer, have high standards for code acceptance that encompass: (1)
not breaking existing tests, and (2) having thorough unit tests for the
new code being contributed.

But it seems to me that that is almost completely unrelated to the
choice of hosting platform, isn't it? Aren't you in fact just saying
that what you want is continuous integration (CI) integrated with the
contribution work-flow for proposed patches?

Both GitLab and GitHub have integrated CI offerings, and IME they go a
long way in avoiding wasting maintainer time in "complaining" about
breaking existing tests. You make the CI run on incoming patches, if
existing tests get broken by it, submitters get immediate feedback about
it and can iterate by themselves to fix that, without any need of your
intervention.  And, in fact, you can do the same for missing tests. Just
enable the nose (or equivalent) code coverage plugin and make it fail if
the coverage is not up to a given standard or threshold, and there too
you automatically send the ball back in the camp of code contributors if
they don't show up with tests.

I don't know if BitBucket has any CI integration, but I'd be surprised
if it doesn't. Aside from that aspect, this seem unrelated to the "lower
barriers for contribution due to what is well-known out there". (But is
an interesting discussion anyway!)

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/20180331090248.GD13350%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: moving to GitHub?

2018-03-28 Thread Stefano Zacchiroli
First of all, thanks a lot for tagging/releasing Beancount 2.0, I'm
really excited about this (even if it's the same code base than a few
days ago, I know, but I can't help it!)

On Tue, Mar 27, 2018 at 10:52:48PM -0400, Martin Blais wrote:
> "Attracting more developers" is not an explicit goal of the project, though
> "attracting more developers who write very long and thoroughly thought-out
> suites of unit tests for very small and contained changes worked and
> reworked again from all the findings found from aforementioned laboriously
> written unit tests covering most of the cases" is quite useful. Do you
> believe moving to github would result in more unit testing?

I totally agree that one platform or another does nothing to *actively*
encourage developing more unit tests.

And I'm certainly not a fan of GitHub --- proprietary platform, forces
non-free JavaScript onto users, etc., etc., you know, my "usual FOSS
things" :) But FWIW the way I think about this is not in terms of
actively encouraging contributions, but rather not *discouraging* it.
Say a user has developed a bunch of test suites and want to contribute
them. And say that user is like Martin M., fluent with Git/GitHub, but
almost never used hg/bitbucket. He might give up sending you the tests
at the first attempt of rebasing/rewriting a PR that fails, unless he
has additional spare time and motivation. And at that point you would
have lost a contribution that you consider valuable.

That said, I don't particularly care, Bitbucket is as bad as a platform
as GitHub in terms of software freedom, and I'm happily using
git-remote-hg locally anyway, so the two alternatives are really the
same to me.

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/20180328075948.GF11151%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Documentation is now read-only

2018-03-24 Thread Stefano Zacchiroli
On Sat, Mar 24, 2018 at 12:35:23AM -0400, Martin Blais wrote:
> BTW, here's what the current automated conversion results looks like in
> your static skeleton:
> http://furius.ca/tmp/beancount-docs/

This is just ... wow ... amazing work Martin, thanks for doing this!

My only comment (in the same spirit of Dominik's point about lowering
the barrier for contributions) is to document in the doc itself how to
contribute.

I understand you want comments/edit suggestion via Google Docs. And each
sphinx document already points to the corresponding Google Docs origin.
I suggest prefixing each link with something like "to suggest edits to
this document go to ...". And I'm assuming you will re-enable
suggestions on the Google Docs once the sphinx documents will be
advertised as the main entry points for users, right?

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/20180324163324.GD31031%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Fava setup on a publicly available server

2018-02-08 Thread Stefano Zacchiroli
On Thu, Feb 08, 2018 at 12:08:40PM +0800, Oon-Ee Ng wrote:
> Also I use fava's plugin capabilities to commit every time an edit
> happens.

Can you tell us more about this? It's the first time I hear about it,
and it looks interesting to me. Also, given "git commit + git push" is
probably a standard need for many people editing via Fava, would a
"official" plugin for doing this be welcome?

TIA,
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/20180208085004.GD17250%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Loosely tracking shared expenses between partners

2018-01-29 Thread Stefano Zacchiroli
On Mon, Jan 29, 2018 at 12:59:04PM -0500, Martin Blais wrote:
> On Mon, Jan 29, 2018 at 12:50 PM, Simon Michael <si...@joyful.com> wrote:
> > Congrats, Martin!!

Ditto!

> > Gonna present him with his ledger on his 18th birthday ? (Yikes :-)

So, *cough* I'm actually doing the same think for my kid *cough*, with a
tag for each transaction that is related to him.

(Digression: the fact that you need the tag to be short looks like due
to the current Beancount limitation of having to put tags on the same
line of payee/description, which can get pretty long. I'm still doing
this in Ledger-CLI --- and generating a beancount automatically from it
for Fava and SQL-ish queries --- where tags can be on subsequent
(comment) lines so the tag can get long-ish, without being too much of a
hassle.)

But I'm not exactly sure to understand what's the benefit of Martin
rewriting plugin --- aside from showing off the beautiful data
model/flow that Beancount offers and which I love, that is :-)). Even
with just a simple tag, I can filter all transactions with a simple
query, and get a current balance (or filtered ledger, or whatever),
where the categories are the "right" ones, in the sense that grocery
would be (baby-related) Expenses:Grocery, clothes Expenses:Clothes, etc.

What am I missing here?

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/20180129191325.GB29678%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: local plugin import issue

2017-12-29 Thread Stefano Zacchiroli
On Fri, Dec 29, 2017 at 01:46:51PM -0500, Martin Blais wrote:
> Did you export PYTHONPATH?

That wasn't it. I don't even define a PYTHONPATH, because all modules
are installed in system-wide dirs that are in the default sys.path.

The "fix" was removing the beancount-specific picklecache. Many thanks
to Whoop on the #beancount IRC channel for suggesting this.

I was experimenting with the module installation without changing the
beancount file, so it was being cached. I'm guessing it also caches
something that inhibits re-loading user-defined plugins, because
otherwise this (still) doesn't make sense to me :)

Thanks anyway for your quick feedback Martin!
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/20171230063834.GA22576%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


local plugin import issue

2017-12-29 Thread Stefano Zacchiroli
Heya,
  an import issue for a local beancount plugin is driving me crazy. The
plugin is (locally) installed as a python3 module that can be loaded
just fine by any python3 invocation I could imagine, but bean-check
cannot find it.


Example/walkthrough, with commentary:

  ## bean-check fails loading the module
  zack@scaramouche:~/dati/ledger$ bean-check current.beancount 
  :0:   Error importing "mybeancount.public.file_ordering": No module 
named 'mybeancount.public.file_ordering'

  ## the module is well declared in the beancount ledger, which is why
  ## bean-check tries to load it
  zack@scaramouche:~/dati/ledger$ grep -n file_ordering current.beancount 
  12:plugin "mybeancount.public.file_ordering"

  ## bean-check is executed as env python3
  zack@scaramouche:~/dati/ledger$ head -n 1 `which bean-check`
  #!/usr/bin/env python3

  ## trying by hand, the plugin loads as a module just fine
  zack@scaramouche:~/dati/ledger$ /usr/bin/env python3
  Python 3.6.4 (default, Dec 19 2017, 14:09:48) 
  [GCC 7.2.0] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import mybeancount.public.file_ordering
  >>> 

  ## trying by hand, take 2, using importlib in exact the same way that
  ## the beancount Python library does. Again, works just fine:
  zack@scaramouche:~/dati/ledger$ /usr/bin/env python3
  Python 3.6.4 (default, Dec 19 2017, 14:09:48) 
  [GCC 7.2.0] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import importlib
  >>> importlib.import_module('mybeancount.public.file_ordering')
  
  >>> 


What am I missing here? I've also looked for sys.path fiddling in the
beancount code, but didn't find any that seem relevant here.

I'm able to reproduce the issue on two different machines (Debian
testing and Debian Stretch), with fresh beancount installations.

Many thanks in advance for your help,
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/20171229160941.GC16638%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Documentation is now read-only

2017-10-30 Thread Stefano Zacchiroli
Heya,

On Sun, Sep 24, 2017 at 03:33:03AM -0400, Martin Blais wrote:
> here's a snapshot of all the documents exported to all the available
> formats: http://furius.ca/tmp/beancount/beancount-docs-exported.tar.gz

Thanks for this, very useful.

I've started looking into automatically converting to something that
Sphinx would like to produce good output. Question about your findings:

> I took some notes on the conversion in the past:
> https://bitbucket.org/blais/beancount/src/22be0f233d079c14dc727d54378d21164db04cdf/experiments/docs/convert/compare_download_formats.txt
> 
> It seems like one may have to source from more than one export in order to
> obtain all the necessary bits to make a nice conversion.
> Most difficult is that all the formats seem to lose the indentation of the
> "code" (Beancount source) examples.
> (I think it should be possible to automatically reindent it with code.)

Docx output seems indeed to be the most rich output option from Google
Docs. But AFAICT it does retain the needed spacing in Beancount code
snippets. Here's an example from the rounding precision proposal
document:

  2014-05-06 * “Buy mutual fund”
  
Assets:Investments:RGXGX   4.278  RGAGX 
{53.21 USD} 
  
Assets:Investments:Cash -227.6324 USD
  
Expenses:Commissions   9.95   USD

which corresponds to:

  2014-05-06 * “Buy mutual fund”
Assets:Investments:RGXGX   23.45 RGAGX {42.6439 USD} 
Assets:Investments:Cash-1000 USD

When reading docx *pandoc* does indeed strip those spaces,
unfortunately, so one can't simply rely on pandoc for a docx -> rst
conversation, but the information seems to be there in the docx.

I'll give this path a try, but please let me know if you're aware that
I'm missing something here!

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/20171030133827.rw6jj56fsge2mzjf%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Documentation is now read-only

2017-08-15 Thread Stefano Zacchiroli
On Mon, Aug 14, 2017 at 11:29:30PM -0400, Martin Blais wrote:
> I could whine here about the advocacy on the mailing-list---as you
> already know, I don't care much for it. I'm a pragmatist.
>
> But let me not do that and instead turn your bottomless energy into a
> productive channel:

This is not the first time that I've the feeling you read much more in
my posts than there is to it---the other time was when I was trying to
figure out which precise version of a license Beancount was distributed
under, which was unclear at the time (and you've fixed since, thank
you!).

You mentioned a feature I'm personally interested in: search throughout
the entire Beancount documentation, rather than document by document.
As per your suggestion I've tried to make it work in my specific
condition, and it didn't work for me. Hence my message here, asking to
people more experienced than me in using Google Docs, if I was missing
something or not. It's as simple as that.

If I were "advocating", I would've been way more clear, I'm not a sneaky
person.

> as soon as I find some free time I'll download all the exported
> formats from Google Docs for each of the docs under well organized
> naming and place them somewhere you can access and download them. If
> you can build some way to automatically convert from any combination
> of those into Markdown format that would process and look really nice
> under Sphinx processing, I'll be happy to hook that conversion routine
> into the API calls and make /that/ an official mirror of the
> documentation. After all, there's nothing quite like scratching your
> own itch.
>
> Sounds like a deal?

That would be awesome, yes.

I'm also glad you're treating requests posted here (an inappropriate
venue for that) of an offline/buildable documentation as a proper bug
report, and also kind enough to be willing to spend some of your
volunteer time to fix it. Beancount's is some of the best documentation
I've seen around in the Free Software projects I use daily, and that
technical bit will enable some of us to peruse it even more effectively.
Thank you!

(If you prefer to have this as a proper bug report in the BTS, so that
we can coordinate to implement the needed bits, just let me know.)

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/20170815220430.barhwf3746b3yvu7%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: Documentation is now read-only

2017-08-06 Thread Stefano Zacchiroli
On Sun, Aug 06, 2017 at 01:52:31PM -0400, Martin Blais wrote:
> So for now I've made the docs read-only.
> If you need to comment, I think there might be a way to request comment
> access.
> Otherwise, try the mailing-list...

So, this makes me wonder: given the main argument for having
documentation on Google Docs was the ease of submitting and receiving
user contributions, would you be open to reconsider that decision now?

Thanks for considering,
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/20170806194038.s3u4bz7337s6pjet%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: How do I generate cashflow reports rather than expense reports?

2017-01-24 Thread Stefano Zacchiroli
On Wed, Jan 25, 2017 at 04:05:33AM +0800, Oon-Ee Ng wrote:
> Is there a way to generate reports on cashflow? Probably just
> 'everything that flows out of assets' would suffice at this point?

I'm facing the same problem.

My solution (or, better: "workaround") is to chart not only income vs
expenses over time, but also (in a separate chart) income vs
"expenses+mortgage", where "mortgage" is the amount of debt I pay off
every month for the house mortgage. Of course you can replace "chart"
with "balance" or whatever other query you're doing to obtain similar
results in a different context.

IIRC the proper way to go about that in terms of tool support would be
to tag the accounts that are "cash-ish" for you and that you want to see
in these kind of reports. For me those would be Income:* Expenses:* and
Liabilities:Mortgage:*. On top of that you can add some easy-to-activate
knob that will pre-select those accounts.

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/20170125074545.t4xzhrvqjdx7u7oa%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


  1   2   >