Re: Resetting cash assets (recommendations welcome)

2018-04-03 Thread Zhuoyun Wei
Hi,

I would recommend this:

1. Make a transfer from Assets:Bank to Assets:Cash every time you
withdraw from ATM;
2. Count your money in you wallet from time to time (say, monthly) and
use "balance" directive to assert how many money in your wallet;
3. Insert a "pad" directive one day before the "balance" directive to
automatically generate a transfer from your wallet to your designated
account (e.g. Expenses:RandomStuff) to make the next balance assertion
pass.

I use the similar procedure for a bank investment account which accrues
interest every day. But I don't want to duplicate every interest income
in that account because there are no script-friendly way to export data
from that bank. So I just assert the balance monthly and pad the
difference to "Income:Interest" or something like that.


2018-04-02 21:26:12 Mattijs Hoitink :
> Hi,
> 
> In my ledger I have an asset account for cash set up, used for when I 
> withdraw from an ATM machine for example. However
> I do not keep track of what I spent that money on exactly, I just assume that 
> when it enters the account (my wallet) it
> is spent (from a ledger perspective).
> 
> I'm not interested in keeping track of what I spent it on (I might give some 
> to my wife etc) so I'm looking for ways to
> reset the asset account to empty, otherwise it keeps accumulating. Does 
> anyone have any recommendations for doing this,
> or a particular process?
> 
> Any ideas are welcome!
> 
> cheers,
> mattijs
> 
> --
> 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/
> 1f644a87-adf7-4b2e-b098-b06b46de6077%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


-- 
Zhuoyun Wei

-- 
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/20180403070625.GA17161%40herus.wzyboy.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: Resetting cash assets (recommendations welcome)

2018-04-03 Thread Metin Akat
Yes, IMO this is a much better workflow, as it actually allows you to track
something at all :). Otherwise, why do we bother do do our own, personal
accounting.

On Tue, Apr 3, 2018 at 10:06 AM, Zhuoyun Wei  wrote:

> Hi,
>
> I would recommend this:
>
> 1. Make a transfer from Assets:Bank to Assets:Cash every time you
> withdraw from ATM;
> 2. Count your money in you wallet from time to time (say, monthly) and
> use "balance" directive to assert how many money in your wallet;
> 3. Insert a "pad" directive one day before the "balance" directive to
> automatically generate a transfer from your wallet to your designated
> account (e.g. Expenses:RandomStuff) to make the next balance assertion
> pass.
>
> I use the similar procedure for a bank investment account which accrues
> interest every day. But I don't want to duplicate every interest income
> in that account because there are no script-friendly way to export data
> from that bank. So I just assert the balance monthly and pad the
> difference to "Income:Interest" or something like that.
>
>
> 2018-04-02 21:26:12 Mattijs Hoitink :
> > Hi,
> >
> > In my ledger I have an asset account for cash set up, used for when I
> withdraw from an ATM machine for example. However
> > I do not keep track of what I spent that money on exactly, I just assume
> that when it enters the account (my wallet) it
> > is spent (from a ledger perspective).
> >
> > I'm not interested in keeping track of what I spent it on (I might give
> some to my wife etc) so I'm looking for ways to
> > reset the asset account to empty, otherwise it keeps accumulating. Does
> anyone have any recommendations for doing this,
> > or a particular process?
> >
> > Any ideas are welcome!
> >
> > cheers,
> > mattijs
> >
> > --
> > 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/
> > 1f644a87-adf7-4b2e-b098-b06b46de6077%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
> --
> Zhuoyun Wei
>
> --
> 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/20180403070625.GA17161%40herus.wzyboy.org.
> 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/CAEk80bk0vOsz1Zn3Bg80_PNMF3KUtD8F2FcSCOdRkt%2BKWj0QTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: uncomment-region in beancount emacs (minor) mode

2018-04-03 Thread Stefan Monnier
Martin Blais  writes:

> This is a known bug in the Emacs config.
> It's getting on own nerves regularly actually, just haven't had time to dig
> into fixing this.

Try to add this to beancount-mode:

