Re: Ledger 3.3.2 change in commodity format sub-directive handling

2023-06-04 Thread Scott Carpenter
Thanks, Martin. And thanks for all the work you do with maintaining things 
and managing these releases!

Scott

On Sunday, June 4, 2023 at 10:30:13 AM UTC-5 Martin Michlmayr wrote:

> I think this works as expected (now), but maybe it needs to be
> documented better. "format" requires an example of how the commodity
> is to be used - you have to include the commodity because some people
> (or regions) put it before the number and some people after.
>
>
>
> * Scott Carpenter  [2023-06-04 06:00]:
> > I see now that if I use, say:
> > 
> > commodity xyz
> > format 1,000.000 xyz
> > 
> > Putting the commodity last, things behave the same as before with my 
> > output.
> > 
> > On Sunday, June 4, 2023 at 7:23:06 AM UTC-5 Scott Carpenter wrote:
> > 
> > > After updating to 3.3.2, I was getting errors like this with my 
> > > commodities:
> > >
> > > While parsing file , line 6:
> > > Error: commodity directive symbol abc and format directive symbol 
> should 
> > > be the same
> > >
> > > Note the two spaces between "symbol" and "should". Looks like there is 
> no 
> > > format directive symbol. Commodities look like this:
> > >
> > > commodity $
> > > format $ 1,000.00
> > > default
> > >
> > > commodity abc
> > > format 1,000.00
> > >
> > > commodity xyz
> > > format 1,000.000
> > >
> > > And many more entries. I've been using these for many years. Every 
> format 
> > > line after the first one produced an error like the above when I ran 
> the 
> > > file through ledger.
> > >
> > > Adding the commodity to the format line makes the error go away:
> > >
> > > commodity abc
> > > format abc 1,000.00
> > >
> > > Was I doing it wrong all this time and just getting away with it?
> > >
> > > Figured I'd share as an FYI that something changed with this, and to 
> help 
> > > others that might run into the same error.
> > >
> > > Thank you!
> > >
> > 
> > -- 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups "Ledger" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to ledger-cli+...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ledger-cli/c12415e0-8882-4f43-bb1c-71993986f803n%40googlegroups.com
> .
>
>
> -- 
> Martin Michlmayr
> https://www.cyrius.com/
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/0d6f0062-19a3-4bf5-b923-670e69d027c6n%40googlegroups.com.


Re: Ledger 3.3.2 change in commodity format sub-directive handling

2023-06-04 Thread Scott Carpenter
I see now that if I use, say:

commodity xyz
format 1,000.000 xyz

Putting the commodity last, things behave the same  as before with my 
output.

On Sunday, June 4, 2023 at 7:23:06 AM UTC-5 Scott Carpenter wrote:

> After updating to 3.3.2, I was getting errors like this with my 
> commodities:
>
> While parsing file , line 6:
> Error: commodity directive symbol abc and format directive symbol  should 
> be the same
>
> Note the two spaces between "symbol" and "should". Looks like there is no 
> format directive symbol. Commodities look like this:
>
> commodity $
> format $ 1,000.00
> default
>
> commodity abc
> format 1,000.00
>
> commodity xyz
> format 1,000.000
>
> And many more entries. I've been using these for many years. Every format 
> line after the first one produced an error like the above when I ran the 
> file through ledger.
>
> Adding the commodity to the format line makes the error go away:
>
> commodity abc
> format abc 1,000.00
>
> Was I doing it wrong all this time and just getting away with it?
>
> Figured I'd share as an FYI that something changed with this, and to help 
> others that might run into the same error.
>
> Thank you!
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/c12415e0-8882-4f43-bb1c-71993986f803n%40googlegroups.com.


Ledger 3.3.2 change in commodity format sub-directive handling

2023-06-04 Thread Scott Carpenter
After updating to 3.3.2, I was getting errors like this with my commodities:

While parsing file , line 6:
Error: commodity directive symbol abc and format directive symbol  should 
be the same

Note the two spaces between "symbol" and "should". Looks like there is no 
format directive symbol. Commodities look like this:

commodity $
format $ 1,000.00
default

commodity abc
format 1,000.00

commodity xyz
format 1,000.000

And many more entries. I've been using these for many years. Every format 
line after the first one produced an error like the above when I ran the 
file through ledger.

Adding the commodity to the format line makes the error go away:

commodity abc
format abc 1,000.00

Was I doing it wrong all this time and just getting away with it?

Figured I'd share as an FYI that something changed with this, and to help 
others that might run into the same error.

Thank you!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/b0855f9a-7b85-453a-af76-9f0c981b9a63n%40googlegroups.com.


Re: starting afresh

2023-01-28 Thread Scott Carpenter
I have most of my transactions in a single file, with entries from 
1995-2023. It's approaching 5MB, and ledger handles it with no problems.

On Friday, January 27, 2023 at 3:00:10 PM UTC-6 ARP wrote:

> Hello, I started a new journal file Jan. 1 after using Ledger for 2 1/2 
> years. I wanted to change how I defined and treated certain expenses. Is 
> there a best practice for how long to stick with a Ledger file? What do 
> other users do? Thanks --Rob 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/96d33c25-3755-4b4e-8fe3-8028fde75384n%40googlegroups.com.


Re: Scheduling transactions in ledger-mode

2020-08-12 Thread Scott Carpenter
For future searchers of scheduling options, I'll put a pitch in for my 
ledgerbil scheduler. 

https://github.com/scarpent/ledgerbil#--schedule

On Wednesday, August 12, 2020 at 12:41:16 PM UTC-5 flyingk...@gmail.com 
wrote:

