Re: Is there a language-neutral intermediate representation for a beancount ledger?

2024-06-10 Thread Daniele Nicolodi
On 10/06/24 17:11, Chary Chary wrote: And then probably a policy can be introduce to always update a document in a draft mode, when submitting a pull request? I don't really know how to respond to requests like this. ~/src/beanquery$ git log --format='%ae' | grep chary...@gmail.com

Re: Is there a language-neutral intermediate representation for a beancount ledger?

2024-06-10 Thread Daniele Nicolodi
On 10/06/24 11:33, Stefano Zacchiroli wrote: On Mon, Jun 10, 2024 at 11:04:11AM +0200, Daniele Nicolodi wrote: - Release at least beangulp, beanquery, and benaprice on PyPI. I released beangulp recently. I'm planning to clean up some loose ends in beanquery and release a 0.1.0 version soon

Re: Is there a language-neutral intermediate representation for a beancount ledger?

2024-06-10 Thread Daniele Nicolodi
On 10/06/24 09:27, Stefano Zacchiroli wrote: On Sun, Jun 09, 2024 at 07:45:22PM -0400, Martin Blais wrote: I'm hoping to restart v3 in Rust at some point and to maybe write a proto generator for a Rust-native data structure at that time. Well, you know, probably in retirement if I'm realistic,

Re: Is there a language-neutral intermediate representation for a beancount ledger?

2024-06-10 Thread Daniele Nicolodi
On 10/06/24 00:52, Filip Filmar wrote: One reason is I'm not that skilled with python. Another is that last time I checked beancount pulls in a preposterous amount of python deps, each one a potential dependency hell. beancount version 2.3.x pulls is quite a few dependencies that are used

Re: links, vs tags vs meta

2024-06-04 Thread Daniele Nicolodi
Links, tags, and metadata are facilities provided by beancount that do not really have a strictly defined role: they are building block for different workflows. Links are tags both allow to attach labels to transactions. As the name implies, links are generally used to link related

Re: beanquery to get net worth at certain date