;; Org-mode sets both of these to `org-comment-or-uncomment-region',
;; which doesn't know about our ";" comments.
(kill-local-variable 'comment-region-function)
(kill-local-variable 'uncomment-region-function)


-- Stefan

-- 
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/jwvin981oi1.fsf-monnier%2Bemacs%40gnu.org.
For more options, visit https://groups.google.com/d/optout.


Re: Reports

2018-04-03 Thread Daniel Clemente
I use bean-report for a few commands, mainly to get the price database, and
all balances.
For most operations I use bean-query or the web interface, which is fast
and reliable.

I don't use Fava and I feel it adds too much complexity. It depends on a
lot of external code that I don't have time to review (I just tried to
count it: npm wants to install 588 packages of JavaScript code!). Running
it inside a sandbox (Docker) is possible but it's harder to set up and this
infrastructure can have other problems.
Fava doesn't have the simplicity that I find in beancount. It also didn't
work without JS when I tried it some years ago (maybe it has improved).

I'd be fine with uglier web pages if they provide the basic accounting
needs. Though they don't need to be ugly.

I also use the holdings code and aggregate_holdings_by, but I could do the
same in some other way or keep the old code.


On Sun, Apr 1, 2018 at 8:53 AM, Martin Blais  wrote:

> How many people here use bean-report as their main way to generate data
> from Beancount?
> How many use bean-web?
> Does anybody still care about bean-web now that Fava exists?
>
> Also... is it possible to bean-bake Fava (or some equivalent creation of a
> static version for sharing)?
>
> Any input appreciated,
>
>
> (Reason I'm asking is: I'm thinking about
> - rewriting the query engine to something more powerful and general, and
> promoting it from experimental and somewhat flaky to the main way of
> getting data out
> - rewriting bean-web to be a dumber, more generic web interface that
> basically renders SQL queries (using the new query engine) without any
> special treatment (just tables and tree-tables)
> - deleting bean-reports and all of beancount/reports, or replacing most of
> it by SQL queries
> - in the process deleting the Holdings code
> Basically, I think that with a slightly improved query engine I could
> delete a ton of code without removing functionality at all.)
>
> --
> 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%2BhPZh%2BRSFNoSDZd3PF%3Dh0ki2Utqv%
> 3Dx%2BC%3D6dQpSiwX7S_ew%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAJKAhPD9qna%2BHq73uXsuw%3DNMqE4%3DdroVpm9cvGd1Fqch0eBhMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reports

2018-04-03 Thread Mattijs Hoitink
hmm, that is unfortunate but makes sense if it's broken. I hadn't noticed 
any issues (yet)

On Monday, April 2, 2018 at 10:26:20 PM UTC-7, Dominik Aumayr wrote:
>
> > Fava has become even easier to use now that it has an electron shell. 
>
> Please note that the Electron shell will go away in the next version: 
> https://github.com/beancount/fava/pull/692 
>
>
> > Am 03.04.2018 um 06:10 schrieb Mattijs Hoitink  >: 
> > 
> > I used bean-report for some simple stuff but never used bean-web, I went 
> straight for fava. Fava has become even easier to use now that it has an 
> electron shell. 
> > 
> > I am interested in a more powerful query language because I'm exploring 
> custom reports for my personal ledger. Something separate that works with 
> beancount and can be built upon sounds like a sweet deal :) 
> > 
> > On Sunday, April 1, 2018 at 8:07:05 PM UTC-7, Martin Blais wrote: 
> > On Sun, Apr 1, 2018 at 2:10 PM, Stefano Zacchiroli  
> wrote: 
> > On Sun, Apr 01, 2018 at 01:53:19AM -0400, Martin Blais wrote: 
> > > - rewriting bean-web to be a dumber, more generic web interface that 
> > > basically renders SQL queries (using the new query engine) without any 
> > > special treatment (just tables and tree-tables) 
> > 
> > Given Fava does that too, and also provides useful reporting out of the 
> > box, would it be worth to have another implementation of the same "web 
> > based bean-query console" thing? (Maybe yes, if, say, you consider that 
> > Fava has too many additional dependencies. Asking just to understand 
> > which design constraints you're considering.) 
> > 
> > It would be different; all the pages would have a single query at the 
> top (which would be visible and which the user could tweak), and rendering 
> would have simple generic rules (e.g. match account name patterns) to 
> create links to e.g. journal pages which, again, would just be queries, but 
> otherwise just render generically (e.g. no special rendering for journals 
> to show postings and such, for instance, which I've always found ugly 
> anyway), even the first version would just render the text in a  tag, 
> really bare bones. The idea is definitely to avoid replicating Fava or 
> bean-web, but instead provide something that's doing 60~80% of that 
> functionality with an incredibly simple implementation (like, one file, 
> calling out to bean-query library code). Basically, a web-based interface 
> to a more powerful and generic bean-query. 
> > 
> > Now the twist in the plot: bean-query itself would expand in scope to go 
> beyond Beancount. I'm thinking of generalizing this to make it a row-based 
> (slow) query engine on in-memory tables, something that would be used akin 
> to the "re" library, and that would fit in the space that Pandas is 
> currently in, as well as supporting various input data formats (e.g. you 
> could use it to make queries on a CSV table, for example, or on a 
> filesystem directory, or e.g. on the EXIF files of a list of JPEG files, 
> whatever data sources are implemented, I can imagine many). It would be a 
> generic library that you could instantiate and customize to provide 
> SQL-like functionality to any (Python) program. It would be extensible 
> (allowing you to add new datatypes and control the set of available 
> functions), and Beancount would basically become its first use case of 
> customization (providing Amount, Position and Inventory data types and 
> associated aggregation functions, and a few data sources/tables, 
> "transactions" being the main one, but also one table type for each other 
> directive, e.g. "commodities", etc.). It would support joins and structured 
> fields (e.g. so you could join with per-commodity or per-account metadata, 
> to implement e.g. your own section categorization), and it would provide a 
> command-line tool (to fill in those cases where awk leaves you wanting), 
> but also find a lot of usage from within Python as a library (e.g., like 
> one uses Pandas, on in-memory data tables). It would automatically infer 
> schemas by e.g. looking at the contents of a CSV file, you can usually 
> automatically infer the data types and column names from the header, so it 
> would become an ultimate CSV manipulation tool (I've surveyed the other 
> ones out there, what I've seen falls short of what I'd like to have). 
> Personally I think this could make general data manipulation easier than 
> many of the libraries out there (e.g. Pandas), at least for those cases 
> where performance isn't a concern (simplistic row-based implementation, at 
> least at first) and doing aggregations and pivots and such isn't as easy 
> with just the unix tools than what you can do in a single SQL expression. I 
> spent some time in the past prototyping something like this using sqlite3 - 
> it looks like it's designed to be extensible - but it has proved too 
> difficult and not customizable enough to replace bean-query, we still need 
> something a more customizable

Re: Issue #257: Create a section classifier for new transactions (blais/beancount)

2018-04-03 Thread 'Patrick Ruckstuhl' via Beancount
I think the date might actually have a meaning. E.g. if you split files by year 
you might have one marker in one file and another in the other and based on the 
date of the transaction it should go to the right one.

On March 31, 2018 5:59:40 AM GMT+02:00, Martin Blais  wrote:
>On Fri, Mar 30, 2018 at 8:22 AM, Dominik Aumayr 
>wrote:
>
>> I think that could be very useful. I think there needs to be some
>> discussion about the syntax before you start implementing.
>>
>> Would it look like this?
>>
>> ```beancount
>>
>> 2018-03-30 * "Hooli Shop" "Buy hoodie"
>>Expenses:Fashion10.00 USD
>>Assets:Cash
>>
>> marker Assets:US:*
>>
>> 2018-03-31 * "Walgreens" "Groceries"
>>Expenses:Groceries45.00 USD
>>Assets:US:BoA:Checking
>>
>> ```
>
>
>Hmm, the few non-directive keywords I have at the moment don't have
>proper
>metadata (e.g. line number).
>I was thinking of making it a directive instead.
>e.g.
>
>2018-03-30 marker "...any string..."
>
>The date has no meaning (but it you can think of a useful meaning I can
>add
>one.)
>
>Also, the account name that's there, how is it used? Would it not be
>more
>general to make it a general string?
>
>
>
>
>>
>> > Am 28.03.2018 um 04:22 schrieb Martin Blais :
>> >
>> > I could promote the custom entry as a native one.
>> > Let's call it "marker".
>> > Would that be useful?
>> >
>> >
>> > On Tue, Mar 27, 2018 at 2:04 AM,
>
>> wrote:
>> > Fava has such a feature (and code), see the "insert-entry"-option
>here:
>> https://fava.pythonanywhere.com/example-with-budgets/help/options/
>> >
>> > Basically it works like this: You can add custom "insert-entry"
>entries
>> with a RegEx, and when adding a transaction, the position where it
>should
>> go in the file is determined by those custom entries.
>> >
>> > Am Montag, 26. März 2018 22:39:48 UTC+2 schrieb Martin Blais:
>> > New issue 257: Create a section classifier for new transactions
>> > https://bitbucket.org/blais/beancount/issues/257/create-a-
>> section-classifier-for-new
>> >
>> > Martin Blais:
>> >
>> > There's nothing like that in the Beancount codebase. I've thought
>about
>> building something to automatically insert imported transactions in
>the
>> right "section" (I personally use org-mode, where each section
>corresponds
>> to an institution and its related group of accounts) but it's unclear
>> whether that would generalize.
>> >
>> > I think you could turn this into a simple classification problem.
>Given
>> some syntax for splitting up an input file into sections (e.g., some
>> regular expression matching on a title or separator), you now have
>groups
>> of transactions and inputs. Somehow reduce this to a simple model for
>> classifying which section an incoming transaction matches with
>highest
>> probability and insert it there. Or more appropriately - since
>transactions
>> are imported in groups - find the section that best matches all the
>> transactions in the imported files and insert at the end there.
>> >
>> >
>> > On Sun, Mar 11, 2018 at 12:28 PM, Michael Droogleever
>
>> wrote:
>> > I believe it is against the design of beancount, but is there any
>> existing code which attempts to add transactions to an existing
>beancount
>> file. Assuming the entries in the file are grouped by asset account,
>it
>> would need to append the entry to the subsection of entries all from
>the
>> same account.
>> >
>> > Responsible: blais
>> >
>> > --
>> > 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/4694718a-6afc-4346-80de-c7c78bd87de6%40googlegroups.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Beancount" group.
>> > To unsubscribe from this group and stop receiving emails from it,
>send
>> an email to beancount+unsubscr...@googlegroups.com.
>> > To post to this group, send email to beancount@googlegroups.com.
>> > To view this discussion on the web visit
>https://groups.google.com/d/
>>
>msgid/beancount/CAK21%2BhMKca%3DWb8Jv45k9tHWHZ%2Bv2vbsG14yXtq4RyC6M9tB1mg%
>> 40mail.gmail.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google
>Groups
>> "Beancount" group.
>> To unsubscribe from this group and stop receiving emails from it,
>send an
>> email to beancount+unsubscr...@googlegroups.com.
>> To post to this group, send email to beancount@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/beancount/B436BAF8-B56D-4FED-B9A1-F1B408AE6BD1%40aumayr.name.
>> For more options, visit https://gr

Re: CI [Was: moving to GitHub?]

2018-04-03 Thread Jakob Schnitzer
I think one thing CI adds is a certain reproducibility. I can remember 
having the full Beancount test suite pass exactly once (after I 
submitted a PR fixing some broken tests). Having a test suite that 
doesn't fully pass (fully passing on just the main developer's computer 
doesn't count IMHO), when new to a project this to me sends a message 
'this project doesn't care too much about tests'. From the mailing list 
and the quality of code and tests I of course know this to be false - 
having a frequent CI build could still help with obtaining (and keeping) 
a more reproducible test suite (and make the standard of tests clear to 
potential contributors).


With regards to linting, I'm not sure what the standard is (`make lint`) 
fails with a staggering list of 'errors'. Again, having a CI build would 
more clearly communicate the expected standard with regards to linting.


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)


On Sat, Mar 31, 2018 at 5:02 AM, Stefano Zacchiroli  wrote:


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.



--
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%2BhPNHd3EUyDN%2B6Wsqx127qXu8bZXM0xiKLepVNN8yRRCsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20180331174637.GA6277%40js-arch.
For more options, visit https://groups.google.com/d/optout.


Re: Issue #257: Create a section classifier for new transactions (blais/beancount)

2018-04-03 Thread Jakob Schnitzer

On Fri, Mar 30, 2018 at 11:59:40PM -0400, Martin Blais wrote:

On Fri, Mar 30, 2018 at 8:22 AM, Dominik Aumayr  wrote:


I think that could be very useful. I think there needs to be some
discussion about the syntax before you start implementing.

Would it look like this?

```beancount