> On Thursday, March 13, 2014 at 7:29:15 AM UTC-4, Alan Schmitt wrote:
>>>
>>> By default it will look at 7 days in the 
>>>   past and 14 days in the future to propose transactions (see customize 
>>>   group ledger-schedule to change these values) 
>>>
>>>
>> Could you post an example?
>> Tried to find any documentation about that but came up empty :-(
>>
>> I figured it out, in case anybody comes across this discussion:
>
>   (setq ledger-schedule-look-forward 30)
>   (setq ledger-schedule-look-backward 14)
>  
> Still think it would be good if that could be documented somewhere
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/3f88f54a-0e9e-4351-97e4-ea411782c7fdn%40googlegroups.com.


Re: Need help just getting started

2020-07-18 Thread Scott Carpenter
I've been using ledger for 7 years and still have to ask basic questions 
here from time to time. It's certainly worth the learning curve!

On Friday, July 17, 2020 at 2:37:30 PM UTC-5, Oliver Hardy wrote:
>
> The fact that other people have actually figured out how to use this 
> program makes me hang my head in shame.
>
> If someone can point me to where in the man pages it describes how to 
> create a journal I would be grateful. Also how does one create accounts, 
> add entries
> etc.
>
> Thank you
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/ce75566b-7790-4439-ba83-0bd89678336fo%40googlegroups.com.


Re: Thank you, John & co.

2020-02-27 Thread Scott Carpenter
+100

I love ledger! And in tinkering with my own ledger-related stuff in python.

On Wednesday, February 26, 2020 at 1:10:00 PM UTC-6, Kent Spillner wrote:
>
> Howdy-
>
> I just wanted to take a minute to thank John and everyone else who
> contributes to Ledger's development.  I don't know anything about
> accounting, never really got into personal finance, etc.  My wife
> recently started her own business and asked me to help manage her
> books.  I randomly stumbled across a mention of Ledger on some
> Reddit thread when I was Googleing for open source Quickbooks clones
> and I've been geeking out on plain text accounting ever since.  I
> can't remember the last time I got this excited about a single piece
> of software!  In addition to my wife's business I'm now trying to
> manage all of our personal accounts as well.
>
> Thank you all for creating such a wonderful tool, and for all of the
> excellent documentation & blog posts, etc.
>
> Best,
> Kent
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/669053ea-c2a6-44ff-8aec-63ce19497821%40googlegroups.com.


Re: Is ledger available in debian or ubuntu package manager?

2020-02-17 Thread Scott Carpenter
Thanks for the replies, Jacob and HTH!

Your answers caused me to poke around further. It looks like apt and 
apt-get both work the same in debian.

My problem was that I wasn't running "apt update" first. (Sigh.)

Running update and then the install and it works fine. (Huzzah!)

Thanks again!


$ docker run -it python:3 /bin/bash
root@fa0b1041fdd9:/# apt update
Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
Get:2 http://security.debian.org/debian-security buster/updates InRelease 
[65.4 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [49.3 kB]
Get:4 http://security.debian.org/debian-security buster/updates/main amd64 
Packages [177 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [5792 
B]
Fetched 8326 kB in 2s (3976 kB/s) 
Reading package lists... Done
Building dependency tree   
Reading state information... Done
29 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@fa0b1041fdd9:/# apt install ledger
Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following additional packages will be installed:
  libboost-filesystem1.67.0 libboost-iostreams1.67.0 libboost-python1.67.0 
libboost-regex1.67.0 libboost-system1.67.0 libpython2.7
Suggested packages:
  elpa-ledger python-ledger
The following NEW packages will be installed:
  ledger libboost-filesystem1.67.0 libboost-iostreams1.67.0 
libboost-python1.67.0 libboost-regex1.67.0 libboost-system1.67.0 
libpython2.7
0 upgraded, 7 newly installed, 0 to remove and 29 not upgraded.
Need to get 4657 kB of archives.
After this operation, 23.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y

(and so on...)


On Monday, February 17, 2020 at 5:06:45 PM UTC-6, Scott Carpenter wrote:
>
> I'm trying on a couple of docker images and getting, for example with 
> Debian:
>
> root@4be055ba3998:/# apt-get install ledger
> Reading package lists... Done
> Building dependency tree   
> Reading state information... Done
> E: Unable to locate package ledger
>
> Thank you!
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/293a5013-0470-448a-be0e-e378568b7fc3%40googlegroups.com.


Is ledger available in debian or ubuntu package manager?

2020-02-17 Thread Scott Carpenter
I'm trying on a couple of docker images and getting, for example with 
Debian:

root@4be055ba3998:/# apt-get install ledger
Reading package lists... Done
Building dependency tree   
Reading state information... Done
E: Unable to locate package ledger

Thank you!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/5fe8c484-e294-4929-80bd-88860cb14a00%40googlegroups.com.


Re: any script to order transactions by date

2019-12-06 Thread Scott Carpenter
Ledgerbil has a sorting feature:

https://github.com/scarpent/ledgerbil

The only change it will make to data is to normalize spacing between 
transactions, using one space.

Ledgerbil doesn't know about a lot of ledger features but it should still 
be able to sort any file. Please let me know if any issues and I'll be 
happy to attempt a fix!


On Friday, December 6, 2019 at 5:19:16 AM UTC-6, Christian Pinedo Zamalloa 
wrote:
>
> Hi! 
> I would like to know if you have any shell, awk... script to sort the 
> order of ledger transactions by date. 
>
> Initially I tried to sort transactions per date by using "ledger 
> print", however I suffered some issues with the output generated by 
> "ledger print" command: 
> - some lot data disappears 
> - lot dates are translated to a format not valid (it seems to be 
> solved in this commit 
>
> https://github.com/ledger/ledger/commit/95237941b66931978953fadb390e1b442ed63175
>  
> ) 
>
> I am a vim user, so I don't use the emacs' mode for ledger. 
>
> Regards! 
>
> -- 
> Christian Pinedo Zamalloa (zako) 
> PGP keyID: 0xdb577d4ee6ffbd55 
> PGP Fgprt: A895 7C11 84F6 30B4 4938  32A4 9306 DFD0 CDE4 B542 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/19292235-93c0-4fdf-9d69-b3799b29402f%40googlegroups.com.


Re: Query/filter by amount?

2019-11-16 Thread Scott Carpenter
Doh! Thanks, Martin!

(I think I was almost going to try that and then didn't for some reason.)

On Sat, Nov 16, 2019 at 3:29 PM Martin Michlmayr  wrote:

> * Scott Carpenter  [2019-11-16 13:25]:
> > I know you can use --limit to specify greater than or less than an
> amount,
> > e.g.
> >
> > --limit '(amount>0)'
> >
> > But that doesn't seem to work for equals. I think there must be a way. I
> > looked cursorily through the docs, but lots of matches on the words I
> want
> > to search on.
>
> It works but you also have to specify the commodity, e.g.
> reg -l "amount == 500 ZAR"
>
> --
> Martin Michlmayr
> https://www.cyrius.com/
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Ledger" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ledger-cli/AcKxkd5l48Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ledger-cli+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ledger-cli/20191116212912.GM2%40jirafa.cyrius.com
> .
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/CAD0Wpw9%3Ds33m8crr0vDm_axFyDr2Z-NFTTdDLeRDS_TjSoQB%3Dw%40mail.gmail.com.


Query/filter by amount?

2019-11-16 Thread Scott Carpenter
I know you can use --limit to specify greater than or less than an amount, 
e.g. 

--limit '(amount>0)'

But that doesn't seem to work for equals. I think there must be a way. I 
looked cursorily through the docs, but lots of matches on the words I want 
to search on.

Thank you!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/f08e9d9d-966a-4cfa-9941-dbcb87fc7f1f%40googlegroups.com.


Re: Syntax Highlighting for VSCode and Sublime Text 3

2019-10-23 Thread Scott Carpenter
I added your mark enhancement. I can see that being more convenient. (Now 
to wait with great anticipation for my next statement.) :-)

On Wednesday, October 23, 2019 at 1:31:42 PM UTC-5, David Glasser wrote:
>
> Neat!
>
> I've recently started using VSCode more for TypeScript/TSX as even with 
> lsp-mode it's a lot better than Emacs, but it's difficult to live in 
> multiple editing environments (not to mention needing IntelliJ for JVM 
> work), so I've considered trying to just entirely move off Emacs, and 
> ledger-mode is one of the big things I'd lose. I've see 
> https://github.com/mariosangiorgio/vscode-ledger but it's not maintained; 
> it does look pretty straightforward to extend to add more autocompletion 
> etc though.  I am also worried about missing ledger-mode's reconcile mode, 
> but it looks like your ledgerbil does something like that.  (One addition I 
> might make if I try it out: a version of the "mark" command that lets me 
> type an amount and, if there's a unique unreconciled transaction with that 
> amount, marks it.  Would make running down a long credit card bill 
> easier... just type the numbers as they come!)
>
> --dave
>
> On Wed, Oct 23, 2019 at 11:16 AM Scott Carpenter  > wrote:
>
>> I recently switched from Sublime Text to VSCode and created a plugin for 
>> the textmate language grammar for journal files (.ledger and .ldg). I'm 
>> still maintaining the sublime syntax file, too. All the things are here:
>>
>> https://github.com/scarpent/ledgerbil/tree/master/syntax
>>
>> The rules are targeted at standard account roots: expenses, assets, 
>> liabilities, income, and equity. (Or one letter aliases of same, except for 
>> equity.)
>>
>> I think it looks nice and colorful:
>>
>> [image: ledger-syntax-highlighting-0.png]
>>
>> In Sublime Text, I originally used scopes that had these colors with a 
>> Monokai Dark theme, but there are settings included in repo for both ST3 
>> and vscode to match what is shown here and in the syntax readme.
>>
>> It handles tags, balance assertions, balance assignments, and virtual 
>> postings. I don't use a lot of ledger features and make no promises on how 
>> it does for more complicated journal files, but I'd be open to attempting 
>> updates if given examples.
>>
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ledger" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ledge...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ledger-cli/725d0f46-484c-49c4-acba-84c5815973bb%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ledger-cli/725d0f46-484c-49c4-acba-84c5815973bb%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> -- 
> gla...@davidglasser.net  | flickr.com/photos/glasser/
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/3d362644-973b-4a5c-98a5-d4f1728b5ce6%40googlegroups.com.


Re: Syntax Highlighting for VSCode and Sublime Text 3

2019-10-23 Thread Scott Carpenter
Thanks for the feedback, David. I'll give some thought to that mark 
enhancement!

I noticed Mario's plugin, too, and it still works pretty well. I decided to 
keep things lighter in the editor for now with just doing syntax 
highlighting, but the autocompletion was working well on small files. I 
didn't end up trying it on my big journal file so not sure how it would do 
there.

On Wednesday, October 23, 2019 at 1:31:42 PM UTC-5, David Glasser wrote:
>
> Neat!
>
> I've recently started using VSCode more for TypeScript/TSX as even with 
> lsp-mode it's a lot better than Emacs, but it's difficult to live in 
> multiple editing environments (not to mention needing IntelliJ for JVM 
> work), so I've considered trying to just entirely move off Emacs, and 
> ledger-mode is one of the big things I'd lose. I've see 
> https://github.com/mariosangiorgio/vscode-ledger but it's not maintained; 
> it does look pretty straightforward to extend to add more autocompletion 
> etc though.  I am also worried about missing ledger-mode's reconcile mode, 
> but it looks like your ledgerbil does something like that.  (One addition I 
> might make if I try it out: a version of the "mark" command that lets me 
> type an amount and, if there's a unique unreconciled transaction with that 
> amount, marks it.  Would make running down a long credit card bill 
> easier... just type the numbers as they come!)
>
> --dave
>
> On Wed, Oct 23, 2019 at 11:16 AM Scott Carpenter  > wrote:
>
>> I recently switched from Sublime Text to VSCode and created a plugin for 
>> the textmate language grammar for journal files (.ledger and .ldg). I'm 
>> still maintaining the sublime syntax file, too. All the things are here:
>>
>> https://github.com/scarpent/ledgerbil/tree/master/syntax
>>
>> The rules are targeted at standard account roots: expenses, assets, 
>> liabilities, income, and equity. (Or one letter aliases of same, except for 
>> equity.)
>>
>> I think it looks nice and colorful:
>>
>> [image: ledger-syntax-highlighting-0.png]
>>
>> In Sublime Text, I originally used scopes that had these colors with a 
>> Monokai Dark theme, but there are settings included in repo for both ST3 
>> and vscode to match what is shown here and in the syntax readme.
>>
>> It handles tags, balance assertions, balance assignments, and virtual 
>> postings. I don't use a lot of ledger features and make no promises on how 
>> it does for more complicated journal files, but I'd be open to attempting 
>> updates if given examples.
>>
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ledger" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ledge...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ledger-cli/725d0f46-484c-49c4-acba-84c5815973bb%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ledger-cli/725d0f46-484c-49c4-acba-84c5815973bb%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> -- 
> gla...@davidglasser.net  | flickr.com/photos/glasser/
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/01ada1aa-18a9-4f0c-80ab-9a76cbe480e3%40googlegroups.com.


Syntax Highlighting for VSCode and Sublime Text 3

2019-10-23 Thread Scott Carpenter
I recently switched from Sublime Text to VSCode and created a plugin for 
the textmate language grammar for journal files (.ledger and .ldg). I'm 
still maintaining the sublime syntax file, too. All the things are here:

https://github.com/scarpent/ledgerbil/tree/master/syntax

The rules are targeted at standard account roots: expenses, assets, 
liabilities, income, and equity. (Or one letter aliases of same, except for 
equity.)

I think it looks nice and colorful:

[image: ledger-syntax-highlighting-0.png]

In Sublime Text, I originally used scopes that had these colors with a 
Monokai Dark theme, but there are settings included in repo for both ST3 
and vscode to match what is shown here and in the syntax readme.

It handles tags, balance assertions, balance assignments, and virtual 
postings. I don't use a lot of ledger features and make no promises on how 
it does for more complicated journal files, but I'd be open to attempting 
updates if given examples.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/725d0f46-484c-49c4-acba-84c5815973bb%40googlegroups.com.


Re: Multiple metadata key/value pairs on single line?

2019-05-16 Thread Scott Carpenter
That's my understanding as well: only one per line. But you can put tags on 
multiple lines that apply to a single posting, for example:

2019/05/16 someone
expenses: something  ; tag1: value1
; tag2: value2
liability: some credit card   $50

On Thursday, May 16, 2019 at 3:20:59 PM UTC-5, maktak wrote:
>
>
> I am experimenting with key/value metadata and it seems like a single line 
> can only have 1 key/value pair. Documentation doesn't discuss this 
> limitation ... am I right?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/95d2960a-d3d6-4344-aad3-c53cf2454cd8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Account balance without nested accounts

2019-04-10 Thread Scott Carpenter
Beware of this gotcha with --flat and --depth, however:

https://github.com/ledger/ledger/issues/1020

Because of that, I don't have any accounts where I apply amounts to both a 
parent and child account.

On Wednesday, April 10, 2019 at 12:20:43 PM UTC-5, Martin Michlmayr wrote:
>
> * Vladimir Parfinenko > [2019-04-10 
> 09:11]: 
> > Is it possible to see balance of Food account without including 
> > Restaurants (i.e. $10)?  Does anybody have the same problem? 
>
> Ismael Bouya already answered your question (you can use regexes for 
> account names and $ means end of account name), but just to say that 
> the 
>   --flat 
> option might also be of interest to you. 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANNOUNCE] ledger 3.1.2

2019-02-07 Thread Scott Carpenter
Thank you, Martin, John, and all contributors and users of Ledger! 

On Tuesday, February 5, 2019 at 6:44:39 PM UTC-6, Martin Michlmayr wrote:
>
> We're happy to announce the release of ledger 3.1.2. 
>
> Please see docs/NEWS for a list of changes. 
>
> I have to add a disclaimer up front.  We're releasing with two known 
> failures in the test suite, which obviously isn't great (The org 
> command doesn't give the right output: #1706; and the order of --lots 
> is not reliable: #1747).  I believe both have been exhibited by 
> changes in the toolchain and are also present in 3.1.1, so I don't 
> want to delay the release even more.  If someone can look at the bugs 
> and submit fixes, we can release a 3.1.3 soon. 
>
> This release addresses a number of potential security issues that have 
> been assigned CVEs (Common Vulnerabilities and Exposures, see 
> <https://cve.mitre.org/>).  Thanks to Gwan Yeong Kim and Cory 
> Duplantis for reporting these issues. 
>
> We'd like to thank the following people who contributed fixes and 
> enhancements to ledger 3.1.2: 
>
>   * Aaron Lindsay 
>   * Alexander Pletnev 
>   * Alexandre Rademaker 
>   * Alexis Hildebrandt 
>   * Andreas Hilboll 
>   * Andrew Savinykh 
>   * Atheriel 
>   * Austin Wise 
>   * Bradley M. Kuhn 
>   * Bruno Sutic 
>   * Christoph Dittmann 
>   * Colin Dean 
>   * Craig Earls 
>   * Craig Marshall 
>   * DJ Edmonson 
>   * Daniel Mueller 
>   * Daniele Nicolodi 
>   * Denis 
>   * Eduardo Elias 
>   * Elaina Martineau 
>   * Evan Mallory 
>   * Georg J.P. Link 
>   * Gerhard Poul 
>   * Gina White 
>   * Gonzalo Rizzo 
>   * Gunnar Andersson 
>   * Ismaël Bouya 
>   * Ivan Vanyushkin 
>   * Ivy Foster 
>   * Jakob Demler 
>   * Jan Beich 
>   * Jim Kalafut 
>   * Johannes Loher 
>   * John Lee 
>   * John Wiegley 
>   * Jonas Bernoulli 
>   * Jonas Meurer 
>   * Kyle Fuller 
>   * Manuel Amador (Rudd-O) 
>   * Martin Michlmayr 
>   * Michael Budde 
>   * Mitchell Kember 
>   * Naga Kiran 
>   * Narsimham Chelluri 
>   * Pascal Fleury 
>   * Paulo Flabiano Smorigo 
>   * Peter Feigl 
>   * Peter Pickford 
>   * Rémi Vanicat 
>   * Scott Carpenter 
>   * Sebastian Christ 
>   * Steven R. Baker 
>   * Tim Landscheidt 
>   * Tommi Komulainen 
>   * Vishesh Handa 
>   * myq 
>   * smr894 
>   * thdox 
>   * Øyvind A. Holm 
>
> Of course, we'd also like to thank everyone who submitted bug reports 
> as well as all users of ledger. 
>
> Martin Michlmayr and John Wiegley 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Backup and cloud-storage

2019-02-03 Thread Scott Carpenter
I have a local git repo, with a script I run manually that makes sure the 
data is valid before committing. (The script also parses out payee names to 
put in the commit message, and runs ledgerbil's scheduler command to enter 
future transactions.) 

I keep the repo in a Veracrypt volume in Dropbox, but since I'm not 
entirely trusting of the sync on that one, I have a cron job to tar and gpg 
encrypt the ledger repo for emergency recovery. Finally, the tar file gets 
picked up by Backblaze, too! :-)

I feel like I should simplify things, but I want to have everything in 
Dropbox while keeping a few things encrypted on top of that, and I only 
work with ledger on one machine so this does the job.


On Saturday, February 2, 2019 at 4:51:09 AM UTC-6, Dániel Fancsali wrote:
>
> Good morning fellow ledger-lovers,
>
> I was just making slight changes to the layout of my journal files, and 
> adjusting my workflow accordingly, and realised, I got to the point, where 
> I have invested way to much time into this to be able to re-do it, in case 
> my laptop would go missing – or the data would be destroyed/lost for any 
> other reason.
>
> Long story short, I was just wondering, what others do to back-up their 
> work? Do you use version control? Do you back-up to a cloud storage; or 
> even sync it to multiple machines? What about encryption?
>
> Please let us know!
>
> Regards,
> Dan
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Options for specifying account in a balance query

2019-01-04 Thread Scott Carpenter
Ah, good to know. Thank you!

On Friday, January 4, 2019 at 8:03:42 PM UTC-6, Martin Michlmayr wrote:
>
> * Martin Michlmayr > [2019-01-05 00:01]: 
> > * Scott Carpenter > [2019-01-04 
> 17:35]: 
> > > Tried to glom a whole bunch of accounts together for a query, but 
> appears 
> > > there is a 256 character limit for the // grouping, e.g.: 
> > > 
> > > While parsing value expression: 
> > >   (cleared)&((account =~ /^(fu: bar|...lots of chars...|abc: def)$/)) 
> > >   
> > > Error: Invalid char 'a' (wanted '/') 
> > 
> > How old is your version of ledger? 
> > 
> > I would have thought this was fixed in: 
>
> Ok, this change was after 3.1.1 (the last release).  A new release is 
> way overdue, so you should use ledger from Git. 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Options for specifying account in a balance query

2019-01-04 Thread Scott Carpenter
I do have them grouped in a tree structure, but was still querying all 
accounts separately for reasons. My ledgerbil reconciler caches previous 
balances which should match ledger's --cleared totals. I initially wanted 
to explicitly query by the cached account names, but realize now it will 
work just as well to run a query that gets all cleared balances and match 
them up with cached values without needing things to line up exactly.

On Friday, January 4, 2019 at 7:48:18 PM UTC-6, Craig Earls wrote:
>
> Never hit that limit!  Can you group your accounts in a tree structure?
>
> On Fri, Jan 4, 2019 at 18:35 Scott Carpenter  > wrote:
>
>> Tried to glom a whole bunch of accounts together for a query, but appears 
>> there is a 256 character limit for the // grouping, e.g.:
>>
>> While parsing value expression:
>>   (cleared)&((account =~ /^(fu: bar|...lots of chars...|abc: def)$/))
>>  
>> Error: Invalid char 'a' (wanted '/')
>>
>>
>>
>> On Wednesday, January 2, 2019 at 8:11:50 PM UTC-6, Scott Carpenter wrote:
>>>
>>> Yep I had the longer version with --limit and account =~
>>>
>>> Thanks for the tip!
>>>
>>> On Wednesday, January 2, 2019 at 7:30:08 PM UTC-6, Martin Michlmayr 
>>> wrote:
>>>>
>>>> * Scott Carpenter  [2019-01-02 15:11]: 
>>>> > Sigh. No sooner posted than I had a better idea for finding it in the 
>>>> docs 
>>>> > and looks like "6.2.1 Controlling the Accounts and Payees" has what I 
>>>> need. 
>>>>
>>>> So what did you end up with? 
>>>>
>>>> I assume 
>>>> ledger -f d bal --limit "account =~ /unwise%$/" 
>>>>
>>>> If so, note that you can use the more simple version: 
>>>>
>>>> ledger -f d bal /unwise%$/ 
>>>>
>>>
>>>> -- 
>>>> Martin Michlmayr 
>>>> https://www.cyrius.com/ 
>>>>
>>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ledger" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ledger-cli+...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Craig, Corona De Tucson, AZ
> [image: missile_flyout]
> enderw88.wordpress.com
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Options for specifying account in a balance query

2019-01-04 Thread Scott Carpenter
Tried to glom a whole bunch of accounts together for a query, but appears 
there is a 256 character limit for the // grouping, e.g.:

While parsing value expression:
  (cleared)&((account =~ /^(fu: bar|...lots of chars...|abc: def)$/))
 
Error: Invalid char 'a' (wanted '/')



On Wednesday, January 2, 2019 at 8:11:50 PM UTC-6, Scott Carpenter wrote:
>
> Yep I had the longer version with --limit and account =~
>
> Thanks for the tip!
>
> On Wednesday, January 2, 2019 at 7:30:08 PM UTC-6, Martin Michlmayr wrote:
>>
>> * Scott Carpenter  [2019-01-02 15:11]: 
>> > Sigh. No sooner posted than I had a better idea for finding it in the 
>> docs 
>> > and looks like "6.2.1 Controlling the Accounts and Payees" has what I 
>> need. 
>>
>> So what did you end up with? 
>>
>> I assume 
>> ledger -f d bal --limit "account =~ /unwise%$/" 
>>
>> If so, note that you can use the more simple version: 
>>
>> ledger -f d bal /unwise%$/ 
>>
>> -- 
>> Martin Michlmayr 
>> https://www.cyrius.com/ 
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Options for specifying account in a balance query

2019-01-02 Thread Scott Carpenter
Yep I had the longer version with --limit and account =~

Thanks for the tip!

On Wednesday, January 2, 2019 at 7:30:08 PM UTC-6, Martin Michlmayr wrote:
>
> * Scott Carpenter > [2019-01-02 15:11]: 
> > Sigh. No sooner posted than I had a better idea for finding it in the 
> docs 
> > and looks like "6.2.1 Controlling the Accounts and Payees" has what I 
> need. 
>
> So what did you end up with? 
>
> I assume 
> ledger -f d bal --limit "account =~ /unwise%$/" 
>
> If so, note that you can use the more simple version: 
>
> ledger -f d bal /unwise%$/ 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Options for specifying account in a balance query

2019-01-02 Thread Scott Carpenter
Sigh. No sooner posted than I had a better idea for finding it in the docs 
and looks like "6.2.1 Controlling the Accounts and Payees" has what I need. 
I had looked for --account but gave up too quickly. 




On Wednesday, January 2, 2019 at 5:08:57 PM UTC-6, Scott Carpenter wrote:
>
> In my ledgerbil program I construct ledger queries for accounts and ran 
> into an issue when the account ended with a % sign. I now realize a % sign 
> in the account name probably isn't a great idea, but I'd like to handle if 
> possible. 
>
> An example! Let's say we have an account:
>
> assets: unwise%
>
> And wrap the account to query for an exact match:
>
> ledger balance '^assets: unwise%$'
>
> It appears that ledger interprets this as:
>
> ledger balance '^assets: unwise' %$
>
> Where %$ will match any tag.
>
> Is there some other way to query for accounts that would avoid this issue? 
> And would want to be able to query for multiple accounts at one time.
>
> And again, easy solution is that I won't use % in an account name, but it 
> was working okay otherwise and I'm trying to head off future bug reports 
> that would be really hard to troubleshoot. :-)
>
> Thanks!
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Options for specifying account in a balance query

2019-01-02 Thread Scott Carpenter
In my ledgerbil program I construct ledger queries for accounts and ran 
into an issue when the account ended with a % sign. I now realize a % sign 
in the account name probably isn't a great idea, but I'd like to handle if 
possible. 

An example! Let's say we have an account:

assets: unwise%

And wrap the account to query for an exact match:

ledger balance '^assets: unwise%$'

It appears that ledger interprets this as:

ledger balance '^assets: unwise' %$

Where %$ will match any tag.

Is there some other way to query for accounts that would avoid this issue? 
And would want to be able to query for multiple accounts at one time.

And again, easy solution is that I won't use % in an account name, but it 
was working okay otherwise and I'm trying to head off future bug reports 
that would be really hard to troubleshoot. :-)