2024-06-01 Thread Daniele Nicolodi
On 01/06/24 21:27, Chary Chary wrote: I am still trying to find the way to calculate the net worth at a certain date using *balance *field (I am not sure it will give me any advantage) But somehow it does not quire work as I expect E.g. ledger_text = """ 2020-01-01 open Assets:Bank1

Re: Find invoices yet to be payed

2024-05-31 Thread Daniele Nicolodi
On 31/05/24 15:03, Maurice de Laat wrote: Currently I do have an unique tag for each invoice which is being used when the invoice is received as well as when the invoice is being payed. It would be great if I could use these tags to find the invoices yet to be payed. If you record the

Re: How to get last day of month in BQL

2024-05-29 Thread Daniele Nicolodi
On 29/05/24 10:59, Chary Chary wrote: Looks like you need to ask for a new function to be added to the beanquery, something like MONTH_END_DATE(year, month). In addition also QUATER_END_DATE  (year, month) would be useful. Andreas contributed support for date_truc() and interval() and I

Re: How to get last day of month in BQL

2024-05-29 Thread Daniele Nicolodi
On 29/05/24 04:10, 'francocalvo' via Beancount wrote: I know this won't solve your issue. What I've done in the past was to read the data to a Pandas DataFrame, and aggregate and query it using DuckDB How do you make Pandas and DuckDB work with fixed decimals and with amounts in different

Re: Loving beangulp

2024-05-29 Thread Daniele Nicolodi
Here you go: https://pypi.org/project/beangulp/ Cheers, Dan On 29/05/24 05:47, Martin Blais wrote: It would be indeed nice if I created a PyPI for it. I think when the projects got forked from the beancount repo I never did that. On Tue, May 28, 2024 at 11:19 PM Red S

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

2024-05-21 Thread Daniele Nicolodi
On 21/05/24 09:34, Stefano Zacchiroli wrote: On Mon, May 20, 2024 at 11:22:33PM +0200, Daniele Nicolodi wrote: From the perspective of the maintainer of bean-query, I wonder whether a tool like this could have been implemented as a front-end that interprets the command line options

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

2024-05-20 Thread Daniele Nicolodi
Hello Stefano, thank you for sharing this tool. It looks very useful. From the perspective of the maintainer of bean-query, I wonder whether a tool like this could have been implemented as a front-end that interprets the command line options and translates them into a query for bean-query

Re: Why does beancount.core.data.Posting require an amount?

2024-05-20 Thread Daniele Nicolodi
On 20/05/24 15:24, Aaron Stacy wrote: But Beancount's core data type for Posting requires a non-None amount for the units field It is an error in the typing annotation. Feel free to send a PR. I also notice, the beancount.loader module will insert an Amount when loading the Python objects.

Re: Loving beangulp

2024-05-20 Thread Daniele Nicolodi
beangulp is a redesign of the old importers code in Beancount v2. The main goal of the project has always been to define a API for importers and to build a minimal framework around it that implements most of the tedious parts. The common importers API should have enabled importers to be

Re: Bazel build failing on fedora-toolbox (how to properly set up python env?)

2024-03-09 Thread Daniele Nicolodi
On 09/03/24 20:52, Chary Chary wrote: On Saturday, March 9, 2024 at 6:47:36 PM UTC+1 dan...@grinta.net wrote: No. The fix is installing ninja in the virtual environment. As I demonstrated earlier, everything works just fine if you install without --no-build-isolation. Building

Re: Bazel build failing on fedora-toolbox (how to properly set up python env?)

2024-03-09 Thread Daniele Nicolodi
On 09/03/24 16:39, Chary Chary wrote: Dan, thanks for pointing to the documentation. The solution at the end was to use pip install with the --no-build-isolation option No. The fix is installing ninja in the virtual environment. As I demonstrated earlier, everything works just fine if you

Re: Bazel build failing on fedora-toolbox (how to properly set up python env?)

2024-03-09 Thread Daniele Nicolodi
On 09/03/24 12:44, Chary Chary wrote: Dan, thank you very much for detailed step by step procedure! I did exactly what you suggested, but still get errors. See attached Did you read and understand the error message you get? FileNotFoundError: [Errno 2] No such file or directory:

Re: Bazel build failing on fedora-toolbox (how to properly set up python env?)

2024-03-09 Thread Daniele Nicolodi
On 09/03/24 10:58, Chary Chary wrote: Dan, thank you for your help, I just could not make the pytests work no matter what There are errors, that that the *_parser *module cannot be imported But I found the following workaround, which uses pip install, rather than *py setup.py build_ext -i*

Re: Bazel build failing on fedora-toolbox (how to properly set up python env?)

2024-03-07 Thread Daniele Nicolodi
On 07/03/24 18:45, Chary Chary wrote: Thanks for looking at this, I did try the *pip3 install -e .* method. in virtual environment. The installation works, but then unit tests do not work. Did you try running unit tests ( *pytest beancount )* ? However when I use the good old *py setup.py

Re: Balance for each account for each month

2024-03-04 Thread Daniele Nicolodi
On 03/03/24 23:16, Andrea Vidali wrote: Which outputs multiple balances for each line You have one balance per row, as expected. However, each balance contains amounts in different commodities, presented separated by a comma. The `balance` column in beanquery is just the cumulative sums of

Re: Bazel build failing on fedora-toolbox (how to properly set up python env?)

2024-02-28 Thread Daniele Nicolodi
On 27/02/24 15:38, Chary Chary wrote: Martin, thanks! V3 seems to be working on Windows. just cloned from github then py setup.py build_ext -i For some reason regex module was not auto installed The reason is that you didn't ask for it to be installed: python setup.py build_ext -i only

Re: Licensing of beancount derivatives

2024-02-26 Thread Daniele Nicolodi
On 26/02/24 22:04, Eric Altendorf wrote: On Mon, Feb 26, 2024 at 12:42 PM Daniele Nicolodi <mailto:dani...@grinta.net>> wrote: On 26/02/24 18:11, Eric Altendorf wrote: > Is beancount code used in fava or smart_importer? > > derivatives should indeed

Re: Licensing of beancount derivatives

2024-02-26 Thread Daniele Nicolodi
On 26/02/24 18:11, Eric Altendorf wrote: Is beancount code used in fava or smart_importer? derivatives should indeed be GPL but if you simply write code that interfaces with the core beancount code, I think you can use any license you want (though I am not a lawyer) This is incorrect. It is

Re: Licensing of beancount derivatives

2024-02-26 Thread Daniele Nicolodi
On 26/02/24 17:21, Chary Chary wrote: Dear all, I just noticed, that the products which I would call beancount derivatives (e.g. fava or smart_importer) are licensed with MIT license. However beancount itself is GPL-2. I am not a legal person, but I am just wondering, shouldn't they also

Re: Totals for a specific commodity

2024-02-25 Thread Daniele Nicolodi
On 25/02/24 18:58, CDT wrote: This command gives me a list of the different purchases of that position at different prices. So if I bought some Filecoin at $5.77 and other at $7.83 (just as an example) it separates each of them out in the output 1.134 FIL {5.77 USD}, 3.345 FIL {7.83 USD}.  Is

Re: Using Custom directives from importer script

2024-02-17 Thread Daniele Nicolodi
On 16/02/24 22:51, Mason H wrote: Hello, I've recently been trying to write an importer script and was trying to use a Custom directive. There isn't a lot of documentation on this, and I haven't been able to figure out what the problem is from the source, and was wondering if anyone here had

Re: Copy-pasting multiline (multiple lines) query into bean-query

2024-02-16 Thread Daniele Nicolodi
On 10/02/24 15:24, Dan Andersson wrote: Hi, After doing bean-query foo.beancount to enter the interactive session, can I somehow copy-paste multiple lines in there? It seems like multi-line queries (e.g. the examples in the documentation), when pasted in there, always get split into one

Re: Copy-pasting multiline (multiple lines) query into bean-query

2024-02-16 Thread Daniele Nicolodi
On 16/02/24 01:08, Robert Hotchkiss wrote: I did jot this down in my notes, but not sure if my notes are accurate: - bean-query interactive uses the python gnu readline package (not to be confused with python library's readline)    -

Re: Combining multiple .beancount files

2024-02-07 Thread Daniele Nicolodi
On 07/02/24 21:59, Dan Andersson wrote: Hello, I have three files: 1.beancount, 2.beancount, 3.beancount Within each file we have a correct date order, but the three files' date ranges could overlap. How could I combine these files into a single result file while making sure the result has

Re: Bazel build failing on fedora-toolbox (how to properly set up python env?)

2024-02-03 Thread Daniele Nicolodi
On 31/01/24 22:23, Chary Chary wrote: Dan, I thought that the main idea of beancount v3 was migrating some functionality to C++ to make the thing be faster. If this is not being done in beancount v3, are there any  other improvements which make it worth using as an opposite to v2 at the

Re: Bazel build failing on fedora-toolbox (how to properly set up python env?)

2024-01-31 Thread Daniele Nicolodi
On 31/01/24 18:31, Ouro Boros wrote: Hi, I am tryiung to install Beancount v3 using Bazel. I have gone through the installation instructions here and i have been stuck in `bazel build //bin:all` command. The Bazel build for

New release 2.3.6

2023-10-07 Thread Daniele Nicolodi
Hello bean counters, Beancount release 2.3.6 has been tagged. The release contains only minor bug fixes. A source distribution and binary wheels for all supported Python versions and all major platforms have been uploaded to PyPI. Cheers, Dan -- You received this message because you are

Re: Issue #422: Allow importers to specify formatting of postings (blais/beancount)

2023-09-17 Thread Daniele Nicolodi
On 17/09/23 17:02, Frederick Zhu wrote: Hi, I’d like to format my document when extracted. I know bean-format can make alignments for all entries, but first it is another round of iteration, and second, more importantly, it does not attach delimiter to numbers. For my own usage, I

Re: Issue #422: Allow importers to specify formatting of postings (blais/beancount)

2023-09-15 Thread Daniele Nicolodi
On 15/09/23 06:29, Frederick Zhu wrote: Hi! I'd love to reopen this conversation. I think an easy way to go is to provide a way to set up the displaycontext when we write an Importer. Any thoughts? What problem would this solve exactly and how? Cheers, Dan -- You received this message

Re: Struggling to get padding working

2023-09-06 Thread Daniele Nicolodi
On 06/09/23 16:54, Eric Altendorf wrote: On Wed, Sep 6, 2023 at 04:00 Daniele Nicolodi <mailto:dani...@grinta.net>> wrote: On 06/09/23 01:27, Sagar Shankar wrote: > Hi Dan, > > Thanks a lot, this works now! A simple line on this in the pad >

Re: Struggling to get padding working

2023-09-06 Thread Daniele Nicolodi
On 06/09/23 01:27, Sagar Shankar wrote: Hi Dan, Thanks a lot, this works now! A simple line on this in the pad documentation would be great for future reference of others The behavior is due to the balance directive being treated specially when sorting, not to the pad directive. Ordering is

Re: Struggling to get padding working

2023-09-05 Thread Daniele Nicolodi
etely fine to me Thanks Sagar On Fri, Sep 1, 2023 at 7:17 PM Daniele Nicolodi <mailto:dani...@grinta.net>> wrote: On 01/09/23 00:58, Sagar Shankar wrote: > Hi all, just started using Beancount a few days back, had been using > Ledger before. > &

Re: Struggling to get padding working

2023-09-01 Thread Daniele Nicolodi
On 02/09/23 01:35, Sagar Shankar wrote: Hi Dan, Yes these are the only errors I get. Its confusing as you said because all the declarations seem completely fine to me Can you share a minimal ledger that presents the problem? The one I reconstructed from your description works just fine.

Re: bean-query get last balance assertion

2023-09-01 Thread Daniele Nicolodi
On 24/08/23 19:25, Tim Legg wrote: Is there a bean-query or another way to list the last balance assertion for all or a given account? I've just added a few more table definitions to beanquery. Adding them was planned since a while, but not having a concrete use case for them, it was not

Re: Struggling to get padding working

2023-09-01 Thread Daniele Nicolodi
On 01/09/23 00:58, Sagar Shankar wrote: Hi all, just started using Beancount a few days back, had been using Ledger before. I'm struggling to get a pad transaction working in my new beancount ledger. 1. create the pad transaction 2023-08-01 pad Assets:Debt:Friend Equity:Opening-Balance 2. A

Re: Debugging display contexts

2023-08-10 Thread Daniele Nicolodi
On 10/08/23 06:43, Eric Altendorf wrote: beanquery> SELECT date > maxwidth(narration, 20), account, 10, round(cost(position), 4) as amount FROM > has_account("PnL") AND year(date) = 2021 WHERE account = "Income:PnL" AND > abs(number) < 100 LIMIT 5 Why do you filter by

Re: Questions on cost tracking

2023-08-09 Thread Daniele Nicolodi
On 04/08/23 02:36, Eric Altendorf wrote: Couple questions on cost tracking: *1. When are acquisition dates tracked in Cost objects vs. not?* The query that I use for generating inventory reports at a particular time is this: SELECT account, SUM(position) as lots, UNITS(SUM(position)) AS

Re: bean-query transaction grouping for render?

2023-08-03 Thread Daniele Nicolodi
On 03/08/23 08:27, Eric Altendorf wrote: When you do something like   SELECT account, SUM(position) ... you get a nice table where the list of positions for each account is grouped (with expand=true, it renders like a nested set of rows within the row) and each account name is only printed

Re: Errors from run_query(), not from bean-query

2023-08-03 Thread Daniele Nicolodi
On 03/08/23 07:20, Eric Altendorf wrote: On Wed, Aug 2, 2023 at 5:55 PM Martin Blais > wrote: On Thu, Aug 3, 2023, 08:54 Martin Blais mailto:bl...@furius.ca>> wrote: Use bn.loader.load_file(), not just the parser. Beancount has two stages: parsing,

Re: Beanquery "expand" when calling from command line

2023-08-02 Thread Daniele Nicolodi
On 02/08/23 19:34, Eric Altendorf wrote: It doesn't appear that bean-query allows you to issue a `set` followed by a query in a single line: beanquery> set expand true; select balance where year=2018; Invalid number of arguments. When interactive, of course this is not important.  However,

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

2023-08-02 Thread Daniele Nicolodi
On 02/08/23 11:43, Stefano Zacchiroli wrote: 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);

Re: Beangulp import/extract options

2023-07-23 Thread Daniele Nicolodi
On 23/07/23 12:19, Daniele Nicolodi wrote: It should, but I just found that indeed I overlooked some divergence in the code paths between the time the intra-importer deduplication patches were written and the time I merged them. As a result, the intra-importer deduplication is not run

Re: Beangulp import/extract options

2023-07-23 Thread Daniele Nicolodi
On 23/07/23 03:58, Eric Altendorf wrote: That's great!  I have pulled the latest code, and it doesn't seem to be deduplicating the expected items.  Let me check my assumptions: I'm not sure how one is supposed to run multiple importers at once, the doc kind of only describes running one.

Re: Beangulp import/extract options

2023-07-22 Thread Daniele Nicolodi
On 22/07/23 12:34, Daniele Nicolodi wrote: On 21/07/23 23:06, Eric Altendorf wrote: I'm trying to figure out whether I can use the Beangulp import driver with hooks, or if I need to write my own driver to call my importers and do postprocessing.  As you may recall, my workflow is atypical, as I

Re: Is v2 > v3 still?

2023-07-22 Thread Daniele Nicolodi
On 19/07/23 22:03, Eric Altendorf wrote: In a related vein, are there other reporting tools I can use with v3 to generate even non-interactive reports? It really depends on what you intend for reporting tools. I use beanquery for extracting data from my ledgers, but it is not exactly what

Re: Beangulp import/extract options

2023-07-22 Thread Daniele Nicolodi
On 21/07/23 23:06, Eric Altendorf wrote: I'm trying to figure out whether I can use the Beangulp import driver with hooks, or if I need to write my own driver to call my importers and do postprocessing.  As you may recall, my workflow is atypical, as I have no curated Beancount ledger file; my

Re: Order dependence of transfers

2023-07-22 Thread Daniele Nicolodi
On 21/07/23 07:24, Eric Altendorf wrote: I know in general the order of records in a beancount input file doesn't matter It does not matter in the sense that directives are processed in date order and not in the order in which they appear in the ledger. Directives with the same date are

Re: Is v2 > v3 still?

2023-07-20 Thread Daniele Nicolodi
On 20/07/23 04:47, Eric Altendorf wrote: the installation instructions are a bit confused and misleading with some out-of-date v2 instructions and some incomplete and out-of-date v3 instructions (as came up earlier in the thread). The instructions to install the latest development version of

Re: Is v2 > v3 still?

2023-07-20 Thread Daniele Nicolodi
On 20/07/23 00:56, Andrew Ng wrote: I guess I'm just a bit lost then. Not a programmer, despite the name, ironically. I was able to compile v2 successfully, but am having trouble understanding the install instructions for v3. Unless you want to develop beancount itself, or you want to hack

Re: Is v2 > v3 still?

2023-07-19 Thread Daniele Nicolodi
On 19/07/23 19:56, Andrew Ng wrote: On this note, is there any support at all yet for v3 on Windows? What do you mean? Beancount v3 works just fine on Windows. Just there aren't any Python wheels released for it. You need a C compiler to compile the Python extensions modules. Cheers, Dan

Re: Tolerances and balances

2023-07-19 Thread Daniele Nicolodi
On 19/07/23 00:12, Eric Altendorf wrote: I seem to not understand how tolerances are used.  I have this beancount:   1 2018-01-01 open Assets:Alpha:ABC ABC   2 2018-01-01 open Assets:Beta:ABC ABC   3   4 2018-01-02 * "synthesize a position with zero cost basis"   5   Assets:Alpha:ABC      

Re: Lost cost?

2023-07-19 Thread Daniele Nicolodi
On 19/07/23 19:11, Eric Altendorf wrote: Do you know where in the code this was getting checked and dropped? It should be here https://github.com/beancount/beancount/blob/193645460fd7aafcb3d9e0359edabc21e389db81/beancount/core/position.py#L64-L104 I'm encountering a similar problem with

Re: Is v2 > v3 still?

2023-07-19 Thread Daniele Nicolodi
On 19/07/23 16:58, Eric Altendorf wrote: On Sun, Jul 16, 2023 at 10:07 PM Martin Blais > wrote: bean-query, bean-price have  been moved to their own projects in v3. See other repos in the same org. Bean-web has been deleted; use Fava instead. Noob

Re: Is v2 > v3 still?

2023-07-18 Thread Daniele Nicolodi
On 17/07/23 04:26, Eric Altendorf wrote: Thanks. make & pip install worked fine. If you install with "pip install" there is no need to run make. Cheers, Dan -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and

Re: Workflow questions

2023-07-18 Thread Daniele Nicolodi
There are many workflows that are valid in different contexts. Beancount gives you tools that can be adapted to the different workflows. This is one reason why the importers "framework" has been split out from the core project. It's value is mostly in providing a common interface so that

Re: Lost cost?

2023-07-18 Thread Daniele Nicolodi
On 18/07/23 04:47, Eric Altendorf wrote: I've got my first importer running, mostly works, but the cost I'm providing doesn't seem to be making it all the way through.  A debug print shows this as the transaction I'm returning: Transaction(meta={'filename': '/home/...csv', 'lineno': 1},

Re: BQL for non-transactions?

2023-06-02 Thread Daniele Nicolodi
On 20/05/23 19:10, Scott wrote: Hi, with the recent fava dashboards plugin, I now have a use case where I'm interested in using BQL to find note directives.  Is this possible? Looking through the documentation, I suspect it is not, but I may be missing something.  If it's not possible, I

Re: GPT-4 and trimming expenses

2023-05-01 Thread Daniele Nicolodi
On 01/05/23 10:11, Red S wrote: Came across this thread from a company that's creating ChatGPT plugins related to personal finance, and thought I'd share. I'm not affiliated or associated in any way with this, nor have I even tried this out myself. I merely

Re: Aggregate accounts on income statement

2023-03-12 Thread Daniele Nicolodi
On 11/03/23 20:27, Daniel González wrote: Hi, I'm generating an income statement (with only my expenses) like this: SELECT account, sum(position) FROM OPEN ON 2023-03-01 CLOSE ON 2023-03-30 WHERE account ~ "Expenses" GROUP BY 1 ORDER BY 1 But I have some subdivisions of my accounts that I

Re: Is it fine to combine several small stock purchase transactions in one?

2023-03-12 Thread Daniele Nicolodi
On 11/03/23 21:23, Bman Q wrote: When buying low volume stock often i have to split purchase in many 1-3k buy limit orders (which in turn often getting split in 5+ execution trades, some of the trades can be just 8 stock lol), so basically what for normal stock can be 1 buy transaction i can

Re: Decimal Precision

2023-03-03 Thread Daniele Nicolodi
On 02/03/23 19:28, fin wrote: i'll figure it out eventually now that i know the error is indeed something i did wrong and not the error/rounding issue. AFAIK there are never been bugs reported on Beancount regarding inaccuracies due to rounding or other computing errors. The only issues

Re: Decimal Precision

2023-03-02 Thread Daniele Nicolodi
On 02/03/23 15:53, fin wrote: i'm trying to wade through all these various docs and mentions about precision because i'm trying to figure out why certain transactions do not balance (and fava complains). Your example below does not balance for 1087.5 USD. Why do you think it due to

Re: inventory and position when no investments involved

2023-02-04 Thread Daniele Nicolodi
On 04/02/23 12:24, Chary Chary wrote: Dan, OK, thanks. But just some clarification. If I look at the following  simple Transaction: 2000-01-02 * "Buying something in Euro"     Assets:NL:ING:Payment               -100 EUR     Expenses:Misc                                100 EUR Then does

Re: beanquery error on Windows

2023-02-04 Thread Daniele Nicolodi
On 04/02/23 12:34, Chary Chary wrote: Dean, thanks for reply, but I was looking for a way to install it for hacking/development E.g. with beancount I can do git clone, then run py setup.py build_ext -i After that I run the py beancount\beancount\query>shell.py "beanfile.bean" it will work

Re: inventory and position when no investments involved

2023-02-03 Thread Daniele Nicolodi
On 03/02/23 21:14, Chary Chary wrote: Dear all, can somebody explain please in simple terms what is the meaning of *inventory *and *position *in the situation, when no investment is involved and when I only track expenses and incomes in different currencies? I understand what is

Re: beanquery error on Windows

2023-02-03 Thread Daniele Nicolodi
On 03/02/23 20:17, Chary Chary wrote: Dear all, what is the current status of beanquery as a standalone tool? It works. If there any updated documentation available? Not really. The documentation for bean-query and the Beancount Query Language (BQL) still applies with few exceptions. I

Re: Beancount grammar for tree-sitter

2023-01-26 Thread Daniele Nicolodi
On 26/01/2023 16:31, polarmutex wrote:  I am happy to work together and make changes to clean it up(no one has submitted issues about it). I just feel slighted that I did not get a chance to be merged into the group when I have been working it for a while. I forgot about your messages to

Re: Beancount grammar for tree-sitter

2023-01-26 Thread Daniele Nicolodi
(I realized I left a sentence incomplete) 2. it does not correctly work with account names in the whole Unicode range, it mimics the hack implemented for Flex, which has only primitive regular expressions. tree-sitter supports regular expressions matching unicode character classes, thus a

Re: Beancount grammar for tree-sitter

2023-01-26 Thread Daniele Nicolodi
Hello, thank you for letting me know of this concurrent effort. I had a quick look at your implementation and I noticed a few important things: 1. as far as I can tell, it does not handle indentation correctly, it just ignores it, 2. it does not correctly work with account names in the

Re: Beancount grammar for tree-sitter

2023-01-26 Thread Daniele Nicolodi
On 24/01/2023 03:17, Martin Blais wrote: I would be happy to move this project to the beancount Github organization. Martin, can you arrange for a project to be created and to give me owner rights for it? Thank you! You got it https://github.com/beancount/tree-sitter-beancount

Re: Using "go" to import csv files

2023-01-23 Thread Daniele Nicolodi
On 22/01/2023 21:02, Red S wrote: Always great to see folks share importers. However, one request for anyone considering writing importers: at the very least, *please do consider integrating your importer with the importer framework that ships with Beancount* This is possible only if the

Beancount grammar for tree-sitter

2023-01-23 Thread Daniele Nicolodi
Hello, tree-sitter is getting quite some attention as a parsing library suitable for being used for syntactic support in editors. So much that even Emacs will include support for it in the next major release. I was curious to try it out and I recently had a couple of very long train

Re: Creating a price conversion with total price, in code

2023-01-21 Thread Daniele Nicolodi
On 21/01/2023 11:21, Red S wrote: I'm probably missing it, but how can I create via code (eg: an importer), a posting with a price conversion based on a total price like so: "20 EUR @@ 10 USD" ? It cannot be done. It is one of the things that will be resolved in Beancount 3 so there hasn't

Re: Changes in v3?

2022-12-17 Thread Daniele Nicolodi
On 15/12/2022 08:46, Metin Akat wrote: I would also very much appreciate it if currencies are allowed to contain digits, as this is a practice on some stock exchanges. Currencies are allowed to contain digits (and the following characters '._-) but are restricted to start with an uppercase

Re: Beangulp

2022-11-26 Thread Daniele Nicolodi
On 25/11/2022 23:22, Ghanashyam Prabhu wrote: Hello, I am trying to write a simple importer (referring to reds_beancount_importers), but I hit the strange error with file handling. I am beginner in python and would appreciate some help in debugging the error. Following is some information.

Re: How to get the sum of positions sent from one account

2022-11-19 Thread Daniele Nicolodi
On 19/11/2022 21:13, Martin Blais wrote: On Sat, Nov 19, 2022 at 2:32 PM Daniele Nicolodi <mailto:dani...@grinta.net>> wrote: On 19/11/2022 19:42, Martin Blais wrote: > On Sat, Nov 19, 2022 at 4:12 AM Peter mailto:tobias.h.pub...@gmail.com> > <mailto:tobi

Re: How to get the sum of positions sent from one account

2022-11-19 Thread Daniele Nicolodi
On 19/11/2022 19:42, Martin Blais wrote: On Sat, Nov 19, 2022 at 4:12 AM Peter > wrote: I'd like to fetch the sum (per account) of the amount of money I sent from my checking account to any account during the year. The goal is to compute the average

Re: Monthly balance on the operating currency

2022-10-25 Thread Daniele Nicolodi
On 22/10/2022 19:49, Máté Farkas wrote: With a small post-process step I can solve it with this BQL: SELECT     year, month, last(balance) as balance, last(getprice("CHF", "USD", date)) as price WHERE     account ~ 'Assets' GROUP BY year, month ORDER BY year, month I think the convert()

Re: how to get the number of transactions with BQL

2022-10-22 Thread Daniele Nicolodi
On 22/10/2022 18:32, Stefano Zacchiroli wrote: 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

Re: how to get the number of transactions with BQL

2022-10-22 Thread Daniele Nicolodi
On 22/10/2022 03:54, Martin Blais wrote: Thanks Daniele, > FWIW, One thing I dreamed about a long while ago was a change to BQL to expose the various beancount data as multiple tables, postings, transactions, balanced, events, and more. I think it's more SQLish ("squealish"?) than the

Re: how to get the number of transactions with BQL

2022-10-21 Thread Daniele Nicolodi
On 19/10/2022 05:09, Triple Z wrote: I have tried BQL like `select count(1) from year >= 2022` but I only get the number of postings but not transactions. Any idea to do that? If you use beanquery: SELECT count(1) FROM #entries WHERE type = 'transaction' AND year >= 2022 or SELECT

Re: beangulp: custom output (eg: one file per account)

2022-10-21 Thread Daniele Nicolodi
On 21/10/2022 18:32, Red S wrote: Is beangulp being maintained? And if so, how can I find out answers to the questions below? I have been taking care of beangulp lately. However, you have very high expectations regarding the response time to requests regarding an unpublished open source

Re: BQL: filtering on positive/negative amounts

2022-10-19 Thread Daniele Nicolodi
On 19/10/2022 17:12, Stefano Zacchiroli wrote: 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)

Re: Are there existing_entries for plugins, like with importers?

2022-09-13 Thread Daniele Nicolodi
On 12/09/2022 11:54, John Koala wrote: Hi, Yes, sorry, in the context of V2 still I'm afraid... Perhaps you already know of a "fuzzy string matcher" for transaction narrations/payees? I am not sure I grok the question: how could a fuzzy string matcher be specialized for transaction

Re: Where is bean-file located in code after 2.2.3 version?

2022-09-13 Thread Daniele Nicolodi
On 13/09/2022 22:55, Bman Q wrote: Hello everyone! I have small function which imports from bean-file : "def my_function():     ... from beancount.ingest.file import main main() my_function()" It worked fine until 2.2.3, but after it breaks causes ingest was moved out (to be replaced with

Re: Beancount v3 progress

2022-09-09 Thread Daniele Nicolodi
On 08/09/2022 14:19, Stefano Zacchiroli wrote: 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

Re: Beancount v3 progress

2022-09-07 Thread Daniele Nicolodi
On 06/09/2022 03:30, Thiago Lima wrote: I'm new to Beancount and PTA in general and tried v2, but would really like to leverage some of the v3 proposed features, especially the input split support. What do you mean with "input split support"? Beancount v2 has an include directive (although

Re: Beancount v3 progress

2022-09-07 Thread Daniele Nicolodi
On 07/09/2022 17:58, Chary Chary wrote: Martin, is my understanding correct, that in order to be able to use  the latest features of the *beangulp*, *beanquery *and *beanprice *one has to use *beancount v3?* beanquery works with Beancount v2. beangulp currently requires Beancount v3. At

Re: How are people using importers?

2022-09-02 Thread Daniele Nicolodi
On 02/09/2022 21:25, Bruce Berkowicz wrote: I am currently writing importers to get year-to-date data into my beancount file. I am writing the extract code so that it posts transactions that balance. Do you do it this way? Or do you post the transactions as unbalanced and then edit the file by

Re: Some Scripts Not Working

2022-09-02 Thread Daniele Nicolodi
On 02/09/2022 20:49, Bruce Berkowicz wrote: Hello, Thanks for helping. I left out code that I thought was unimportant. My class does have a name function that returns the name of the importer. So I am not sure why importer.name() is failing. My class is actually this: The code below has no

Re: Some Scripts Not Working

2022-09-02 Thread Daniele Nicolodi
On 02/09/2022 16:52, Bruce Berkowicz wrote: Hello, I have just begun attempting to use beancount (v2). I have written an importer. bean-extract works (thankfully) but bean-identify (and bean-file) throw an error that I cannot figure out.     logfile.write('Importer:   

Re: How to automatically close all descendants of an account?

2022-08-22 Thread Daniele Nicolodi
On 22/08/2022 10:57, Red S wrote: I've wanted one too. Just wrote it up. See here . In short: pip3 install git+https://github.com/redstreet/beancount_reds_plugins And add this to your

Re: Sharing household expenses

2022-08-17 Thread Daniele Nicolodi
On 17/08/2022 07:00, Red S wrote: I would encourage you to go through the bql documentation, and specifically understand querying transactions vs. postings (FROM vs WHERE in bql terminology). The capability to use the FROM clause of a BQL query to filter ledger entries is an unfortunate

Re: Multiple daily prices

2022-05-31 Thread Daniele Nicolodi
On 31/05/2022 08:49, Michael wrote: Hi everyone, I'm an accountant but new to Beancount, so apologies if these are easy questions or have been discussed before. My only plugin is "beancount.plugins.implicit_prices". Two Daily Commodity Prices > Having an electric car, it's useful to track

Re: How to display lot dates in aggregated query

2022-05-27 Thread Daniele Nicolodi
On 27/05/2022 13:11, Philippe Dumonet wrote: Hey, another thing: how do I access inventories in the filter (WHERE) part of my queries? I've looked at the help provided from within the interactive query command line and there seems to be a bunch of simple functions that take an inventory as an

  1   2   3   4   >