2018-03-30 * "Hooli Shop" "Buy hoodie"
   Expenses:Fashion10.00 USD
   Assets:Cash

marker Assets:US:*

2018-03-31 * "Walgreens" "Groceries"
   Expenses:Groceries45.00 USD
   Assets:US:BoA:Checking

```



Hmm, the few non-directive keywords I have at the moment don't have proper
metadata (e.g. line number).
I was thinking of making it a directive instead.
e.g.

2018-03-30 marker "...any string..."

The date has no meaning (but it you can think of a useful meaning I can add
one.)

Also, the account name that's there, how is it used? Would it not be more
general to make it a general string?


Why not just have them as options? Since the parser, which validates the 
options, has access to the line number, it shouldn't be hard to store 
the line numbers.


The dates are currently used (see below), but I think it would be better 
without them - the current mechanism really only works well for the 
"insert the latest entries at the end of a section" scenario. Inserting 
earlier entries than some already in the section would create an 
unordered mess.


This is the documentation for the current 'insert-entry' fava-option.

This option can be used to specify where entries are inserted. The 
argument to this option should be a regular expression matching account 
names. This option can be given multiple times. When adding an entry, 
the account of the entry (for a transaction, the account of the last 
posting is used) is matched against all insert-entry options and the 
entry will be inserted before the datewise latest of the matching 
options. If the entry is a Transaction and no insert-entry option 
matches the account of the last posting the account of the second to 
last posting and so on will be tried. If no insert-entry option matches 
or none is given, the entry will be inserted at the end of the main 
file.








> Am 28.03.2018 um 04:22 schrieb Martin Blais :
>
> I could promote the custom entry as a native one.
> Let's call it "marker".
> Would that be useful?
>
>
> On Tue, Mar 27, 2018 at 2:04 AM, 
wrote:
> Fava has such a feature (and code), see the "insert-entry"-option here:
https://fava.pythonanywhere.com/example-with-budgets/help/options/
>
> Basically it works like this: You can add custom "insert-entry" entries
with a RegEx, and when adding a transaction, the position where it should
go in the file is determined by those custom entries.
>
> Am Montag, 26. März 2018 22:39:48 UTC+2 schrieb Martin Blais:
> New issue 257: Create a section classifier for new transactions
> https://bitbucket.org/blais/beancount/issues/257/create-a-
section-classifier-for-new
>
> Martin Blais:
>
> There's nothing like that in the Beancount codebase. I've thought about
building something to automatically insert imported transactions in the
right "section" (I personally use org-mode, where each section corresponds
to an institution and its related group of accounts) but it's unclear
whether that would generalize.
>
> I think you could turn this into a simple classification problem. Given
some syntax for splitting up an input file into sections (e.g., some
regular expression matching on a title or separator), you now have groups
of transactions and inputs. Somehow reduce this to a simple model for
classifying which section an incoming transaction matches with highest
probability and insert it there. Or more appropriately - since transactions
are imported in groups - find the section that best matches all the
transactions in the imported files and insert at the end there.
>
>
> On Sun, Mar 11, 2018 at 12:28 PM, Michael Droogleever 
wrote:
> I believe it is against the design of beancount, but is there any
existing code which attempts to add transactions to an existing beancount
file. Assuming the entries in the file are grouped by asset account, it
would need to append the entry to the subsection of entries all from the
same account.
>
> Responsible: blais
>
> --
> 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/4694718a-6afc-4346-80de-c7c78bd87de6%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google
Groups "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send
an email to beancount+unsubscr...@googlegroups.com.
> To post to this group, send email to beancount@googlegro

Issue #268: 'pushtag' does not work with include (blais/beancount)

2018-04-03 Thread Carbo Kuo
New issue 268: 'pushtag' does not work with include
https://bitbucket.org/blais/beancount/issues/268/pushtag-does-not-work-with-include

Carbo Kuo:

For example:

```
#!yaml