Thanks!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Balance assertions and assignments

2018-12-09 Thread Scott Carpenter
Thanks for checking in on this. My solution was to try combining two files 
and see if the performance was acceptable. It was, and with that being the 
case I like having the one large file for most of my transactions.

Ledger does really well with:

Time period: 95-May-27 to 19-Jan-25 (8644 days)

  Unique payees:1664
  Unique accounts:   297

  Number of postings:  75621 (8.7 per day)



On Saturday, December 8, 2018 at 10:54:32 PM UTC-6, John Wiegley wrote:
>
> >>>>> "SC" == Scott Carpenter > writes: 
>
> SC> Hi! Let's say I want to have most of my ledger entries in an "old" 
> file 
> SC> and more recent entries in "new." 
>
> Hi Scott, 
>
> Did you ever find a resolution for your posted issue? 
>
> John 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Net worth over time

2018-10-01 Thread Scott Carpenter
This is fantastic! Thank you.

On Monday, October 1, 2018 at 10:12:43 AM UTC-5, Jim Robinson wrote:
>
> As part of a larger script I run this when I want to get a month-to-month 
> total:
>
> ledger -X '$' -O --real --monthly --collapse register assets or 
> liabilities -F '%(ansify_if(format_date(date, "%Y-%m"), green if color and 
> date > today)) %(ansify_if(justify(scrub(display_total), 4 + 
> int(total_width), true, color), bold if should_bold))\n'
>
> On Friday, September 28, 2018 at 1:03:50 PM UTC-7, Scott Carpenter wrote:
>>
>> I  see some previous postings about this but hoping I can be forgiven for 
>> starting another.
>>
>> I'd like to be able to run a report for ne tworth over years or months. 
>> Normally let's say I have:
>>
>> ledger bal ^assets ^liabilities --depth 1 
>>
>> And:
>>
>>   $ 8,270.61  assets
>>  $ -4,424.04  liabilities
>> 
>>   $ 3,846.57
>>
>> I'd like to get total only, and get a listing with one total per year or 
>> month period. Is this possible out of the box? It doesn't necessarily have 
>> to be one total per line or all that clean, as long as I can parse it. I'd 
>> just like to make one ledger call rather than many from ledgerbil. (
>> https://github.com/scarpent/ledgerbil) Yearly might not be so bad when 
>> making multiple calls, but monthly would be a lot.
>>
>> Thanks!
>>
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Net worth over time

2018-09-30 Thread Scott Carpenter
Added this as a new option to ledgerbil's grid 
command: https://github.com/scarpent/ledgerbil#grid

$ lbil grid --net-worth --transpose
 net worth
$ 3,801.14  2016
$ 4,347.57  2017
$ 6,101.22  2018

On Friday, September 28, 2018 at 3:03:50 PM UTC-5, Scott Carpenter wrote:
>
> I  see some previous postings about this but hoping I can be forgiven for 
> starting another.
>
> I'd like to be able to run a report for ne tworth over years or months. 
> Normally let's say I have:
>
> ledger bal ^assets ^liabilities --depth 1 
>
> And:
>
>   $ 8,270.61  assets
>  $ -4,424.04  liabilities
> 
>   $ 3,846.57
>
> I'd like to get total only, and get a listing with one total per year or 
> month period. Is this possible out of the box? It doesn't necessarily have 
> to be one total per line or all that clean, as long as I can parse it. I'd 
> just like to make one ledger call rather than many from ledgerbil. (
> https://github.com/scarpent/ledgerbil) Yearly might not be so bad when 
> making multiple calls, but monthly would be a lot.
>
> Thanks!
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Net worth over time

2018-09-29 Thread Scott Carpenter
Would still be interested in ways to do this kind of thing, but I was 
already doing multiple calls in a similar way for expenses and payee 
reports so was fine to extend similarly for net worth.

On Friday, September 28, 2018 at 3:03:50 PM UTC-5, Scott Carpenter wrote:
>
> I  see some previous postings about this but hoping I can be forgiven for 
> starting another.
>
> I'd like to be able to run a report for ne tworth over years or months. 
> Normally let's say I have:
>
> ledger bal ^assets ^liabilities --depth 1 
>
> And:
>
>   $ 8,270.61  assets
>  $ -4,424.04  liabilities
> 
>   $ 3,846.57
>
> I'd like to get total only, and get a listing with one total per year or 
> month period. Is this possible out of the box? It doesn't necessarily have 
> to be one total per line or all that clean, as long as I can parse it. I'd 
> just like to make one ledger call rather than many from ledgerbil. (
> https://github.com/scarpent/ledgerbil) Yearly might not be so bad when 
> making multiple calls, but monthly would be a lot.
>
> Thanks!
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Schedule a transaction in ledger-mode for every N days

2018-09-29 Thread Scott Carpenter
Thanks for trying out ledgerbil, Michael! This interval is now included 
with the scheduler.

On Saturday, September 29, 2018 at 12:21:21 PM UTC-5, Michael G wrote:
>
> I would like to be able to schedule a transaction every N days. I have a 
> few transactions that occur every 30 days so this would be helpful. It 
> there a way to do this?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Net worth over time

2018-09-28 Thread Scott Carpenter
I  see some previous postings about this but hoping I can be forgiven for 
starting another.

I'd like to be able to run a report for ne tworth over years or months. 
Normally let's say I have:

ledger bal ^assets ^liabilities --depth 1 

And:

  $ 8,270.61  assets
 $ -4,424.04  liabilities

  $ 3,846.57

I'd like to get total only, and get a listing with one total per year or 
month period. Is this possible out of the box? It doesn't necessarily have 
to be one total per line or all that clean, as long as I can parse it. I'd 
just like to make one ledger call rather than many from ledgerbil. 
(https://github.com/scarpent/ledgerbil) Yearly might not be so bad when 
making multiple calls, but monthly would be a lot.

Thanks!


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Building a command line tool for automating entry of recurring transactions

2018-09-02 Thread Scott Carpenter
The first thing I wrote when I switched to ledgerbil was a scheduler for 
recurring transactions:

https://github.com/scarpent/ledgerbil#--schedule

Ledgerbil can be tied to my own ledger usage in many ways, but the 
scheduler is one of the things that should be usable by any ledger user. :-)

On Friday, August 31, 2018 at 2:17:59 PM UTC-5, Gavin Hughes wrote:
>
> I'm starting work on ledger-recur shown below (and prettier in this gist 
> ). 
>  I see this topic gets discussed occasionally. Does anything like this 
> already exist?  Is this useful to anyone else?  Any suggestions from 
> improvement before I start work on it?
>
> - Gavin
> ---
> https://gist.github.com/gavinhughes/32e80a57fa666ac691db8271914a407d
>
> #+Title:Ledger Recur
>
> Ledger Recur provides automated entry of recurring transactions into 
> ledger files.
>
> The command `recur journal.ledger recurring.rcr` enters all recurring 
> transactions specified in the file `recurring.rcr` into the file 
> `journal.ledger`.
>
> A recur file is parsed before transactions are entered into a ledger file. 
> If erorrs are found, they are reported and no transactions are entered.
>
> * Recur file syntax
>
> ** Transactions
>
> #+BEGIN_SRC
> Payee
> /recurrence/ /[end_date]/
> /last_applied_date/
> [Remaining lines applied verbatim]
> #+END_SRC
>
> *** Example
>
> #+BEGIN_SRC
> Dropbox
>   1M22 E2018/12/31
>   2018/08/30
>   ; d: Pro subscription
>   ; :recur:
>   software  $10
> #+END_SRC
>
> ** Recurrence syntax
>
> | Interval  | Interpreted as   |
> |---+--|
> | 1W1,3,5   | Every week on Mon, Wed, Fri. |
> | 2W5   | Every two weeks on Fri.  |
> | 1M22  | Every 1 month on the 22nd.   |
> | 1M1,15| Every 1 month on the 1st and 15th.   |
> | 1Mw7  | Every 1 month on the first Sun.  |
> | 1Y01/08   | Every 1 year on Jan-08.  |
> | /interval/ E2018/01/08 | The recur terminates on 2018/01/08.  |
>
> * Command line syntax
>
> recur /ledger_file/ /recur_file/
>
> If a recur file is not supplied, recur will look for a file with the same 
> name as the ledger file but with an added extension of `.rcr`.
>
> Example,
>
> #+BEGIN_SRC
> recur main.ldg
> #+END_SRC
>
> expands to
>
> #+BEGIN_SRC
> recur main.ldg main.ldg.rcr
> #+END_SRC
>
> ** Options
>
> | -d | --dry-run | Simulate but do not enter transaction. Reports errors 
> and warnings. |
>
> Ledger Recur provides automated entry of recurring transactions into 
> ledger files.
>
> The command `recur journal.ledger recurring.rcr` enters all recurring 
> transactions specified in the file `recurring.rcr` into the file 
> `journal.ledger`.
>
> A recur file is parsed before transactions are entered into a ledger file. 
> If erorrs are found, they are reported and no transactions are entered.
>
> * Recur file syntax
>
> ** Transactions
>
>   Payee
> Recurrence /end_date/
> Last_applied_date
> [Remaining lines applied verbatim]
>
> *** Example
>
> Dropbox
>   1M22 E2018/12/31
>   2018/08/30
>   ; d: Pro subscription
>   ; :recur:
>   software  $10
>
> * Recurrence syntax
>
> | Impl | Example   | Interpreted as   
> |
>
> |--+---+--|
> |  | 1W1,3,5   | Every week on Mon, Wed, Fri. 
> |
> |  | 2W5   | Every two weeks on Fri.   
>|
> |  | 1M22  | Every 1 month on the 22nd.   
> |
> |  | 1M1,15| Every 1 month on the 1st and 15th.   
> |
> |  | 1Mw7  | Every 1 month on the first Sun.   
>|
> |  | 1Y01/08   | Every 1 year on Jan-08   
> |
> |  | /interval/E2018/01/08 | Every 1 year on Jan-08, ending on 
> 18-Jan-08. |
> |  |   |   
>|
>
> * Command line syntax
>
> recur /ledger_file/ /recur_file/
>
>   Example:  recur dauin.rcr main.ldg
>
> If a recur file is not supplied, recur will look for a file with the same 
> name as the ledger file with the addition of ".rcr".
>
>   Example,  recur main.ldg   expands to   recur main.ldg main.ldg.rcr.
>
> ** Options
>
> | -d | --dry-run | Simulate but do not enter transaction. Reports errors 
> and warnings. |
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit 

Re: problems for newby with --flat

2018-08-23 Thread Scott Carpenter
I don't think of it as a dummy account as much as usage of parent vs child 
accounts. It is probably a bug that should be fixed, but yes it may be 
helpful to document that assigning funds to both a parent and child account 
will produce unexpected results with --flat.

On Thursday, August 23, 2018 at 3:18:05 AM UTC-5, Richard Gott wrote:
>
> Thanks for link. I had searched but missed this one. Isn't the answer to 
> document the use of dummy accounts, if that is the correct term?
> Thanks
> Richard
>
> On Wednesday, 22 August 2018, Martin Michlmayr  > wrote:
>
>> * Richard Gott > [2018-08-21 09:35]:
>> > An ordinary balance report is fine.  But a --flat balance gets confused 
>> > over whether to add just the first of the lines above (depth 3) or the 
>> > second and third (depth 4).  I can't remember which of them it did (the 
>> > first I think) but it was, luckily, so far wrong that it couldn't be 
>> missed.
>> > 
>> > I suspect people are thinking 'what an idiot'.
>>
>> No, several people have run into this issue, see e.g.
>> https://github.com/ledger/ledger/issues/1020
>> I'm not sure what the right behaviour should be with --flat.
>>
>> -- 
>> Martin Michlmayr
>> https://www.cyrius.com/
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Ledger" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/ledger-cli/jfF6NrZUa8k/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> ledger-cli+...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> R Gott
> 1 Willow Court
> Finghall
> Leyburn
> N Yorks
>
> DL8 5NL
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: problems for newby with --flat

2018-08-22 Thread Scott Carpenter
Yep. I've been bit by this, too. I have a check and a warning in my 
ledgerbil grid helper when ledger's total doesn't match my grid total.

For a "newbie" you've done well to catch it and identify the issue. :-)

On Wednesday, August 22, 2018 at 4:17:49 AM UTC-5, Martin Michlmayr wrote:
>
> * Richard Gott > [2018-08-21 09:35]: 
> > An ordinary balance report is fine.  But a --flat balance gets confused 
> > over whether to add just the first of the lines above (depth 3) or the 
> > second and third (depth 4).  I can't remember which of them it did (the 
> > first I think) but it was, luckily, so far wrong that it couldn't be 
> missed. 
> > 
> > I suspect people are thinking 'what an idiot'. 
>
> No, several people have run into this issue, see e.g. 
> https://github.com/ledger/ledger/issues/1020 
> I'm not sure what the right behaviour should be with --flat. 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Doc update for transaction state/status