pushtag #tag1
include 'another_file'
poptag #tag1
```

Expected behavior: all transactions in 'another_file' are tagged with #tag1

Actual behavior: no transaction is in 'another_file' tagged


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


Re: Resetting cash assets (recommendations welcome)

2018-04-03 Thread Mattijs Hoitink
Thank you for this suggestion, it makes total sense and works perfectly for 
my situation.

On Tuesday, April 3, 2018 at 12:06:32 AM UTC-7, Zhuoyun Wei wrote:
>
> Hi, 
>
> I would recommend this: 
>
> 1. Make a transfer from Assets:Bank to Assets:Cash every time you 
> withdraw from ATM; 
> 2. Count your money in you wallet from time to time (say, monthly) and 
> use "balance" directive to assert how many money in your wallet; 
> 3. Insert a "pad" directive one day before the "balance" directive to 
> automatically generate a transfer from your wallet to your designated 
> account (e.g. Expenses:RandomStuff) to make the next balance assertion 
> pass. 
>
> I use the similar procedure for a bank investment account which accrues 
> interest every day. But I don't want to duplicate every interest income 
> in that account because there are no script-friendly way to export data 
> from that bank. So I just assert the balance monthly and pad the 
> difference to "Income:Interest" or something like that. 
>
>
> 2018-04-02 21:26:12 Mattijs Hoitink >: 
> > Hi, 
> > 
> > In my ledger I have an asset account for cash set up, used for when I 
> withdraw from an ATM machine for example. However 
> > I do not keep track of what I spent that money on exactly, I just assume 
> that when it enters the account (my wallet) it 
> > is spent (from a ledger perspective). 
> > 
> > I'm not interested in keeping track of what I spent it on (I might give 
> some to my wife etc) so I'm looking for ways to 
> > reset the asset account to empty, otherwise it keeps accumulating. Does 
> anyone have any recommendations for doing this, 
> > or a particular process? 
> > 
> > Any ideas are welcome! 
> > 
> > cheers, 
> > mattijs 
> > 
> > -- 
> > 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+...@googlegroups.com . 
> > To post to this group, send email to bean...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/beancount/ 
> > 1f644a87-adf7-4b2e-b098-b06b46de6077%40googlegroups.com. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
> -- 
> Zhuoyun Wei 
>

-- 
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/daf2424e-a73c-4c05-8aa7-39eda7eb814c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Resetting cash assets (recommendations welcome)

2018-04-03 Thread Mattijs Hoitink

>
> Otherwise, why do we bother do do our own, personal accounting.
>

That's a very broad statement. I do 99% of my transactions using bank or 
credit cards so that is the reason I'm interested in personal accounting. 
I'm interested in the money leaving my bank and entering my wallet but not 
really what it is spent on after that since it's such small amounts in the 
overall picture. Some months I don't even use cash at all. It's also very 
time consuming to track the cash and what it is spent on, especially if it 
is handed to other family members and there are no receipts. So a general 
estimate of when it is used and how much is left is perfect, like Zhuoyun 
Wei suggested.

On Tuesday, April 3, 2018 at 12:47:14 AM UTC-7, Metin Akat wrote:
>
> Yes, IMO this is a much better workflow, as it actually allows you to 
> track something at all :). Otherwise, why do we bother do do our own, 
> personal accounting.
>
> On Tue, Apr 3, 2018 at 10:06 AM, Zhuoyun Wei  > wrote:
>
>> Hi,
>>
>> I would recommend this:
>>
>> 1. Make a transfer from Assets:Bank to Assets:Cash every time you
>> withdraw from ATM;
>> 2. Count your money in you wallet from time to time (say, monthly) and
>> use "balance" directive to assert how many money in your wallet;
>> 3. Insert a "pad" directive one day before the "balance" directive to
>> automatically generate a transfer from your wallet to your designated
>> account (e.g. Expenses:RandomStuff) to make the next balance assertion
>> pass.
>>
>> I use the similar procedure for a bank investment account which accrues
>> interest every day. But I don't want to duplicate every interest income
>> in that account because there are no script-friendly way to export data
>> from that bank. So I just assert the balance monthly and pad the
>> difference to "Income:Interest" or something like that.
>>
>>
>> 2018-04-02 21:26:12 Mattijs Hoitink >:
>> > Hi,
>> >
>> > In my ledger I have an asset account for cash set up, used for when I 
>> withdraw from an ATM machine for example. However
>> > I do not keep track of what I spent that money on exactly, I just 
>> assume that when it enters the account (my wallet) it
>> > is spent (from a ledger perspective).
>> >
>> > I'm not interested in keeping track of what I spent it on (I might give 
>> some to my wife etc) so I'm looking for ways to
>> > reset the asset account to empty, otherwise it keeps accumulating. Does 
>> anyone have any recommendations for doing this,
>> > or a particular process?
>> >
>> > Any ideas are welcome!
>> >
>> > cheers,
>> > mattijs
>> >
>> > --
>> > 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+...@googlegroups.com .
>> > To post to this group, send email to bean...@googlegroups.com 
>> .
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/
>> > 1f644a87-adf7-4b2e-b098-b06b46de6077%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> Zhuoyun Wei
>>
>> --
>> 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+...@googlegroups.com .
>> To post to this group, send email to bean...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/20180403070625.GA17161%40herus.wzyboy.org
>> .
>> 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/7373ba25-1d98-438b-ba9e-6837bb0e7963%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: fava in a public server

2018-04-03 Thread Martin Michlmayr
* Jason Chu  [2017-12-06 17:03]:
> I still have a document to write that explains how I set all this stuff up,
> but as was pointed out by yegle, I use oauth2_proxy and letsencrypt to
> protect access to my publicly addressable fava instance.

Did you ever got around to documenting this?

-- 
Martin Michlmayr
http://www.cyrius.com/

-- 
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/20180403215542.j4a24v7ngel72oec%40jirafa.cyrius.com.
For more options, visit https://groups.google.com/d/optout.


Re: fava in a public server

2018-04-03 Thread Jason Chu
I never ended up documenting it. I still mean to, but I wish things weren't
held up on me, given how little free time I have.

On Tue, Apr 3, 2018 at 2:55 PM Martin Michlmayr  wrote:

> * Jason Chu  [2017-12-06 17:03]:
> > I still have a document to write that explains how I set all this stuff
> up,
> > but as was pointed out by yegle, I use oauth2_proxy and letsencrypt to
> > protect access to my publicly addressable fava instance.
>
> Did you ever got around to documenting this?
>
> --
> Martin Michlmayr
> http://www.cyrius.com/
>

-- 
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/CAFFHUgtscpWZedAVYjj8nN5QeerVC1HQ13AOBRD9_zsoNYF26g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: uncomment-region in beancount emacs (minor) mode

2018-04-03 Thread Martin Blais
Thanks Stefan,
https://bitbucket.org/blais/beancount/commits/3213755b4bfc2cd2d1891fd0edb17b
141c1d3173



On Tue, Apr 3, 2018 at 8:09 AM, Stefan Monnier 
wrote:

> Martin Blais  writes:
>
> > This is a known bug in the Emacs config.
> > It's getting on own nerves regularly actually, just haven't had time to
> dig
> > into fixing this.
>
> Try to add this to beancount-mode:
>
> ;; Org-mode sets both of these to `org-comment-or-uncomment-region',
> ;; which doesn't know about our ";" comments.
> (kill-local-variable 'comment-region-function)
> (kill-local-variable 'uncomment-region-function)
>
>
> -- Stefan
>

-- 
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%2BhPVZ4uwtcoXmuLhHcKt1wMAnu0b1M0eE6swjYHU46jrjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: CI [Was: moving to GitHub?]

2018-04-03 Thread Martin Blais
I love CI. CI is good. I'll try enabling Atlassian's pipelines thing, see
if it works. In the past I've worked with buildbot. We should indeed have a
working build status on a minimal Docker install somewhere.


On Sat, Mar 31, 2018 at 1:46 PM, Jakob Schnitzer 
wrote:

> I think one thing CI adds is a certain reproducibility. I can remember
> having the full Beancount test suite pass exactly once (after I submitted a
> PR fixing some broken tests). Having a test suite that doesn't fully pass
> (fully passing on just the main developer's computer doesn't count IMHO),
> when new to a project this to me sends a message 'this project doesn't care
> too much about tests'. From the mailing list and the quality of code and
> tests I of course know this to be false - having a frequent CI build could
> still help with obtaining (and keeping) a more reproducible test suite (and
> make the standard of tests clear to potential contributors).
>
> With regards to linting, I'm not sure what the standard is (`make lint`)
> fails with a staggering list of 'errors'. Again, having a CI build would
> more clearly communicate the expected standard with regards to linting.
>
> 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)
>>
>>
>> On Sat, Mar 31, 2018 at 5:02 AM, Stefano Zacchiroli 
>> wrote:
>>
>> 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.
>>>
>>>
>> --
>> 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/ms
>> gid/beancount/CAK21%2BhPNHd3EUyDN%2B6Wsqx127qXu8bZXM0xiKLepV
>> NN8yRRCsQ%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beancount+unsubscr...@googlegroups.com.
> To post to this group, send email to beancount@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/beancount/20180331174637.GA6277%40js-arch.
>
> For more options, visit https://groups.google.com/d/optout.
>


Issue #269: Enable a CI solution; try Atlassian's Pipelines (blais/beancount)

2018-04-03 Thread Martin Blais
New issue 269: Enable a CI solution; try Atlassian's Pipelines
https://bitbucket.org/blais/beancount/issues/269/enable-a-ci-solution-try-atlassians

Martin Blais:

Enable a CI solution; try Atlassian's Pipelines

Responsible: blais

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


Re: CI [Was: moving to GitHub?]

2018-04-03 Thread Martin Blais
https://bitbucket.org/blais/beancount/issues/269/enable-a-ci-solution-try-atlassians

On Tue, Apr 3, 2018 at 8:35 PM, Martin Blais  wrote:

> I love CI. CI is good. I'll try enabling Atlassian's pipelines thing, see
> if it works. In the past I've worked with buildbot. We should indeed have a
> working build status on a minimal Docker install somewhere.
>
>
> On Sat, Mar 31, 2018 at 1:46 PM, Jakob Schnitzer 
> wrote:
>
>> I think one thing CI adds is a certain reproducibility. I can remember
>> having the full Beancount test suite pass exactly once (after I submitted a
>> PR fixing some broken tests). Having a test suite that doesn't fully pass
>> (fully passing on just the main developer's computer doesn't count IMHO),
>> when new to a project this to me sends a message 'this project doesn't care
>> too much about tests'. From the mailing list and the quality of code and
>> tests I of course know this to be false - having a frequent CI build could
>> still help with obtaining (and keeping) a more reproducible test suite (and
>> make the standard of tests clear to potential contributors).
>>
>> With regards to linting, I'm not sure what the standard is (`make lint`)
>> fails with a staggering list of 'errors'. Again, having a CI build would
>> more clearly communicate the expected standard with regards to linting.
>>
>> 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)
>>>
>>>
>>> On Sat, Mar 31, 2018 at 5:02 AM, Stefano Zacchiroli 
>>> wrote:
>>>
>>> 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.