2018-08-04 Thread Scott Carpenter
Hi, Martin! I hope I've made much less of a mess and hopefully no mess at 
all with another PR:

https://github.com/ledger/ledger/pull/1672

Please let me know if any concerns with this one!

On Sunday, July 8, 2018 at 5:21:05 PM UTC-5, Martin Michlmayr wrote:
>
> * Scott Carpenter > [2018-07-08 15:10]: 
> > All right, please let me know if I've failed miserably: 
>
> The PR includes some merges that shouldn't be there. 
>
> And you removed some trailing whitespace, which shouldn't be done or 
> should be done in a separate patch.  But shouldn't be done when 
> there's a command: 
>
>  @c Note: The output needs a space character at the end 
>  @c   for this test to pass 
>
> :) 
>
> I'll apply manually with your name on it.  Thanks! 
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Display Colours

2018-07-28 Thread Scott Carpenter
Depends on your terminal color scheme, of course. I think this is pretty 
readable:


It's not just ledger but other command line programs use those colors as 
well so I just use a different color scheme.

On Saturday, July 28, 2018 at 2:59:58 AM UTC-5, psionl0 wrote:
>
> Dark blue on black is a horrible colour combination (hard to read) and 
> dark red on black is not much better.
>
> Even then, on Linux I have to use the --no-pager option or the screen will 
> show the escape sequences instead of the coloured text.
>
> I know that I can use --no-colour to display everything in white on black 
> but I was wondering if there was a way to change the default colours.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Syntax Highlighting in Sublime Text

2018-07-27 Thread Scott Carpenter
I previously used tmLanguage files for syntax highlighting in Sublime and 
now have updated to use a newer syntax definition format. If anyone uses 
Sublime and is interested, more here:

https://github.com/scarpent/ledgerbil/tree/master/syntax

It's geared to my own usage in some ways but of course you could modify it 
as you wish. The newer .sublime-syntax format is much easier to work with 
than the old tmLanguage format. (Also there are tests! The tests work on 
tmLanguage files as well. I don't know if they're a new thing themselves.)

I'd be happy to extend it to include more currency symbols, and given 
examples of other ledger features that I don't use, I can attempt to 
support them. I don't know a lot about this stuff and piggybacked on scope 
names used in the Monokai color scheme.

Here's a sample:





The sample file in the repo has everything I use and one thing I don't 
(pending/cleared symbols on the top line of a transaction).

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Checking for Tag Value in Automated Transaction

2018-07-27 Thread Scott Carpenter
I don't know if this should be any different, but I always query on tags 
with the % symbol, e.g.

%BudgetType=Foo


On Friday, July 27, 2018 at 12:56:13 AM UTC-5, Brandon Olivares wrote:
>
> Hello, 
>
> I have an automated transaction where I'm wanting to split up income into 
> different envelope categories when received, based on the value of a tag 
> set on income transactions. 
>
> Here's what I tried: 
>
> = /^Budget:Available:Income/ and tag BudgetType=Debt 
>
> And it works as long as BudgetType is set, but it doesn't care what the 
> value is. If I set BudgetType=Foo, it still works. 
>
> How can I test the tag value? 
>
> Thanks, 
> Brandon

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Doc update for transaction state/status

2018-07-09 Thread Scott Carpenter
Argh! Sorry about that and than you, Martin!

On Sunday, July 8, 2018 at 5:21:05 PM UTC-5, Martin Michlmayr wrote:
>
> * Scott Carpenter > [2018-07-08 15:10]: 
> > All right, please let me know if I've failed miserably: 
>
> The PR includes some merges that shouldn't be there. 
>
> And you removed some trailing whitespace, which shouldn't be done or 
> should be done in a separate patch.  But shouldn't be done when 
> there's a command: 
>
>  @c Note: The output needs a space character at the end 
>  @c   for this test to pass 
>
> :) 
>
> I'll apply manually with your name on it.  Thanks! 
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Doc update for transaction state/status

2018-07-08 Thread Scott Carpenter
All right, please let me know if I've failed miserably:

https://github.com/ledger/ledger/pull/1665

Thanks, Martin!

On Sunday, July 8, 2018 at 5:00:25 PM UTC-5, Scott Carpenter wrote:
>
> Thank you, Martin. I already have a fork so will learn how to update the 
> fork. (I previously updated, should be able to do again.) Let me dabble a 
> bit and will see if I can manage. :-)
>
> On Sunday, July 8, 2018 at 4:53:45 PM UTC-5, Martin Michlmayr wrote:
>>
>> * Scott Carpenter  [2018-07-08 14:50]: 
>> > I'd be happy to learn. (I would take pride in having my name in the 
>> > contributor list!) 
>>
>> 1. Go to https://github.com/ledger/ledger 
>> 2. Click "fork" on the upper right corner 
>> 3. You'll end up with your own fork at https://github.com/USER/ledger 
>> 4. On the command line, check out with 
>>   git clone g...@github.com:USER/ledger 
>> 5. cd ledger 
>> 6. git checkout -b manual 
>> 7. edit file 
>> 8. git commit -a 
>> 9. git push origin 
>> 10. GitHub should allow you to do a PR 
>>
>> -- 
>> Martin Michlmayr 
>> https://www.cyrius.com/ 
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Doc update for transaction state/status

2018-07-08 Thread Scott Carpenter
Thank you, Martin. I already have a fork so will learn how to update the 
fork. (I previously updated, should be able to do again.) Let me dabble a 
bit and will see if I can manage. :-)

On Sunday, July 8, 2018 at 4:53:45 PM UTC-5, Martin Michlmayr wrote:
>
> * Scott Carpenter > [2018-07-08 14:50]: 
> > I'd be happy to learn. (I would take pride in having my name in the 
> > contributor list!) 
>
> 1. Go to https://github.com/ledger/ledger 
> 2. Click "fork" on the upper right corner 
> 3. You'll end up with your own fork at https://github.com/USER/ledger 
> 4. On the command line, check out with 
>   git clone g...@github.com:USER/ledger 
> 5. cd ledger 
> 6. git checkout -b manual 
> 7. edit file 
> 8. git commit -a 
> 9. git push origin 
> 10. GitHub should allow you to do a PR 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Doc update for transaction state/status

2018-07-08 Thread Scott Carpenter
I'll accept tips but I should be able to figure this out. :-)


On Sunday, July 8, 2018 at 4:50:45 PM UTC-5, Scott Carpenter wrote:
>
> I'd be happy to learn. (I would take pride in having my name in the 
> contributor list!)
>
> On Sunday, July 8, 2018 at 4:44:58 PM UTC-5, Martin Michlmayr wrote:
>>
>> * Scott Carpenter  [2018-07-08 13:39]: 
>> > I'd proudly make a PR for this if I understood forks. See: 
>>
>> Do you want to learn how to or should I just fix it directly? 
>>
>> > I believe this should be: 
>>
>> Yes, good catch. 
>>
>> -- 
>> Martin Michlmayr 
>> https://www.cyrius.com/ 
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Doc update for transaction state/status

2018-07-08 Thread Scott Carpenter
I'd be happy to learn. (I would take pride in having my name in the 
contributor list!)

On Sunday, July 8, 2018 at 4:44:58 PM UTC-5, Martin Michlmayr wrote:
>
> * Scott Carpenter > [2018-07-08 13:39]: 
> > I'd proudly make a PR for this if I understood forks. See: 
>
> Do you want to learn how to or should I just fix it directly? 
>
> > I believe this should be: 
>
> Yes, good catch. 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Doc update for transaction state/status

2018-07-08 Thread Scott Carpenter
I'd proudly make a PR for this if I understood forks. See:

https://github.com/ledger/ledger/blob/next/doc/ledger3.texi#L2913

A transaction can have a ``state'': cleared, pending, or uncleared.  The
default is uncleared.  To mark a transaction cleared, put an asterisk
@samp{*} before the payee, after the date or code:

I believe this should be:

A transaction can have a ``state'': cleared, pending, or uncleared.  The
default is uncleared.  To mark a transaction cleared, put an asterisk
@samp{*} after the date, before the code or payee:

In testing, this isn't valid:

2018/07/08 (123) * payee name


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: information request

2018-07-08 Thread Scott Carpenter
It may be helpful to create a sample file with a simple structure with 
which you can experiment, for example:

expenses: fruit: apple: red: minnesota
expenses: fruit: apple: red: wisconsin
expenses: fruit: apple: yellow: fu
expenses: fruit: apple: yellow: bar

And then you can make some transactions where you can play with --depth to 
see how you can summarize things.

The account structure with colons simple defines a a tree structure as 
Craig said. Then, --depth lets you define how far down in the tree you want 
to report on. If you specified --depth 4 with above, you'd get totals for 
red and yellow apples for all states or fu or bar or whatever designation.

On Sunday, July 8, 2018 at 6:49:03 AM UTC-5, Ajoeibin wrote:
>
>
>
> On Sat, Jul 7, 2018 at 9:13 PM, Craig Earls  > wrote:
>
>> I will answer this on a laptop.  
>>
>> edger will scan all of the account lines in the file and structure them 
>> in a tree.  The "root" of the tree is the least specific, down to the 
>> "leaves" of the tree which it the most specific.
>>
>> I don't completely understand the account hierarchy you are using.  There 
>> seems to be some redundancy in the structure, this could hurt you.
>>
>
> The account structure that I am using is based on this document:
>
> https://www.canada.ca/en/revenue-agency/services/forms-publications/publications/rc4088/general-index-financial-information-gifi.html
>
> I copied the document a number of years ago into a file and then started 
> adding my own extensions. My present list of accounts runs to over 35 pages.
> The account structure was set up to get me maximum clarity in my 
> transaction logging. Each product owned is trackable this is for business 
> management.
> The human readable form on the account (the words) is there to make it 
> very easy to read what the account is for. There seldom is any hierarchy in 
> these word(s) or phrase.
>
>
>> But I think you have answered your question, your breakdown should be
>>
>> 9350 - meta account
>> 10 - 1st level sub-account
>> 51 - designates fuel
>> 01 - designates a particular kind of fuel
>>
>>>
>>>
>>>
>>> On Sat, Jul 7, 2018 at 7:03 PM, o1bigtenor >> > wrote:
>>>


 On Sat, Jul 7, 2018 at 5:23 PM, Craig Earls >>> > wrote:

> Yes. You would have to use the whole account name down to the level 
> you want. For example:
>
> Ledger reg Expense: fuel - gas - clear: 9350: 10: 51: 01
>
> With whatever time limits you want gives you only what is in that 
> complete account
>
> Ledger reg Expense: fuel - gas - clear: 9350
>
> Gives you everything under 9350
>
> OK  - - - but fuel - gas - clear actually refers to the whole number - 
 - 
 all of 9350: 10: 51: 01. 9350 as a 'meta' account (if I'm allowed to 
 use that term) 
 is all of the sub-accounts under 9350 rolled into one.

 Does this mean that I should be writing the accounts as something like 
 this:

 9350: 10: 51: 01 : fuel - gas - clear 

 where breakdown is something like:

 9350 - meta account
 10 - 1st level sub-account
 51 - designates fuel
 01 - designates a particular kind of fuel


 For the second part (your query) could it be written as 
 ledger reg Expense: 9350

 ie can I query without using the text portion?
 (That would be the easiest for combining the sub-accounts back into 
 their 'tax' 
 accounts (which in this case is '9350').

 Thanking you for your assistance and consideration!

 Dee

 -- 

 --- 
 You received this message because you are subscribed to the Google 
 Groups "Ledger" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to ledger-cli+...@googlegroups.com .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>> Craig, Corona De Tucson, AZ
>>> [image: missile_flyout]
>>> enderw88.wordpress.com
>>>
>>> -- 
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ledger" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to ledger-cli+...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> The text portion you had, "fuel - gas - clear"  seems to repeat the 
>> numerical structure.  But, when I looked more closely at the transaction 
>> you had above "fuel" didn't seem to correlate to "10".
>>
>> What I am trying to discover right now is what sequence to 'write' the 
> codes.
>
> 1 . Should I be writing the code like this:
>
> Expense: fuel - gas - clear: 9350: 10: 51: 01
>
> or:
>
> Expense: 9350: 10: 51: 01: fuel - gas - clear
>
> or does it even matter?
>
> I just took some time and tried using your suggested query.
> Really fascinating - - - like seriously
>
> 9350 is one of my 'busier' accounts (a few pages of responses to the query)
> 

Re: Multiple metadata values?

2018-07-04 Thread Scott Carpenter
The way I'm understanding it from today's conversations and experimenting 
is that you can only have one tag/value in a comment

; tag: value

Anything after that is ignored.

My trend over the years is to simplify things, but my finances are super 
boring. :-)

On Wednesday, July 4, 2018 at 3:19:11 PM UTC-5, Ajoeibin wrote:
>
> On Wed, Jul 4, 2018 at 2:13 PM, Scott Carpenter  > wrote: 
> > Re: formatting, posting in Chrome (and I'm guessing other browsers will 
> do 
> > the same), I get some formatting controls and use Courier New for ledger 
> > entries. 
> > 
> > As far as using tags and values, I don't think they will do what you 
> want. 
> > For example: 
> > 
> > ; 9764: 9764: 01: 04: 00 
> > 
> > Ledger will treat that as a tag named 9764 with value 9764 and ignore 
> the 
> > rest. (As far as I can tell.) 
> > 
> Oops - - - -that was an entry error. There should not be 9764 two 
> times - - - only once. 
>
> Would that change things? 
>
> Dee 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple metadata values?

2018-07-04 Thread Scott Carpenter
Re: formatting, posting in Chrome (and I'm guessing other browsers will do 
the same), I get some formatting controls and use Courier New for ledger 
entries.

As far as using tags and values, I don't think they will do what you want. 
For example:

; 9764: 9764: 01: 04: 00

Ledger will treat that as a tag named 9764 with value 9764 and ignore the 
rest. (As far as I can tell.)



On Wednesday, July 4, 2018 at 8:36:46 AM UTC-5, Scott Carpenter wrote:
>
> I suspect the answer to this is "no," but: can you have multiple metadata 
> values for a line item?
>
> E.g.
>
> 2018/07/04 something
> e: something; fu: bar ; sna: fu
> a: cash $-50
>
> In this case, the second semicolon appears to terminate the first tag:
>
> $ ledger -f temp.ldg bal %fu=bar
>   $50.00  e: something
>
> But nothing is returned for the second:
>
> ledger -f temp.ldg bal %sna=fu
>
> This also works for fu: bar, but not apple or banana:
>
> 2018/07/04 something
> e: something; fu: bar :apple:banana:
> a: cash $-50
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple metadata values?

2018-07-04 Thread Scott Carpenter
And I see now that it's only top line and before line item comments that 
get attached to all items, and trailing comments are attached just to the 
preceding item, which makes sense and is great.

2018/07/04 something  ; top line
; next line
e: a thing  $30
; belongs to a thing
e: another thing$20
; belongs to another thing
; fu: bar
; sna: fu
a: cash $-50

Comes out as:

"2018/07/04","","something","e: a thing","$","30",""," belongs to a thing 
top line\n next line"
"2018/07/04","","something","e: another thing","$","20",""," belongs to 
another thing\n fu: bar\n sna: fu top line\n next line"
"2018/07/04","","something","a: cash","$","-50",""," top line\n next line"

Which makes sense and I'm much happier to better understand ledger's 
comments now.


On Wednesday, July 4, 2018 at 10:31:22 AM UTC-5, Scott Carpenter wrote:
>
> That's awesome! Thank you, Martin!
>
> I had noticed recently while experimenting with csv exports that comments 
> on a line by themselves get glommed with other entries so that would have 
> inclined me not to think of those as applying to the previous line. And I 
> wouldn't have thought of this in any case, so thanks again. :-)
>
> Scott
>
> On Wednesday, July 4, 2018 at 10:19:13 AM UTC-5, Martin Michlmayr wrote:
>>
>> * Scott Carpenter  [2018-07-04 06:36]: 
>> > I suspect the answer to this is "no," but: can you have multiple 
>> metadata 
>> > values for a line item? 
>>
>> Yes, but they have to be on separate lines: 
>>
>> 2018/07/04 something 
>> e: something 
>>; fu: bar 
>>; sna: fu 
>> a: cash $-50 
>>
>> -- 
>> Martin Michlmayr 
>> https://www.cyrius.com/ 
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple metadata values?

2018-07-04 Thread Scott Carpenter
That's awesome! Thank you, Martin!

I had noticed recently while experimenting with csv exports that comments 
on a line by themselves get glommed with other entries so that would have 
inclined me not to think of those as applying to the previous line. And I 
wouldn't have thought of this in any case, so thanks again. :-)

Scott

On Wednesday, July 4, 2018 at 10:19:13 AM UTC-5, Martin Michlmayr wrote:
>
> * Scott Carpenter > [2018-07-04 06:36]: 
> > I suspect the answer to this is "no," but: can you have multiple 
> metadata 
> > values for a line item? 
>
> Yes, but they have to be on separate lines: 
>
> 2018/07/04 something 
> e: something 
>; fu: bar 
>; sna: fu 
> a: cash $-50 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bug with --flat and --depth?

2018-06-26 Thread Scott Carpenter
Ah, that looks like it. Thank you.

On Tuesday, June 26, 2018 at 9:03:45 AM UTC-5, Martin Michlmayr wrote:
>
> * Scott Carpenter > [2018-06-26 06:13]: 
> > With this data: 
>
> I think this is the same as 
> https://github.com/ledger/ledger/issues/1020 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bug with --flat and --depth?

2018-06-26 Thread Scott Carpenter
I started looking at csv exports which is maybe something I should be using 
anyway, but I see there the same issue with --depth, e.g.:

$ ledger csv -f temp.ldg --depth 2
"2018/06/26","","store","abc: def","$","100","",""

However! Going back to my other post with data like this:

2018/06/26 store
abc $50
abc: def$100
lmnop: qrs: tuv

That comes out much better when not using --depth:

"2018/06/26","","store","abc","$","50","",""
"2018/06/26","","store","abc: def","$","100","",""
"2018/06/26","","store","lmnop: qrs: tuv","$","-150","",""

So I can look at doing my own depth management.


On Tuesday, June 26, 2018 at 8:13:56 AM UTC-5, Scott Carpenter wrote:
>
> With this data:
>
> 2018/06/26 store
> abc: def$100
> lmnop: qrs: tuv
>
> bal --depth 2 results in:
>
> $100  abc: def
>$-100  lmnop: qrs
> 
>0
>
> But bal --depth 2 --flat gives:
>
> $100  abc: def
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Bug with --flat and --depth?

2018-06-26 Thread Scott Carpenter
With this data:

2018/06/26 store
abc: def$100
lmnop: qrs: tuv

bal --depth 2 results in:

$100  abc: def
   $-100  lmnop: qrs

   0

But bal --depth 2 --flat gives:

$100  abc: def

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Prevent totaling in --flat balance report?

2018-06-26 Thread Scott Carpenter
Thanks, Taylor. That's probably the best advice re: account usage. I just 
had one account that I recently extended with a sub-account that had this 
problem, so I changed my setup. 

(I have a grid program that shows things by years that could exhibit the 
same behavior. Perhaps I need to use ledger's grand total rather than my 
own, which will at least hint at the discrepancy.)



On Monday, June 25, 2018 at 7:59:41 PM UTC-5, Taylor R Campbell wrote:
>
> > Date: Mon, 25 Jun 2018 15:00:56 -0700 (PDT) 
> > From: Scott Carpenter > 
> > 
> > When I say prevent totaling, I'm not speaking of the bottom line $150, 
> but 
> > the top line. I'd like to get this result: 
> > 
> >  $50  abc 
> > $100  abc: xyz 
> >  
> > $150 
> > 
> > Which seems more intuitively what I'd expect,  at least for a flat 
> report. 
> > Is this a thing that can happen? 
>
> I wanted this recently.  My solution was to use `abc: balance' instead 
> of unadorned `abc', and in general to never put funds into accounts 
> that have children. 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Prevent totaling in --flat balance report?

2018-06-25 Thread Scott Carpenter
Supposing we have:

2018/06/25 store
abc $50
abc: xyz$100
lmnop   $-150

And we run *bal --flat abc* on this:

$150  abc
$100  abc: xyz

$150

When I say prevent totaling, I'm not speaking of the bottom line $150, but 
the top line. I'd like to get this result:

 $50  abc
$100  abc: xyz

$150

Which seems more intuitively what I'd expect,  at least for a flat report. 
Is this a thing that can happen?

Thank you!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advanced reporting

2018-06-19 Thread Scott Carpenter
Ah, perhaps you already know perfectly well about that site. I just went to 
look at the github repo for it and see your name there. :-)

On Tuesday, June 19, 2018 at 6:44:08 AM UTC-5, Scott Carpenter wrote:
>
> There is lots of stuff here, that may provide ideas, too:
>
> https://plaintextaccounting.org
>
> Someone kindly added my python tool there, ledgerbil, with which I crudely 
> extend ledger for my own purposes. In some cases I wrap ledger, capturing 
> its output and reformatting/calculating things, e.g a grid to show expenses 
> over months or years, or an investment view that puts number of shares 
> together with the value of them. In others I read the ledgerfile and do my 
> own stuff with the data (there is a scheduler that adds recurring 
> transactions, and an interactive reconciler).
>
> John's comment here makes me wonder if I'd be better off taking csv output 
> from ledger for some of the stuff I do.
>
> Anyway, this isn't to promote my program so much as point you at the 
> goodies at that site. I could certainly benefit from studying them more, 
> although I greatly enjoy just making things up from scratch, too.
>
> Scott
>
> On Sunday, June 17, 2018 at 5:51:31 PM UTC-5, Colin Dean wrote:
>>
>> So far, most of my needs for reporting have been satisfied by simple 
>> balance reporting, sometimes with some custom formatting.
>>
>> For some more advanced stuff, I've got a Ruby script that captures the 
>> output of a few ledger balance reports and then runs some further 
>> calculations. For example, I want to sum the total expenses of a few 
>> accounts, half of the expenses of another few accounts, and then some more 
>> complex logic for some others. Is there a way to do this within ledger?
>>
>> Next up, I want to try to calculate my savings rate. Is there something 
>> that would let me effectively capture the output of two balance reports? 
>> E.g. ledger bal --start "Jan 1" (Assets / (Income - Expenses:Taxes))
>>
>> I'm working up in my head some kind of wrapper around ledger that would 
>> let me define simple and complex reports in some kind of manifest format 
>> and then dump that output to a nice-looking report. I've kinda already 
>> cobbled something together for the non-profit for which I use ledger, but I 
>> want to refactor it into something more maintainable than a 1000 line 
>> Makefile ;-)
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advanced reporting

2018-06-19 Thread Scott Carpenter
There is lots of stuff here, that may provide ideas, too:

https://plaintextaccounting.org

Someone kindly added my python tool there, ledgerbil, with which I crudely 
extend ledger for my own purposes. In some cases I wrap ledger, capturing 
its output and reformatting/calculating things, e.g a grid to show expenses 
over months or years, or an investment view that puts number of shares 
together with the value of them. In others I read the ledgerfile and do my 
own stuff with the data (there is a scheduler that adds recurring 
transactions, and an interactive reconciler).

John's comment here makes me wonder if I'd be better off taking csv output 
from ledger for some of the stuff I do.

Anyway, this isn't to promote my program so much as point you at the 
goodies at that site. I could certainly benefit from studying them more, 
although I greatly enjoy just making things up from scratch, too.

Scott

On Sunday, June 17, 2018 at 5:51:31 PM UTC-5, Colin Dean wrote:
>
> So far, most of my needs for reporting have been satisfied by simple 
> balance reporting, sometimes with some custom formatting.
>
> For some more advanced stuff, I've got a Ruby script that captures the 
> output of a few ledger balance reports and then runs some further 
> calculations. For example, I want to sum the total expenses of a few 
> accounts, half of the expenses of another few accounts, and then some more 
> complex logic for some others. Is there a way to do this within ledger?
>
> Next up, I want to try to calculate my savings rate. Is there something 
> that would let me effectively capture the output of two balance reports? 
> E.g. ledger bal --start "Jan 1" (Assets / (Income - Expenses:Taxes))
>
> I'm working up in my head some kind of wrapper around ledger that would 
> let me define simple and complex reports in some kind of manifest format 
> and then dump that output to a nice-looking report. I've kinda already 
> cobbled something together for the non-profit for which I use ledger, but I 
> want to refactor it into something more maintainable than a 1000 line 
> Makefile ;-)
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Register: use expressions to filter amounts?

2018-06-16 Thread Scott Carpenter
Thanks, guys! Works like a charm.

On Saturday, June 16, 2018 at 12:08:05 PM UTC-5, Craig Earls wrote:
>
> —limit “(amount>200)”
>
> That’s a hint. And a clause limit the commodity might be necessary as well
>
> On Sat, Jun 16, 2018 at 07:28 Scott Carpenter  > wrote:
>
>> I'd like to be able to run a register query and specify greater than or 
>> less than 
>> comparisons for the amounts, e.g. show me all entries > $200.
>>
>> On a cursory look through the doc, I see this:
>>
>> report -J -l "Ua>={\$0.01}" reg ^assets ^liab
>>
>>
>> But I'm not seeing a way to do it with a standard register query. Seems like 
>>
>> there would be a way to use an expression here, similar to date
>>
>> expressions like -d "d>[2018/01/01]"
>>
>>
>> Any hints?
>>
>>
>> Thanks!
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ledger" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ledger-cli+...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Craig, Corona De Tucson, AZ
> [image: missile_flyout]
> enderw88.wordpress.com
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Register: use expressions to filter amounts?

2018-06-16 Thread Scott Carpenter
I'd like to be able to run a register query and specify greater than or 
less than 
comparisons for the amounts, e.g. show me all entries > $200.

On a cursory look through the doc, I see this:

report -J -l "Ua>={\$0.01}" reg ^assets ^liab


But I'm not seeing a way to do it with a standard register query. Seems like 

there would be a way to use an expression here, similar to date

expressions like -d "d>[2018/01/01]"


Any hints?


Thanks!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How close an account?

2018-05-08 Thread Scott Carpenter
Nice! This is a good thing to know about. I see there is also "assert" 
which causes an error instead of a warning. Thanks.

On Monday, May 7, 2018 at 1:01:53 PM UTC-5, Martin Michlmayr wrote:
>
> * Aikido Guy  [2018-05-07 08:15]: 
> > I tried searching this group for "close an account" and did not find 
> > any related messages. I also tried reading the user manual for 
> > ledger 3.1.1 but could not find something appropriate... 
> > 
> > Is it possible to close an account"? 
>
> Beancount has a "close" statement to close accounts. 
>
> Ledger doesn't have such a statement.  However, you can define 
> accounts and list a number of checks, see 
> https://www.ledger-cli.org/3.0/doc/ledger3.html#Command-Directives 
>
> The following does what you want: 
>
> account Expenses:Food 
> note This account is all about the chicken! 
> check date >= [2016-02-03] 
> check date <= [2017-03-03] 
>
> -- 
> Martin Michlmayr 
> http://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ledger2beancount: ledger to beancount converter

2018-03-31 Thread Scott Carpenter
I love this discussion! I think I sounded more sour on beancount than was 
warranted -- I'm also excited about the community around ledger and plain 
text accounting and that people are making other tools. And as someone who 
loves Python and is writing my own helpers for ledger, I should be looking 
at beancount to learn things! (Currently I'm working on a qif importer to 
bring in 12 years of MS Money data and 5 years of KMyMoney.)

I suspect I have little to worry about with long term ledger maintenance -- 
I use a fairly small set of features for my personal finances.

As for the spaces, I could probably adapt to dashes, but I like the 
readability with spaces, even using them after colons, e.g.:

2017/11/30 johnny paycheck
i: wages: gross pay $-2,100
i: wages: employer match$-63
e: taxes: federal   $171.46
e: taxes: state $126.66
e: taxes: social security   $130.2
e: taxes: medicare  $30.45
e: healthcare: medical insurance$231.89
a: 401k: cash   ($126 + $63)
a: fsa  $41.67
a: checking $1,241.67

Using Sublime Text I've even gone all in with syntax highlighting. (Which 
isn't space related, of course.) :-)




On Saturday, March 31, 2018 at 3:13:09 AM UTC-5, Martin Michlmayr wrote:
>
> * Stefano Zacchiroli  [2018-03-31 10:02]: 
> > Maybe you can elaborate on why not supporting spaces in account names 
> > bothered you? I also had to migrate to '-' as I had spaces in my Ledger 
> > account names, but in the end I realized dashes are better anyway: they 
> > don't get in the way of dumb text processing of your ledger, like grep, 
> > sed, and the like. Just curious :) 
>
> I can't speak for Scott but I think it's just what you're used to. 
> I'm slowly getting used to the dashes and, as you say, they make 
> parsing and stuff easier.  But "Liabilities:Credit-Card" looks weird 
> when you're used to "Liabilities:Credit Card".  I'm sure I will get 
> used to it in a few weeks though. 
>
> In general, ledger is *extremely* permissive in what it allows.  For 
> example, Assets:♚_DASD!;?@#$!%^& *"(*(0-;♚ds is a perfectly valid 
> account name in ledger.  So I believe people moving from ledger to 
> beancount might feel restricted in what they can do. 
>
> Then again, I'm using the opportunity to clean up my account and 
> commodity names, for example moving from "M" in ledger to MILESMORE 
> in beancount.  It will take some time getting used to the new names 
> but in general I think I'll prefer them more longterm (quoted 
> commodities in ledger are not ideal anyway because you have to 
> double-quote them). 
>
> -- 
> Martin Michlmayr 
> http://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ledger2beancount: ledger to beancount converter

2018-03-30 Thread Scott Carpenter
Well I don't have any preference for which format of ledger lives on, be it 
C++ or Haskell or whatever, but I certainly hope that something will be 
maintained long term that supports the classic ledger file. I looked 
briefly at BeanCount but seem to recall being turned off by things like not 
allowing spaces in account names? (Was going to double-check but can't seem 
to load its web page right now.)

Scott

On Friday, March 30, 2018 at 10:01:36 AM UTC-5, Martin Michlmayr wrote:
>
> * Marcin Borkowski  [2018-03-30 16:15]: 
> > That sounds interesting.  I have one question: why would I want to 
> > migrate to beancount? 
> > 
> > Actually, one possible answer is the existence of a Web UI 
>
> I'm a command-line person myself and use ledger reg and bal all the 
> time and I was completely surprised by how much I like the web UI.  It 
> makes things so much simpler.  I can click on some account names and 
> navigate around very easily.  And it offers charts, so I can actually 
> *see* what's going on.  It's very interesting to see the pattern on 
> some accounts (e.g. the spike once a month when your salary comes in, 
> or the spike in the other direction when you pay rent ;)  And money 
> coming into a pension and then being invested a few days later). 
> Fava doesn't do everything I want yet but the developers are *very* 
> responsive. 
>
> I don't know what Emacs' ledger-mode is like, but compared to the 
> command-line I really love the web UI.  And you can still do 
> command-line stuff in bean-count since it has a powerful SQL-inspired 
> language. 
>
> Anyway, I think it's a personal choice, but there are a number of 
> reasons I'm in the process of moving from ledger to beancount: 
>
> * Python interface: beancount has a powerful Python interface, so you 
>   can do interesting things with your data.  Ledger has a very basic 
>   Python interface and I've been waiting for years for it to get 
>   better but nobody is working on it. 
> * Written in Python: this makes it more likely I can fix bugs myself 
> * More maintained: John has done a fantastic job creating ledger but 
>   he's very clear that he has little interest in working on the C++ 
>   code base.  Martin Blais (the maintainer of beancount) is quite busy 
>   too but I think there's more chance of a community forming around 
>   beancount. 
> * Web UI (fava), truly the "killer app" for beancount 
> * Great documentation 
> * Great design (clear data structures, solid documentation, cleare 
>   syntax, etc) 
>
> Again, ledger is fantastic.  I've used it since 2010 and I'm very 
> grateful to John for creating ledger and introducing the idea of 
> text-based accounting.  But from my POV, beancount is the way forward 
> and I intend to focus my efforts there. 
>
> -- 
> Martin Michlmayr 
> http://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Customizable grapical reporting tool for ledger

2018-03-28 Thread Scott Carpenter
Looks nice! I've been thinking about my graphing options and will keep this 
in mind.

Scott

On Tuesday, March 27, 2018 at 11:23:40 AM UTC-5, Dániel Kántor wrote:
>
> Hello fellow ledger users!
>
> I'm working on a graphical reporting tool for ledger. I appreciate any 
> feedback, feature request or contribution :-)
>
> It's more like a starting point/framework that can be customized to suit 
> personal needs. It's a desktop app, that can be invoked from the terminal:
>
> ./dashboard.sh book.txt USD
>
>
> As you can see, the input file can be specified and also the currency to 
> use in the reports. (-X)
>
> You can try it right now here: 
> https://github.com/kantord/ledger-cli-dashboard
>
> Here's a screenshot of it in action:
>
>
> 
>
>
>
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Payee reporting

2018-03-01 Thread Scott Carpenter
Nice -- thank you, Craig.

On Thursday, March 1, 2018 at 8:40:48 PM UTC-6, Craig Earls wrote:
>
>
> ledger --group-by "(payee)" --subtotal reg Expenses --collapse
>
> On Thu, Mar 1, 2018 at 18:53 Scott Carpenter <scarp...@gmail.com 
> > wrote:
>
>> Next up on my ledgerbil reporting list is reporting by payees, e.g. for 
>> expenses on a monthly or yearly basis, showing payee totals.
>>
>> I don't think there are a lot of built-in options for this but figured I 
>> should ask first before doing the work. I'm thinking I'll need to go 
>> through payees and run ledger for each individually.
>>
>> Thanks for any and all insight!
>>
>>
>>
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ledger" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ledger-cli+...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Payee reporting

2018-03-01 Thread Scott Carpenter
Next up on my ledgerbil reporting list is reporting by payees, e.g. for 
expenses on a monthly or yearly basis, showing payee totals.

I don't think there are a lot of built-in options for this but figured I 
should ask first before doing the work. I'm thinking I'll need to go 
through payees and run ledger for each individually.

Thanks for any and all insight!




-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger tabular report

2018-02-25 Thread Scott Carpenter
Thanks, guys. (I eventually moved the accounts to the right side as ledger 
does.)

The sort feature mainly works with the scheduler feature, although also is 
nice just to keep things in order.

Rather than using ledger's budgeting feature, I like how other programs 
I've used allow you to enter future recurring transactions up to N days 
ahead.

ledgerbil's scheduler uses a journal file that is a valid ledger file, but 
uses a comment line to define a recurrence:

2018/03/17 chop chop hair
;; schedule ; weekly ;; every 6 weeks
e: misc: haircuts
l: credit card: mega$-18

When you run the scheduler it does all the math and adds the entries to the 
end of a regular journal file (without the comment line) and then sorts 
that file to put them all in order.

I have a commit script that validates the ledger file is valid, and then 
uses another ledgerbil feature to find the next scheduled date and decide 
if it should run the scheduler, outputting something like if so:

next scheduled date: 2018/04/06 (39 days)
Schedule file (enter days = 40):
2018-04-06 johnny paycheck

Then when I check the register for the account that handles my main cash 
flow, I can verify there is enough money to cover expenses for the next 
month+.

Thanks for your question! I'm quite happy working on this as a personal 
program but would be happy if others found it useful. The reason I say it's 
limited to my own usage is that I generally develop and test with ledger 
features in mind that I'm using, and I probably use a small subset of 
ledger's bounty. :-) I do keep in mind other things I see in the ledger 
docs, but I certainly haven't accounted for many things.

Scott


On Sunday, February 25, 2018 at 2:26:27 AM UTC-6, Jostein Berntsen wrote:
>
> On 20.02.18,22:04, Scott Carpenter wrote: 
> > My ledgerbil python program is somewhat limited to my own usage, but I'm 
> > pleased with this "grid" report: 
> > 
> > $ ledgerbil grid expenses 
> >   2017   
> > 2018 total 
> > expenses: car: gas  $ 0.00   $ 
> > 17.37   $ 17.37 
> > expenses: car: maintenance  $ 0.00$ 
> > 6.50$ 6.50 
> > expenses: food: dining out  $ 0.00   $ 
> > 42.17   $ 42.17 
> > expenses: food: groceries  $ 34.63   $ 
> > 57.40   $ 92.03 
> > expenses: healthcare: medical insurance   $ 463.78$ 
> > 0.00  $ 463.78 
> > expenses: home: stuff: in  $ 10.00$ 
> > 0.00   $ 10.00 
> > expenses: taxes: federal  $ 342.92$ 
> > 0.00  $ 342.92 
> > expenses: taxes: medicare  $ 60.90$ 
> > 0.00   $ 60.90 
> > expenses: taxes: social security  $ 260.40$ 
> > 0.00  $ 260.40 
> > expenses: taxes: state$ 253.32$ 
> > 0.00  $ 253.32 
> >      
> >    
> > $ 1,425.95  $ 
> > 123.44$ 1,549.39 
> > 
> > 
> https://github.com/scarpent/ledgerbil/blob/master/ledgerbil/ledgershell/grid.py
>  
> > 
>
> This looks very nice. Do you have examples for other use cases for your 
> ledgerbil program like the sort feature? 
>
>
> Jostein 
>
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Ledger tabular report