>>> --
>>> 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/ms
>>> gid/beancount/CAK21%2BhPNHd3EUyDN%2B6Wsqx127qXu8bZXM0xiKLepV
>>> NN8yRRCsQ%40mail.gmail.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Beancount" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to beancount+unsubscr...@googlegroups.com.
>

Re: Reports

2018-04-03 Thread Martin Blais
On Tue, Apr 3, 2018 at 12:10 AM, Mattijs Hoitink 
wrote:

> I used bean-report for some simple stuff but never used bean-web, I went
> straight for fava. Fava has become even easier to use now that it has an
> electron shell.
>
> I am interested in a more powerful query language because I'm exploring
> custom reports for my personal ledger. Something separate that works with
> beancount and can be built upon sounds like a sweet deal :)
>

To iterate on that: I would definitely make that new thing as minimal (and
minimal-looking so) as possible so it doesn't "compete" attention with a
full-fledged web front-end like Fava. In fact, I would expect that Fava
would eventually integrate some of that functionality, e.g., adding a page
with a query at the top and doing a generic rendering of the results.





> On Sunday, April 1, 2018 at 8:07:05 PM UTC-7, Martin Blais wrote:
>>
>> On Sun, Apr 1, 2018 at 2:10 PM, Stefano Zacchiroli 
>> wrote:
>>
>>> On Sun, Apr 01, 2018 at 01:53:19AM -0400, Martin Blais wrote:
>>> > - rewriting bean-web to be a dumber, more generic web interface that
>>> > basically renders SQL queries (using the new query engine) without any
>>> > special treatment (just tables and tree-tables)
>>>
>>> Given Fava does that too, and also provides useful reporting out of the
>>> box, would it be worth to have another implementation of the same "web
>>> based bean-query console" thing? (Maybe yes, if, say, you consider that
>>> Fava has too many additional dependencies. Asking just to understand
>>> which design constraints you're considering.)
>>>
>>
>> It would be different; all the pages would have a single query at the top
>> (which would be visible and which the user could tweak), and rendering
>> would have simple generic rules (e.g. match account name patterns) to
>> create links to e.g. journal pages which, again, would just be queries, but
>> otherwise just render generically (e.g. no special rendering for journals
>> to show postings and such, for instance, which I've always found ugly
>> anyway), even the first version would just render the text in a  tag,
>> really bare bones. The idea is definitely to avoid replicating Fava or
>> bean-web, but instead provide something that's doing 60~80% of that
>> functionality with an incredibly simple implementation (like, one file,
>> calling out to bean-query library code). Basically, a web-based interface
>> to a more powerful and generic bean-query.
>>
>> Now the twist in the plot: bean-query itself would expand in scope to go
>> beyond Beancount. I'm thinking of generalizing this to make it a row-based
>> (slow) query engine on in-memory tables, something that would be used akin
>> to the "re" library, and that would fit in the space that Pandas is
>> currently in, as well as supporting various input data formats (e.g. you
>> could use it to make queries on a CSV table, for example, or on a
>> filesystem directory, or e.g. on the EXIF files of a list of JPEG files,
>> whatever data sources are implemented, I can imagine many). It would be a
>> generic library that you could instantiate and customize to provide
>> SQL-like functionality to any (Python) program. It would be extensible
>> (allowing you to add new datatypes and control the set of available
>> functions), and Beancount would basically become its first use case of
>> customization (providing Amount, Position and Inventory data types and
>> associated aggregation functions, and a few data sources/tables,
>> "transactions" being the main one, but also one table type for each other
>> directive, e.g. "commodities", etc.). It would support joins and structured
>> fields (e.g. so you could join with per-commodity or per-account metadata,
>> to implement e.g. your own section categorization), and it would provide a
>> command-line tool (to fill in those cases where awk leaves you wanting),
>> but also find a lot of usage from within Python as a library (e.g., like
>> one uses Pandas, on in-memory data tables). It would automatically infer
>> schemas by e.g. looking at the contents of a CSV file, you can usually
>> automatically infer the data types and column names from the header, so it
>> would become an ultimate CSV manipulation tool (I've surveyed the other
>> ones out there, what I've seen falls short of what I'd like to have).
>> Personally I think this could make general data manipulation easier than
>> many of the libraries out there (e.g. Pandas), at least for those cases
>> where performance isn't a concern (simplistic row-based implementation, at
>> least at first) and doing aggregations and pivots and such isn't as easy
>> with just the unix tools than what you can do in a single SQL expression. I
>> spent some time in the past prototyping something like this using sqlite3 -
>> it looks like it's designed to be extensible - but it has proved too
>> difficult and not customizable enough to replace bean-query, we still need
>> something a more customizable than what this offers.

New importers for Yahoo, IEX and Quandl are live