2018-02-20 Thread Scott Carpenter
My ledgerbil python program is somewhat limited to my own usage, but I'm 
pleased with this "grid" report:

$ ledgerbil grid expenses
  2017  
2018 total
expenses: car: gas  $ 0.00   $ 
17.37   $ 17.37
expenses: car: maintenance  $ 0.00$ 
6.50$ 6.50
expenses: food: dining out  $ 0.00   $ 
42.17   $ 42.17
expenses: food: groceries  $ 34.63   $ 
57.40   $ 92.03
expenses: healthcare: medical insurance   $ 463.78$ 
0.00  $ 463.78
expenses: home: stuff: in  $ 10.00$ 
0.00   $ 10.00
expenses: taxes: federal  $ 342.92$ 
0.00  $ 342.92
expenses: taxes: medicare  $ 60.90$ 
0.00   $ 60.90
expenses: taxes: social security  $ 260.40$ 
0.00  $ 260.40
expenses: taxes: state$ 253.32$ 
0.00  $ 253.32
    
  
$ 1,425.95  $ 
123.44$ 1,549.39

https://github.com/scarpent/ledgerbil/blob/master/ledgerbil/ledgershell/grid.py

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: --collapse behavior

2018-02-19 Thread Scott Carpenter
Interesting -- had I known about .ledgerrc, my bash aliases could have been 
much simplified. :-)

I started using --market to avoid seeing different commodity amounts, and 
getting output like this (without the rc file):

--market --yearly --collapse reg



--market --yearly --collapse reg ^e

17-Jan-01 - 17-Dec-31$44.63  $44.63
18-Jan-01 - 18-Dec-31$81.27 $125.90

--market --yearly --collapse reg ^a

17-Jan-01 - 17-Dec-31   $-11.76 $-11.76

And then with your rc --empty setting, I get:

--market --yearly --collapse reg --empty

17-Jan-01 - 17-Dec-31 0   0
18-Jan-01 - 18-Dec-31 0   0

With similar test data I had a scenario where I'd only get data for the 
year that has investment stuff. I tried several variations with rc settings 
as in your file but --empty was the only thing that made a difference.

And --empty might do the job for me since all I'm trying to do is determine 
what years have data for a given set of filters.

Thanks again for your help!

Scott

On Monday, February 19, 2018 at 10:29:38 AM UTC-6, Jostein Berntsen wrote:
>
> On 19.02.18,06:47, Scott Carpenter wrote: 
> > Thank you, Jostein. I don't  have a ~/.ledgerrc file but created an 
> empty 
> > one. Any suggested settings? 
> > 
>
> Here is my ledgerrc settings: 
>
> --file ~/ledger/jbfinans-2018.dat 
> --pager more 
> --no-color 
> --empty 
> --wide 
> --date-format=%Y-%m-%d 
> LEDGER_BASE_CURRENCY: NOK 
> LEDGER_PRICE_DATE_FORMAT: %Y-%m-%d 
>
>
> Jostein 
>
>
> > Experimenting a bit more, if I add other other commodities, e.g. this 
> entry: 
> > 
> > 2017/11/15 zombie investments 
> > a: 401k: big co 500 idx 1.745 abcdx @   
> >  $81.23 
> > a: 401k: bonds idx  2.357 lmnop @   
> >  $20.05 
> > a: 401k: cash   $-189 
> > 
> > Then I get output for --collapse, but only for that entry. 
> > 
> > 17-Nov-15 zombie investments$-189.00 
> > 1.745 abcdx 
> > 2.357 lmnop 
> >  $-189.00 
> > 
>  1.745 
> > abcdx 
> > 
>  2.357 
> > lmnop 
> > 
> > I get other stuff if specifying `reg '^e'`: 
> > 
> > 17-Nov-01 food and stuff  $32.87 
>   
> >  $32.87 
> > 17-Dec-05 food and stuffe: food: groceries   $11.76 
>   
> >  $44.63 
> > 18-Jan-03 gas n go$23.87 
>   
> >  $68.50 
> > 18-Jan-05 food and stuffe: food: groceries   $57.40 
>   
> > $125.90 
> > 
> > Thanks again. For my purposes this isn't really getting in the way but 
> > would be good to understand why this happens. (Especially if ledger is 
> > reporting incorrectly.) 
> > 
> > 
> > 
> > On Monday, February 19, 2018 at 8:01:09 AM UTC-6, Jostein Berntsen 
> wrote: 
> > > 
> > > On 18.02.18,10:26, Scott Carpenter wrote: 
> > > > Trying to use --collapse and it comes up empty on this data set: 
> > > > 
> > > > 2017/11/01 food and stuff 
> > > > e: food: groceries 
> > > > e: home: stuff: in  $10 
> > > > l: credit card: mega$-32.87 
> > > > 
> > > > 2017/12/05 food and stuff 
> > > > e: food: groceries 
> > > > a: checking out $-11.76 
> > > > 
> > > > 2018/01/03 gas n go 
> > > > e: car: gas 
> > > > e: car: maintenance $6.5 
> > > > l: credit card: mega$-23.87 
> > > > 
> > > > 2018/01/05 food and stuff 
> > > > e: food: groceries 
> > > > l: credit card: mega$-57.4 
> > > > 
> > > > 
> > > > Running: ledger -f  reg --collapse 
> > > > 
> > > > (Wanting to run it with --yearly, but empty either way when 
> --collapse 
> > > is 
> > > > added.) 
> > > > 
> > > > Works as expected with a larger "real" dataset. 
> > > > 
> > > > Any ideas or wisdom? Thank you! 
> > > > 
>

Re: --collapse behavior

2018-02-19 Thread Scott Carpenter
Thank you, Jostein. I don't  have a ~/.ledgerrc file but created an empty 
one. Any suggested settings?

Experimenting a bit more, if I add other other commodities, e.g. this entry:

2017/11/15 zombie investments
a: 401k: big co 500 idx 1.745 abcdx @  
 $81.23
a: 401k: bonds idx  2.357 lmnop @  
 $20.05
a: 401k: cash   $-189

Then I get output for --collapse, but only for that entry.

17-Nov-15 zombie investments$-189.00
1.745 abcdx
2.357 lmnop
 $-189.00
 1.745 
abcdx
 2.357 
lmnop

I get other stuff if specifying `reg '^e'`:

17-Nov-01 food and stuff  $32.87  
 $32.87
17-Dec-05 food and stuffe: food: groceries   $11.76  
 $44.63
18-Jan-03 gas n go$23.87  
 $68.50
18-Jan-05 food and stuffe: food: groceries   $57.40  
$125.90

Thanks again. For my purposes this isn't really getting in the way but 
would be good to understand why this happens. (Especially if ledger is 
reporting incorrectly.)



On Monday, February 19, 2018 at 8:01:09 AM UTC-6, Jostein Berntsen wrote:
>
> On 18.02.18,10:26, Scott Carpenter wrote: 
> > Trying to use --collapse and it comes up empty on this data set: 
> > 
> > 2017/11/01 food and stuff 
> > e: food: groceries 
> > e: home: stuff: in  $10 
> > l: credit card: mega$-32.87 
> > 
> > 2017/12/05 food and stuff 
> > e: food: groceries 
> > a: checking out $-11.76 
> > 
> > 2018/01/03 gas n go 
> > e: car: gas 
> > e: car: maintenance $6.5 
> > l: credit card: mega$-23.87 
> > 
> > 2018/01/05 food and stuff 
> > e: food: groceries 
> > l: credit card: mega$-57.4 
> > 
> > 
> > Running: ledger -f  reg --collapse 
> > 
> > (Wanting to run it with --yearly, but empty either way when --collapse 
> is 
> > added.) 
> > 
> > Works as expected with a larger "real" dataset. 
> > 
> > Any ideas or wisdom? Thank you! 
> > 
>
> It seems to work correctly with the bal and --collapse command, but not 
> with reg and --collapse. 
>
> Another similar thread from previously: 
>
> https://groups.google.com/forum/#!msg/ledger-cli/zwGRSJO376s/XpBUQbbmBAAJ 
>
> Can you check your ledgerrc settings, or copy one to ~ if you have no rc 
> file? 
>
>
>
> Jostein 
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--collapse behavior

2018-02-18 Thread Scott Carpenter
Trying to use --collapse and it comes up empty on this data set:

2017/11/01 food and stuff
e: food: groceries
e: home: stuff: in  $10
l: credit card: mega$-32.87

2017/12/05 food and stuff
e: food: groceries
a: checking out $-11.76

2018/01/03 gas n go
e: car: gas
e: car: maintenance $6.5
l: credit card: mega$-23.87

2018/01/05 food and stuff
e: food: groceries
l: credit card: mega$-57.4


Running: ledger -f  reg --collapse 

(Wanting to run it with --yearly, but empty either way when --collapse is 
added.)

Works as expected with a larger "real" dataset.

Any ideas or wisdom? Thank you!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Command to find a commodity's price on a specified date?

2018-01-15 Thread Scott Carpenter
Thank you, Martin! That works great. I'm mostly interested in year end 
prices so I can just use -p  and I'll get at least one, and easy 
enough to grab the last date in the list.

On Monday, January 15, 2018 at 9:45:54 AM UTC-6, Martin Michlmayr wrote:
>
> * Scott Carpenter <scarp...@gmail.com > [2018-01-15 07:34]: 
> > Is there a ledger command to find the price of a commodity on a date? It 
> > would look at both transaction files and prices db to find this. 
>
> The 'pricedb' command looks at both, so you can do 
>
>   ledger pricedb  
>
> and then maybe grep on the date? 
>
> Hmm, something like this seems to work: 
>
> ledger -f 2017 pricedb usd -p "from 2017/09/14 until 2017/09/15" 
>
> However, this assumes there's a pricedb entry on that day.  If it was 
> a few days earlier, it wouldn't show up. 
> -- 
> Martin Michlmayr 
> http://www.cyrius.com/ 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Command to find a commodity's price on a specified date?

2018-01-15 Thread Scott Carpenter
Is there a ledger command to find the price of a commodity on a date? It 
would look at both transaction files and prices db to find this.

Thanks!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Investment Report

2018-01-05 Thread Scott Carpenter
Hi, Everyone! I've been curious if I'm missing something. I run an 
investment report for dollars with -V:

  $ 1,740.94  assets
  $ 1,390.94 401k
$ 801.94   big co 500 idx
$ 400.00   bonds idx
$ 189.00   cash
$ 150.00 ira: glass idx
$ 200.00 mutual: total idx

  $ 1,740.94

And for shares with -X:

$ 189.00
 9.898 abcdx
20.000 lmnop
15.000 qwrty
 5.000 yyzxx  assets
$ 189.00
 9.898 abcdx
20.000 lmnop 401k
 9.898 abcdx   big co 500 idx
20.000 lmnop   bonds idx
$ 189.00   cash
15.000 qwrty ira: glass idx
 5.000 yyzxx mutual: total idx

$ 189.00
 9.898 abcdx
20.000 lmnop
15.000 qwrty
 5.000 yyzxx

I've spent considerable time in producing a combined report:

 $ 1,740.94   assets
 $ 1,390.94  401k
   9.898 abcdx $ 801.94big co 500 idx
  20.000 lmnop $ 400.00bonds idx
   $ 189.00cash
  15.000 qwrty $ 150.00  ira: glass idx
   5.000 yyzxx $ 200.00  mutual: total idx

Have I labored unnecessarily, or are there other options to get this?

Thanks!



-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tabular Reports?

2017-11-25 Thread Scott Carpenter
Thanks, Simon. I've been aware of hledger for a while, and taking a closer
look now. From what I'm reading, I optimistically expect my journal should
be compatible, too.

On Sat, Nov 25, 2017 at 9:10 AM, Simon Michael <si...@joyful.com> wrote:

> Hi Scott,
>
> hledger is good at this. Your journal is probably not hledger-compatible,
> but the output of ledger print probably is. So something like this may work:
>
> ledger print | hledger -f- bal -Y
>
>
>
> On 11/25/17 5:27 AM, Scott Carpenter wrote:
>
>> Thanks, John. I've been planning to write a helper for it but thought I
>> should check first!
>>
>> On Nov 25, 2017 1:33 AM, "John Wiegley" <jwieg...@gmail.com> wrote:
>>
>> "SC" == Scott Carpenter <scarpen...@gmail.com> writes:
>>>>>>>
>>>>>> SC> Is there a built-in way to get a tabular report? Say I want to
>> have
>> SC> categories and subcategories on the y-axis and years on the x,
>> something
>> SC> like:
>>
>> No, there is nothing built-in that will do this.
>>
>> John
>>
>>
>
> --
>
> --- You received this message because you are subscribed to a topic in the
> Google Groups "Ledger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/ledger-cli/-1Yh2DdzgWc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ledger-cli+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tabular Reports?

2017-11-25 Thread Scott Carpenter
Thanks, John. I've been planning to write a helper for it but thought I
should check first!

On Nov 25, 2017 1:33 AM, "John Wiegley" <jwieg...@gmail.com> wrote:

>>>>> "SC" == Scott Carpenter <scarpen...@gmail.com> writes:

SC> Is there a built-in way to get a tabular report? Say I want to have
SC> categories and subcategories on the y-axis and years on the x, something
SC> like:

No, there is nothing built-in that will do this.

John

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pricedb api data source?

2017-11-24 Thread Scott Carpenter
I used yahoo and then a google package but both had issues, so I modified 
my script to pull from finance.google.com. The json appeared to be broken 
so I used regex to extract price and date.

On Tuesday, November 7, 2017 at 8:36:25 AM UTC-6, Jim Robinson wrote:
>
> Hi Folks,
>
> Does anyone here have an alternative to the yahoo finance api for pulling 
> daily pricedb values?
>
> Looks like folks were abusing the yahoo site and they've shut down the 
> service.
>
> I could just plug in the data manually, but having an api I could kick off 
> periodically to pull down the dozen or so symbols was much nicer.
>
>
> Jim
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#!/usr/bin/env python

from __future__ import (absolute_import, division, print_function,
unicode_literals)

import argparse
import re
import sys
from datetime import datetime

from dateutil.relativedelta import relativedelta

import requests

quote_url = 'https://finance.google.com/finance?q={}=json'

field_regex_pattern = r'"{}"\s*:\s*"([^"]+)"'
price_field_regex = re.compile(field_regex_pattern.format('nav_prior'))
date_field_regex = re.compile(field_regex_pattern.format('nav_time'))

date_regex_pattern = r'([A-Za-z]+)\s*([0-9]+),'
date_parts_regex = re.compile(date_regex_pattern)


def download(price_file=None):

symbols = [
'blah1',   # your stuff
'blah2',   # your stuff
]

for symbol in symbols:
response = requests.get(quote_url.format(symbol))
if response.status_code == 200:
try:
the_date, the_price = get_quote_data(response)
except Exception as e:
print('Error loading {}: {}'.format(symbol, e))
continue
else:
print('Error downloading {symbol}. Received code {code}.'.format(
symbol=symbol,
code=response.status_code
))
continue

print('{date:12} {inv:8}   ${price}'.format(
date=the_date,
inv=symbol,
price=the_price
))

if price_file:
with open(price_file, 'a') as the_file:
the_file.write('P {date} {inv:10} ${price}\n'.format(
date=the_date,
inv=symbol,
price=the_price
))


def get_quote_data(response):
# google finance json appears to be broken, so will use crude string stuff
data = response.content[6:-2].decode('unicode_escape')
the_price = regex_search(data, price_field_regex, 'price')
the_date = regex_search(data, date_field_regex, 'date')
return get_date(the_date), the_price


def regex_search(data, regex, label):
match = regex.search(data)
if match:
return match.groups()[0]
else:
raise Exception("Couldn't find {}.".format(label))


def get_date(quote_date):
last_month_abbreviated = (
datetime.now() + relativedelta(months=-1)
).strftime('%b')

date_parts_match = date_parts_regex.search(quote_date)
if date_parts_match:
quote_month_abbreviated = date_parts_match.groups()[0]
quote_day = date_parts_match.groups()[1]
else:
raise Exception("Couldn't parse date parts.")

if (quote_month_abbreviated == last_month_abbreviated
and last_month_abbreviated == 'Dec'):
quote_year = (datetime.now() + relativedelta(years=-1)).strftime('%Y')
else:
quote_year = datetime.now().strftime('%Y')

# date seems to come back a day off, e.g. 6/15/17 instead of 6/16/17,
# so we'll add 1
the_date = datetime.strptime(
'{} {} {}'.format(quote_month_abbreviated, quote_day, quote_year),
'%b %d %Y'
) + relativedelta(days=1)
return the_date.strftime('%Y/%m/%d')


class ArgHandler(object):

@staticmethod
def get_args(args):
parser = argparse.ArgumentParser()

parser.add_argument(
'-f', '--file',
type=str,
help='save to this prices db file',
)
return parser.parse_args(args)


def main(argv=None):  # pragma: no cover

if argv is None:
argv = sys.argv[1:]

args = ArgHandler.get_args(argv)

download(args.file)


if __name__ == '__main__':  # pragma: no cover
sys.exit(main())


Tabular Reports?

2017-11-24 Thread Scott Carpenter
Is there a built-in way to get a tabular report? Say I want to have 
categories and subcategories on the y-axis and years on the x, something 
like:

  20152016
expenses: blah$ 500.00$ 250.00
   blarg  $ 450.00 $ 75.00
   glarg   $ 50.00$ 175.00

Also would be nice to see months on that x-axis, too.

Thanks!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Rounding problem in (presumed) unrelated accounts when using multiplication in an entry

2015-05-16 Thread Scott Carpenter
Hi, Everyone!

Going on 2.5 years using ledger and loving it. I ran into a strange problem 
that I worked out, but I'm wondering why this was an issue.

I have things split into multiple files, e.g.:

journal.ledger
investments.ledger
accounts.ldg
etc...

So I run ledger with several -f options. I have a number of aliases for 
different things to simplify running it from the command line.

I have a little validation script I run before committing to git. (It just 
runs a dummy ledger command with my usual options and checks for an error 
and reports how things turned out.) On a recent commit it was happy with a 
small update where I added two entries, one of which in journal.ledger was:

2015/05/13 some place
e: misc
e: sundry  ($2.539 * 1.8)
l: credit card: big bank   $-30.25

But when I subsequently ran a reg report, I got this:

 2014/12/19 investments-r-us
 a: abc: investment banana5.7424  ba @ $24.38
 a: abc: investment bread 2.6954  br @ $22.26
 a: abc: cash $-200
Unbalanced remainder is:
$ -0.001
Amount to balance against:
$ 199.999316
Error: Transaction does not balance

You can see that entry is from last year and it's long been settled and not 
causing any issues. (This entry is in investments.ledger, unsurprisingly.)

The first thing I found was that changing the sundry entry to $4.57 made 
the problem go away. But I'm wondering how a rounding problem in that entry 
could cause an issue with the completely unrelated investment entry. (Also 
wondering why that would cause a rounding error.)

Then: why was the file was passing my validation script? I noticed that in 
the val script I had a different order for two files:

$ldg_dir/investments.ledger -f $ldg_dir/journal.ledger

And in my aliases for actually running ledger commands I was specifying 
journal.ledger first. So I switched them and now my reg command runs 
successfully, even when using * 1.8 for sundry.

So what do you guys think? Is this a rounding bug in ledger? Or is there 
some reason I should run my investments file first? Or is there somewhere 
I'm not specifying the right format for things?

It seems like $199.999316 should match $200.

I have $ set like so:

commodity $
format $ 1,000.00

Thank you!

Scott

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Rounding problem in (presumed) unrelated accounts when using multiplication in an entry

2015-05-16 Thread Scott Carpenter
I can reproduce it just with those two transactions:

2015/05/13 some place
e: misc
e: sundry  ($2.539 * 1.8)
l: credit card: big bank   $-30.25

2014/12/19 investments-r-us
a: abc: investment banana  5.7424  ba @ $24.38
a: abc: investment bread   2.6954  br @ $22.26
a: abc: cash   $-200

ledger -f [filename] --market reg big bank

With the investment second like this, it has the error. If I put the 
investment first, it works.

I wondered if it was related to using 3 decimals for the $ amount, but same 
problem when I change to $2.53. (It's actually a gas price which is why I 
had three.)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Rounding problem in (presumed) unrelated accounts when using multiplication in an entry

2015-05-16 Thread Scott Carpenter
Thanks for the replies.

I wondered about the precision, too, but I had the same problem with ($2.53 
* 1.8)

From your link Martin I see that it is a known issue, and now that I 
understand it, hopefully I can avoid it. (Or will remember when I see this 
again.)

Scott

On Saturday, May 16, 2015 at 1:41:55 PM UTC-5, Martin Blais wrote:

 On Sat, May 16, 2015 at 2:29 PM, Scott Carpenter scarp...@gmail.com 
 javascript: wrote:

 I can reproduce it just with those two transactions:

 2015/05/13 some place
 e: misc
 e: sundry  ($2.539 * 1.8)
 l: credit card: big bank   $-30.25

 2014/12/19 investments-r-us
 a: abc: investment banana  5.7424  ba @ $24.38
 a: abc: investment bread   2.6954  br @ $22.26
 a: abc: cash   $-200

 ledger -f [filename] --market reg big bank

 With the investment second like this, it has the error. If I put the 
 investment first, it works.

 Ledger has order-dependent behavior about precision: it seems to have some 
 notion of precision that depends on the last number parsed in your file 
 (across transactions). See this ticket for a detailed example of the 
 problem:

 *Bug 1082* http://bugs.ledger-cli.org/show_bug.cgi?id=1082 - A change 
 in precision used on an amount in-stream affects the balancing precision of 
 following transactions





-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Ledger Atta[boy|girl]

2014-08-06 Thread Scott Carpenter
I think there's a healthy enough community here and you don't really need 
encouragement from me, but I just wanted to say how much I'm loving ledger, 
and to thank John and others for your efforts.

I've been meticulously tracking my finances for years, starting with MS 
Money in 1995, moving to KMyMoney in 2008, and then to Ledger CLI in 2013. 
I hope never to have to switch again. I'm really happy with keeping my 
ledger in Sublime Text with my own custom syntax highlighting, and a Python 
scheduler program. (With git for versioning, of course!)

This thing is so solid, and while I need to learn more, I can do just about 
everything I need/want to, and am so happy with the freedom and power of 
it. I guess I'm posting because I want you to know there are a lot of quiet 
and happy users of ledger, and you're really contributing something 
valuable to the world. Your work is greatly appreciated.

Great job, guys, and please keep it up!

Thank you!

Scott

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger and schools

2014-08-06 Thread Scott Carpenter
I believe the Software Freedom Law Center uses Ledger:

https://www.softwarefreedom.org/

On Sunday, August 3, 2014 10:06:55 AM UTC-5, Loris wrote:

Sure. If not used in schools as a teaching tool, I'd like to know if ledger 
 is used in companies for bookkeeping and report generation (statement of 
 cash flow, income statement, balance sheet, etc.). It can be hard to 
 persuade my colleagues to use it for their lessons, but if I show some 
 examples it could be easier. 

 Bye,

 Loris



-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


balance on top level items

2013-04-07 Thread Scott Carpenter
Supposing you have things broken down like so:

expenses
---} leisure
---} ---} games
---} ---} tomfoolery
---} misc
---} ---} shrubberies
---} ---} assorted

And you wanted to run a balance report that just sums things up as:

expenses
---} leisure
---} misc

How might you do that?

Thanks!

Scott

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: balance on top level items

2013-04-07 Thread Scott Carpenter
Yes! Exactly it. Thank you.

I've been going through the manual a fair amount for things, and searching 
these forums, but very often things elude me for lack of familiarity or the 
proper framing of the question, so I hope you all don't mind some simple 
questions thrown out here. I'll happily accept RTFMs, especially if 
pointers are given to the section of TFM.

I quickly grew tired of dual entry with my old program so I'm only entering 
new transactions in my ledger file, but I have many basic things to learn 
in a hurry now to manage things! :-)

Scott

On Sunday, April 7, 2013 8:16:37 PM UTC-5, John Rakestraw wrote:

 Hi, Scott --

 I think this is what you want --

 ledger bal ^expenses --depth 2

 --John




-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




block comments

2013-03-30 Thread Scott Carpenter
I've tried adding block comments to a file like this:

!comment
This is a block comment with
multiple lines
!end comment

But it seems everything gets ignored after that when running bal or reg. 
This is the example as given in the manual -- am I doing it wrong?

I'm using:

Ledger 3.0.0-20120518

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Programs for reconciling data?

2013-03-21 Thread Scott Carpenter
Thanks, Craig. It's nice to find this community of committed users. I don't
have any grudge against emacs, but I just fell in with a vim crowd when I
started using Unix. :-)

I've been using Sublime to start this thing. I found the ledger syntax
highlighter and with that and word-completion, it works well so far. I like
hand entering that way. Later was thinking I might write a small program to
quickly enter new transactions in my format from the cmd line. I'm using
git which should help keep things from getting irretrievably corrupted.

I've budgeted in kmymoney by letting it show scheduled transactions 6
months into the future. Thinking I'll write a scheduler program and hold
those future transactions in a separate file. That's not a priority.

So for now I'm thinking about how to balance the books with my credit card
in a convenient way. I recently switched to a Mac and have determined I
need to keep things more simple.
On Mar 21, 2013 4:50 PM, Craig Earls ender...@gmail.com wrote:

 Nice to see new users.  I am partial to the emacs ledger-mode, since I
 am the maintainer.  That I know of there aren't any other robust
 package out there for maintaining the ledger and doing
 reconciliations.  What editor are you planning on using?

 On Thu, Mar 21, 2013 at 1:41 PM,  scarpen...@gmail.com wrote:
  (Apologies if this is a repeat -- I posted a day or two ago and haven't
 seen
  it shown up. If this doesn't speak well for my ability to manage using
  ledger, then, more apologies.)
 
  I just found ledger and I love it already. I've started dual entering
  transactions with my old software, and my early experimentation shows it
  will work great for me.
 
  While I'm looking forward to writing my own bash and python scripts for
 data
  entry and manipulation, I was wondering what might be out there already
 for
  reconciliation. I want to get something working sooner so I can let go of
  the old software.
 
  Just something simple to balance my accounts against my statements --
  preferably marking things pending and then cleared.
 
  I've seen where you can use GnuCash and Emacs for things, but I don't
 want
  to use those.
 
  Is there anything else I might try?
 
  Thank you,
 
  Scott
 
  --
 
  ---
  You received this message because you are subscribed to the Google Groups
  Ledger group.
  To unsubscribe from this group and stop receiving emails from it, send an
  email to ledger-cli+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 



 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

 --

 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Ledger group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/ledger-cli/v8u1A1PvJBQ/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 ledger-cli+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.