2018-04-03 Thread Martin Blais
Dear Beancounterers,

I've been busy attending to user tickets lately.
https://bitbucket.org/blais/beancount/src/4a3995617e7df5ffa3377711382c7ad2f9d8935b/CHANGES?at=default&fileviewer=file-view-default

In the process I fixed the importer situation:
- I rewrote the Yahoo price source to the v7/v8 APIs, it should work again.
- I wrote a brand new importer from IEX, which has a really nice free API.
- Hugo Ideler pointed out the existence of Quandl (thank you!), and I wrote
an importer for its simple REST API (not all content is free, but a good
amount of it is).

I hope this is useful to some of you.
Let me know if you encounter any problems.
Cheers,

-- 
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%2BhPZNUZhfJHwvVVbVUSk4LThVWaERMA%3DYdfoqq9QWws75Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implicit rounding of inferred numbers

2018-04-03 Thread Martin Blais
This is correct.

First, the PRINT command of the shell (which is what I believe you're
using) will render the numbers at their stored precision:
https://bitbucket.org/blais/beancount/src/4a3995617e7df5ffa3377711382c7ad2f9d8935b/beancount/query/query_execute.py?at=default&fileviewer=file-view-default#query_execute.py-92

I kept it this way originally because PRINT was intended for debugging, so
rounding using the most common precision seen in the file seemed it would
create problems with interpreting the data.  I'm not 100% this was the
right choice.

Second, about rounding: by default the tolerance used is that which is
inferred on the transaction:
https://bitbucket.org/blais/beancount/src/4a3995617e7df5ffa3377711382c7ad2f9d8935b/beancount/core/interpolate.py?at=default&fileviewer=file-view-default#interpolate.py-324

The comment you're referring to applies to the case where a tolerance
cannot be inferred at all (like in the first example in that section). In
that case, no rounding occurs. I'll clarify the docs.

(This hurts my head too.)




On Sun, Apr 1, 2018 at 5:13 AM, Zhuoyun Wei  wrote:

> Hi Martin,
>
> Beancount seems to round inferred numbers by default:
>
> 1970-01-01 open Assets:Cash
> 1970-01-01 open Assets:Positions
> 1970-01-01 open Expenses:Financial:Commissions
>
> 2018-03-29 * "Buy 10 BILI"
>   Assets:Cash
>   Assets:Positions 10 BILI {11.4899 USD, 2018-03-29} @
> 11.4899 USD
>   Expenses:Financial:Commissions  0.1 USD
>
> turns into:
>
> 2018-03-29 * "Buy 10 BILI"
>   Assets:Cash -115.0 USD
>   Assets:Positions10 BILI {11.4899 USD, 2018-03-29} @
> 11.4899 USD
>   Expenses:Financial:Commissions 0.1 USD
>
> The full-precision number for Assets:Cash should be -114.9990 USD, but
> it was incorrectly rounded to -115.0 USD.
>
> In the documentation
> https://docs.google.com/document/d/1lgHxUUEY-UVEgoF6cupz2f_
> 7v7vEF7fiJyiSlYYlhOo/
> section "Precision of Inferred Numbers":
>
> > If the default tolerance is not overridden in the input file—and
> > therefore is zero—the full precision will be used; no rounding occurs.
>
> In the minimal example above, the precision seems to be inferred from
> 0.1 USD commission. If I change the input file, changing commission from
> 0.1 USD to 0.1000 USD, the output is correct:
>
> 2018-03-29 * "Buy 10 BILI"
>   Assets:Cash -114.9990 USD
>   Assets:Positions   10 BILI {11.4899 USD, 2018-03-29}
> @ 11.4899 USD
>   Expenses:Financial:Commissions 0.1000 USD
>
> My broker-dealer returns the commission as 0.1 USD because it is a
> floating point number in JSON (you cannot end numbers with zeros). But
> behind the scenes it calculates the cash balance with the full-precision
> numbers (e.g. 0.1000 USD). After a few transactions, the balance of
> Assets:Cash has a difference of more than 0.005 USD with the
> broker-dealer and thus fails the balance assertion.
>
> Is there a way to turn off the implicit rounding without padding 0.1 USD
> to 0.1000 USD in the input file?
>
> I am using tagged release 2.0.0.
>
>
> --
> Zhuoyun Wei
>
> --
> 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/20180401091341.GA26139%40tarball.wzyboy.org.
> 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%2BhPeexbubq8dEjvYOYuKd1tMOXh36CuByWPAG_yJa%3Df7zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Issue #270: bean-doctor context renders precision not like PRINT (blais/beancount)

2018-04-03 Thread Martin Blais
New issue 270: bean-doctor context renders precision not like PRINT
https://bitbucket.org/blais/beancount/issues/270/bean-doctor-context-renders-precision-not

Martin Blais:

PRINT uses the natural precision for the digits
bean-doctor context does not (but it presents the total after a comment)

I don't like this, this seems inconsistent. Reconcile this.

Responsible: blais

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


Re: Reports

2018-04-03 Thread Dominik Aumayr
> In fact, I would expect that Fava would eventually integrate some of that 
> functionality, e.g., adding a page with a query at the top and doing a 
> generic rendering of the results.

Fava does this already, see the "Query" page in the sidebar. 


> Am 04.04.2018 um 02:46 schrieb Martin Blais :
> 
> On Tue, Apr 3, 2018 at 12:10 AM, Mattijs Hoitink  
> wrote:
> I used bean-report for some simple stuff but never used bean-web, I went 
> straight for fava. Fava has become even easier to use now that it has an 
> electron shell.
> 
> I am interested in a more powerful query language because I'm exploring 
> custom reports for my personal ledger. Something separate that works with 
> beancount and can be built upon sounds like a sweet deal :)
> 
> To iterate on that: I would definitely make that new thing as minimal (and 
> minimal-looking so) as possible so it doesn't "compete" attention with a 
> full-fledged web front-end like Fava. In fact, I would expect that Fava would 
> eventually integrate some of that functionality, e.g., adding a page with a 
> query at the top and doing a generic rendering of the results.
> 
> 
> 
>  
> On Sunday, April 1, 2018 at 8:07:05 PM UTC-7, Martin Blais wrote:
> On Sun, Apr 1, 2018 at 2:10 PM, Stefano Zacchiroli  wrote:
> On Sun, Apr 01, 2018 at 01:53:19AM -0400, Martin Blais wrote:
> > - rewriting bean-web to be a dumber, more generic web interface that
> > basically renders SQL queries (using the new query engine) without any
> > special treatment (just tables and tree-tables)
> 
> Given Fava does that too, and also provides useful reporting out of the
> box, would it be worth to have another implementation of the same "web
> based bean-query console" thing? (Maybe yes, if, say, you consider that
> Fava has too many additional dependencies. Asking just to understand
> which design constraints you're considering.)
> 
> It would be different; all the pages would have a single query at the top 
> (which would be visible and which the user could tweak), and rendering would 
> have simple generic rules (e.g. match account name patterns) to create links 
> to e.g. journal pages which, again, would just be queries, but otherwise just 
> render generically (e.g. no special rendering for journals to show postings 
> and such, for instance, which I've always found ugly anyway), even the first 
> version would just render the text in a  tag, really bare bones. The 
> idea is definitely to avoid replicating Fava or bean-web, but instead provide 
> something that's doing 60~80% of that functionality with an incredibly simple 
> implementation (like, one file, calling out to bean-query library code). 
> Basically, a web-based interface to a more powerful and generic bean-query.
> 
> Now the twist in the plot: bean-query itself would expand in scope to go 
> beyond Beancount. I'm thinking of generalizing this to make it a row-based 
> (slow) query engine on in-memory tables, something that would be used akin to 
> the "re" library, and that would fit in the space that Pandas is currently 
> in, as well as supporting various input data formats (e.g. you could use it 
> to make queries on a CSV table, for example, or on a filesystem directory, or 
> e.g. on the EXIF files of a list of JPEG files, whatever data sources are 
> implemented, I can imagine many). It would be a generic library that you 
> could instantiate and customize to provide SQL-like functionality to any 
> (Python) program. It would be extensible (allowing you to add new datatypes 
> and control the set of available functions), and Beancount would basically 
> become its first use case of customization (providing Amount, Position and 
> Inventory data types and associated aggregation functions, and a few data 
> sources/tables, "transactions" being the main one, but also one table type 
> for each other directive, e.g. "commodities", etc.). It would support joins 
> and structured fields (e.g. so you could join with per-commodity or 
> per-account metadata, to implement e.g. your own section categorization), and 
> it would provide a command-line tool (to fill in those cases where awk leaves 
> you wanting), but also find a lot of usage from within Python as a library 
> (e.g., like one uses Pandas, on in-memory data tables). It would 
> automatically infer schemas by e.g. looking at the contents of a CSV file, 
> you can usually automatically infer the data types and column names from the 
> header, so it would become an ultimate CSV manipulation tool (I've surveyed 
> the other ones out there, what I've seen falls short of what I'd like to 
> have). Personally I think this could make general data manipulation easier 
> than many of the libraries out there (e.g. Pandas), at least for those cases 
> where performance isn't a concern (simplistic row-based implementation, at 
> least at first) and doing aggregations and pivots and such isn't as easy with 
> just the unix tools than what you can do in a single SQL expres

Re: fava in a public server

2018-04-03 Thread Stefano Zacchiroli
On Tue, Apr 03, 2018 at 10:35:26PM +, Jason Chu wrote:
> I never ended up documenting it. I still mean to, but I wish things weren't
> held up on me, given how little free time I have.

FTR the documentation which I contributed to setup Fava with
ReverseProxy with Apache was removed from Fava because it didn't show
auth/ssl (that in turn because I do auth/ssl at a different level in my
web server) and they didn't want to have something potentially insecure
as the only piece of deployment doc --- totally understandable.  Hence,
having additional examples with other technologies / different setup
would help in having more deployment doc.

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


Re: Implicit rounding of inferred numbers

2018-04-03 Thread Zhuoyun Wei
Thanks for explaination.

It seems that the implicit rounding occurs not only in "PRINT", but also
has effect on balance calculation:


1970-01-01 open Assets:Cash
1970-01-01 open Assets:Positions
1970-01-01 open Expenses:Financial:Commissions

2018-03-29 * "Buy 10 BILI"
  Assets:Cash
  Assets:Positions 10 BILI {11.4899 USD, 2018-03-29} @ 11.4899 
USD
  Expenses:Financial:Commissions  0.1 USD

2018-04-01 balance Assets:Cash -114.9990 USD


The last balance assertion fails:


Balance failed for 'Assets:Cash': expected -114.9990 USD != accumulated -115.0 
USD (0.0010 too little)


Is there a way to turn off the implicit rounding without padding 0.1 USD
to 0.1000 USD?




2018-04-04 01:53:19 Martin Blais :
> This is correct.
> 
> First, the PRINT command of the shell (which is what I believe you're using) 
> will render the numbers at their stored
> precision:
> https://bitbucket.org/blais/beancount/src/4a3995617e7df5ffa3377711382c7ad2f9d8935b/beancount/query/query_execute.py?at=
> default&fileviewer=file-view-default#query_execute.py-92
> 
> I kept it this way originally because PRINT was intended for debugging, so 
> rounding using the most common precision
> seen in the file seemed it would create problems with interpreting the data.  
> I'm not 100% this was the right choice.
> 
> Second, about rounding: by default the tolerance used is that which is 
> inferred on the transaction:
> https://bitbucket.org/blais/beancount/src/4a3995617e7df5ffa3377711382c7ad2f9d8935b/beancount/core/interpolate.py?at=
> default&fileviewer=file-view-default#interpolate.py-324
> 
> The comment you're referring to applies to the case where a tolerance cannot 
> be inferred at all (like in the first
> example in that section). In that case, no rounding occurs. I'll clarify the 
> docs.
> 
> (This hurts my head too.)
> 
> 
> 
> 
> On Sun, Apr 1, 2018 at 5:13 AM, Zhuoyun Wei  wrote:
> 
> Hi Martin,
> 
> Beancount seems to round inferred numbers by default:
> 
> 1970-01-01 open Assets:Cash
> 1970-01-01 open Assets:Positions
> 1970-01-01 open Expenses:Financial:Commissions
> 
> 2018-03-29 * "Buy 10 BILI"
>   Assets:Cash
>   Assets:Positions                 10 BILI {11.4899 USD, 2018-03-29} @ 
> 11.4899 USD
>   Expenses:Financial:Commissions  0.1 USD
> 
> turns into:
> 
> 2018-03-29 * "Buy 10 BILI"
>   Assets:Cash                     -115.0 USD
>   Assets:Positions                    10 BILI {11.4899 USD, 2018-03-29} @ 
> 11.4899 USD
>   Expenses:Financial:Commissions     0.1 USD
> 
> The full-precision number for Assets:Cash should be -114.9990 USD, but
> it was incorrectly rounded to -115.0 USD.
> 
> In the documentation
> 
> https://docs.google.com/document/d/1lgHxUUEY-UVEgoF6cupz2f_7v7vEF7fiJyiSlYYlhOo/
> section "Precision of Inferred Numbers":
> 
> > If the default tolerance is not overridden in the input file—and
> > therefore is zero—the full precision will be used; no rounding occurs.
> 
> In the minimal example above, the precision seems to be inferred from
> 0.1 USD commission. If I change the input file, changing commission from
> 0.1 USD to 0.1000 USD, the output is correct:
> 
> 2018-03-29 * "Buy 10 BILI"
>   Assets:Cash                     -114.9990 USD
>   Assets:Positions                       10 BILI {11.4899 USD, 
> 2018-03-29} @ 11.4899 USD
>   Expenses:Financial:Commissions     0.1000 USD
> 
> My broker-dealer returns the commission as 0.1 USD because it is a
> floating point number in JSON (you cannot end numbers with zeros). But
> behind the scenes it calculates the cash balance with the full-precision
> numbers (e.g. 0.1000 USD). After a few transactions, the balance of
> Assets:Cash has a difference of more than 0.005 USD with the
> broker-dealer and thus fails the balance assertion.
> 
> Is there a way to turn off the implicit rounding without padding 0.1 USD
> to 0.1000 USD in the input file?
> 
> I am using tagged release 2.0.0.
>
> 
> --
> Zhuoyun Wei
> 
> --
> 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+unsubscribe@
> 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/20180401091341.GA26139%
> 40tarball.wzyboy.org.
> 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://gr

Re: Implicit rounding of inferred numbers

2018-04-03 Thread Martin Blais
On Wed, Apr 4, 2018 at 2:45 AM, Zhuoyun Wei  wrote:

> Thanks for explaination.
>
> It seems that the implicit rounding occurs not only in "PRINT", but also
> has effect on balance calculation:
>
>
> 1970-01-01 open Assets:Cash
> 1970-01-01 open Assets:Positions
> 1970-01-01 open Expenses:Financial:Commissions
>
> 2018-03-29 * "Buy 10 BILI"
>   Assets:Cash
>   Assets:Positions 10 BILI {11.4899 USD, 2018-03-29} @
> 11.4899 USD
>   Expenses:Financial:Commissions  0.1 USD
>
> 2018-04-01 balance Assets:Cash -114.9990 USD
>
>
> The last balance assertion fails:
>
>
> Balance failed for 'Assets:Cash': expected -114.9990 USD != accumulated
> -115.0 USD (0.0010 too little)
>

I believe you may have misunderstood my explanation.
The interpolated number for cash /does/ use the inferred tolerance from
this transaction to round it to a reasonable value.


Is there a way to turn off the implicit rounding without padding 0.1 USD
> to 0.1000 USD?
>

Not at the moment, no.

What you could do is ensure your importer always formats those
floating-point numbers with two digits of precision.

(I'm wondering if, in addition to
- the tolerance and
- the rendering precision,
we should be able to set
- the rounding resolution
in those new options I'll add to override all the inferred values.)



2018-04-04 01:53:19 Martin Blais :
> > This is correct.
> >
> > First, the PRINT command of the shell (which is what I believe you're
> using) will render the numbers at their stored
> > precision:
> > https://bitbucket.org/blais/beancount/src/4a3995617e7df5ffa3377711382c7a
> d2f9d8935b/beancount/query/query_execute.py?at=
> > default&fileviewer=file-view-default#query_execute.py-92
> >
> > I kept it this way originally because PRINT was intended for debugging,
> so rounding using the most common precision
> > seen in the file seemed it would create problems with interpreting the
> data.  I'm not 100% this was the right choice.
> >
> > Second, about rounding: by default the tolerance used is that which is
> inferred on the transaction:
> > https://bitbucket.org/blais/beancount/src/4a3995617e7df5ffa3377711382c7a
> d2f9d8935b/beancount/core/interpolate.py?at=
> > default&fileviewer=file-view-default#interpolate.py-324
> >
> > The comment you're referring to applies to the case where a tolerance
> cannot be inferred at all (like in the first
> > example in that section). In that case, no rounding occurs. I'll clarify
> the docs.
> >
> > (This hurts my head too.)
> >
> >
> >
> >
> > On Sun, Apr 1, 2018 at 5:13 AM, Zhuoyun Wei  wrote:
> >
> > Hi Martin,
> >
> > Beancount seems to round inferred numbers by default:
> >
> > 1970-01-01 open Assets:Cash
> > 1970-01-01 open Assets:Positions
> > 1970-01-01 open Expenses:Financial:Commissions
> >
> > 2018-03-29 * "Buy 10 BILI"
> >   Assets:Cash
> >   Assets:Positions 10 BILI {11.4899 USD, 2018-03-29}
> @ 11.4899 USD
> >   Expenses:Financial:Commissions  0.1 USD
> >
> > turns into:
> >
> > 2018-03-29 * "Buy 10 BILI"
> >   Assets:Cash -115.0 USD
> >   Assets:Positions10 BILI {11.4899 USD,
> 2018-03-29} @ 11.4899 USD
> >   Expenses:Financial:Commissions 0.1 USD
> >
> > The full-precision number for Assets:Cash should be -114.9990 USD,
> but
> > it was incorrectly rounded to -115.0 USD.
> >
> > In the documentation
> > https://docs.google.com/document/d/1lgHxUUEY-UVEgoF6cupz2f_
> 7v7vEF7fiJyiSlYYlhOo/
> > section "Precision of Inferred Numbers":
> >
> > > If the default tolerance is not overridden in the input file—and
> > > therefore is zero—the full precision will be used; no rounding
> occurs.
> >
> > In the minimal example above, the precision seems to be inferred from
> > 0.1 USD commission. If I change the input file, changing commission
> from
> > 0.1 USD to 0.1000 USD, the output is correct:
> >
> > 2018-03-29 * "Buy 10 BILI"
> >   Assets:Cash -114.9990 USD
> >   Assets:Positions   10 BILI {11.4899 USD,
> 2018-03-29} @ 11.4899 USD
> >   Expenses:Financial:Commissions 0.1000 USD
> >
> > My broker-dealer returns the commission as 0.1 USD because it is a
> > floating point number in JSON (you cannot end numbers with zeros).
> But
> > behind the scenes it calculates the cash balance with the
> full-precision
> > numbers (e.g. 0.1000 USD). After a few transactions, the balance of
> > Assets:Cash has a difference of more than 0.005 USD with the
> > broker-dealer and thus fails the balance assertion.
> >
> > Is there a way to turn off the implicit rounding without padding 0.1
> USD
> > to 0.1000 USD in the input file?
> >
> > I am using tagged release 2.0.0.
> >
> >
> > --
> > Zhuoyun Wei
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Beancount" group.
> > To unsubscribe from 

Re: Resetting cash assets (recommendations welcome)

2018-04-03 Thread Martin Blais
That's exactly what I do and would recommend.
(Personally I try to track only non-food receipts, so I book the
"disappeared" cash to food.)

In practice I'm too lazy to insert the cash balance regularly, so I'd like
to eventually create a plugin that distributes it evenly over time (say,
each Friday).



On Tue, Apr 3, 2018 at 3:06 AM, Zhuoyun Wei  wrote:

> Hi,
>
> I would recommend this:
>
> 1. Make a transfer from Assets:Bank to Assets:Cash every time you
> withdraw from ATM;
> 2. Count your money in you wallet from time to time (say, monthly) and
> use "balance" directive to assert how many money in your wallet;
> 3. Insert a "pad" directive one day before the "balance" directive to
> automatically generate a transfer from your wallet to your designated
> account (e.g. Expenses:RandomStuff) to make the next balance assertion
> pass.
>
> I use the similar procedure for a bank investment account which accrues
> interest every day. But I don't want to duplicate every interest income
> in that account because there are no script-friendly way to export data
> from that bank. So I just assert the balance monthly and pad the
> difference to "Income:Interest" or something like that.
>
>
> 2018-04-02 21:26:12 Mattijs Hoitink :
> > Hi,
> >
> > In my ledger I have an asset account for cash set up, used for when I
> withdraw from an ATM machine for example. However
> > I do not keep track of what I spent that money on exactly, I just assume
> that when it enters the account (my wallet) it
> > is spent (from a ledger perspective).
> >
> > I'm not interested in keeping track of what I spent it on (I might give
> some to my wife etc) so I'm looking for ways to
> > reset the asset account to empty, otherwise it keeps accumulating. Does
> anyone have any recommendations for doing this,
> > or a particular process?
> >
> > Any ideas are welcome!
> >
> > cheers,
> > mattijs
> >
> > --
> > 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/
> > 1f644a87-adf7-4b2e-b098-b06b46de6077%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
> --
> Zhuoyun Wei
>
> --
> 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/20180403070625.GA17161%40herus.wzyboy.org.
> 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%2BhOGY5fJv2_Uk6jGB2ZYORZLm5VL6gJ9FKmg2UHy1m8ZPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.