Re: Feature idea: custom named reports!

2016-08-07 Thread Manuel Amador (Rudd-O)
On 08/05/2016 01:28 AM, Josh wrote:
> Seeing other people's input on this topic, I suppose that there are
> already lots of other good ways to achieve the same thing. Shell
> aliases, shell scripts, scripts in other languages, editor hacks, etc.
> are all far more flexible, allowing multiple commands, parsing and
> processing of the output, interactivity, and so on. Sure, they do tie
> you to a particular tool set, limiting portability, but that's true no
> matter what: any system capable of describing non-trivial reports is
> going to be so complex as to essentially be a complete programming
> language, so we might as well just each pick an existing language we like.

I think the point is to have reports that users can download / share /
immediately exploit for their own personal use, such that they do not
have to come up with much integration or trust before they can use them.

We make a mistake when we tie functionality to specific text editors or
other platforms that users do not have or feel queasy about trying.  I
know we've been burned by, e.g., the crappy reporting functionality in
GnuCash, but if we had a feature whereby people could define reports
that look nice to the eye and can be launched in a visual / printable
form (HTML?), and if those reports could be created by anyone who has
Web / GUI programming experience (but no Emacs experience), suddenly
you'd see a ton more reports flourish and be available for Ledger and
other command-line accounting tools.

Of course, the trick is to get the abstraction level right — as a person
who is using the program to query the data, I want the report and its
formatting to be mostly independent from the parameters I'm using to
gather the data.

THE most  critical improvement that the command-line accounting
community can make, is getting reporting right.  I was trying really
hard to get Ledger to give me the data via bindings so I could build an
unambiguous and error-free reporting system (both charts and textual
reports), but the crasher bugs in Ledger remain unfixed, and therefore I
cannot continue.

-- 
Rudd-O
http://rudd-o.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: Feature idea: custom named reports!

2016-08-04 Thread Josh
Seeing other people's input on this topic, I suppose that there are already
lots of other good ways to achieve the same thing. Shell aliases, shell
scripts, scripts in other languages, editor hacks, etc. are all far more
flexible, allowing multiple commands, parsing and processing of the output,
interactivity, and so on. Sure, they do tie you to a particular tool set,
limiting portability, but that's true no matter what: any system capable of
describing non-trivial reports is going to be so complex as to essentially
be a complete programming language, so we might as well just each pick an
existing language we like.

On Thu, Aug 4, 2016 at 11:13 AM, Simon Michael  wrote:

> Josh Hanson  writes:
> >>> The syntax for the directive might be:
> >>> *report  *To run the
> >> report,
> >>> you'd run at the command line: *ledger report *
>
> I think it's a pretty attractive idea.
>
> Pro:
>
> - report commands are detailed and hard to recall. Saving them
>   (in a standard, easily accessible, cross-platform way) is good.
>
> - they are often quite specific to a journal. Having them
> version-controlled and refactorable together is good.
>
> Con:
>
> - your proposal allows only single ledger commands. It could allow
> arbitrary command lines too I guess.
>
> - reports expressed as command lines are fairly specific to the cli, not
> so good for other uis (I'm thinking of hledger-ui and hledger-web). I
> wonder if there's a more portable way to describe them.
>
> - some report commands are generic and you may not want to redeclare them
> in every journal you work with, creating a maintenance task. Where to put
> those ?
>
> I was thinking of a different scheme: aliases (not just reports) defined
> in the user's config, which can run arbitrary command lines, just like git
> does it.
>
> Richard Lawrence  wrote:
> >> I do wonder if ledger itself is the best place to implement it, though.
> >> You can already mostly achieve what you want with shell aliases.  That's
> >> what I do.
>
> Me too. I have many shell aliases (and when I must, functions), defined in
> a single bashrc file kept alongside journals. I tend to forget what's in
> there and they get out of date easily. I suppose a more specific
> JOURNALFILE.bashrc might be good. Shell scripts are harder to share with
> others, eg windows and non-bash users.
>
> nx wrote:
>
>> Might be better to have a link to a repo on the plaintextaccounting.org
>> site with shellscripts for running complex reports.
>>
>
> +1
>
>
> --
>
> --- 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/A2GD2VKEsuw/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: Feature idea: custom named reports!

2016-08-04 Thread Simon Michael
Josh Hanson  
writes:

>>> The syntax for the directive might be:
>>> *report  *To run the
>> report,
>>> you'd run at the command line: *ledger report *

I think it's a pretty attractive idea.

Pro:

- report commands are detailed and hard to recall. Saving them
  (in a standard, easily accessible, cross-platform way) is good.

- they are often quite specific to a journal. Having them 
version-controlled and refactorable together is good.


Con:

- your proposal allows only single ledger commands. It could allow 
arbitrary command lines too I guess.


- reports expressed as command lines are fairly specific to the cli, not 
so good for other uis (I'm thinking of hledger-ui and hledger-web). I 
wonder if there's a more portable way to describe them.


- some report commands are generic and you may not want to redeclare 
them in every journal you work with, creating a maintenance task. Where 
to put those ?


I was thinking of a different scheme: aliases (not just reports) defined 
in the user's config, which can run arbitrary command lines, just like 
git does it.


Richard Lawrence  wrote:
>> I do wonder if ledger itself is the best place to implement it, though.
>> You can already mostly achieve what you want with shell aliases.  That's
>> what I do.

Me too. I have many shell aliases (and when I must, functions), defined 
in a single bashrc file kept alongside journals. I tend to forget what's 
in there and they get out of date easily. I suppose a more specific 
JOURNALFILE.bashrc might be good. Shell scripts are harder to share with 
others, eg windows and non-bash users.


nx wrote:

Might be better to have a link to a repo on the plaintextaccounting.org
site with shellscripts for running complex reports.


+1


--

--- 
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: Feature idea: custom named reports!

2016-08-03 Thread Alan Schmitt
Hello Alexandre,

On 2016-08-01 13:35, Alexandre Rademaker  writes:

> Can you guys share examples of org-Babel and Python scripts ?!

I do all my reporting from an org file, using org-babel. I wrote some
convenience functions for that which I describe here
http://alan.petitepomme.net/tips/ledger_and_org.html

For very simple reports, I have code blocks like this:
#+begin_src sh :results raw drawer
ledger -f ~/Documents/Org/mescomptes.ledger reg '^Liabilities:Missions' | tail 
-n 20
#+end_src

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2015-06: 402.80, 2016-06: 406.81

-- 

--- 
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.


signature.asc
Description: PGP signature


Re: Feature idea: custom named reports!

2016-08-01 Thread Preet Bhinder
Here's one for getting my net worth:

#+BEGIN_SRC ledger :cmdline --price-db ~/ledger/.pricedb -V balance ^assets 
^liabilities ^investments --real :results output :exports results
!include /Users/mbhinder/ledger/personal_2016.ledger
#+END_SRC

I have this saved in my finance.org file and periodically C-c C-c on it to 
refresh the results.

Need to enable ledger in init.el:


(org-babel-do-load-languages
 'org-babel-load-languages '((python . t)
 (ledger . t)
 (C . t)
 (sh . t)
 (emacs-lisp . t)
 ))



On Monday, August 1, 2016 at 9:35:41 AM UTC-7, Alexandre Rademaker wrote:
>
> Can you guys share examples of org-Babel and Python scripts ?! 
>
> Alexandre 
> Sent from my iPhone 
>
> On 1 de ago de 2016, at 13:29, John Wiegley  > wrote: 
>
> >> "CE" == Craig Earls  writes: 
> > 
> > CE> My most used reports run ledger a few times and format the output. I 
> use 
> > CE> python scripts for those. Simple reports are save in emacs modewhere 
> they 
> > CE> can be linked back to the input file. 
> > 
> > Same here; I use org-babel to save the report, rerun them, and capture 
> the 
> > output. 
> > 
> > -- 
> > John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F 
> > http://newartisans.com  60E1 46C4 BD1A 7AC1 
> 4BA2 
> > 
> > -- 
> > 
> > --- 
> > 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.


Re: Feature idea: custom named reports!

2016-08-01 Thread Alexandre Rademaker
Can you guys share examples of org-Babel and Python scripts ?!

Alexandre 
Sent from my iPhone

On 1 de ago de 2016, at 13:29, John Wiegley  wrote:

>> "CE" == Craig Earls  writes:
> 
> CE> My most used reports run ledger a few times and format the output. I use
> CE> python scripts for those. Simple reports are save in emacs modewhere they
> CE> can be linked back to the input file.
> 
> Same here; I use org-babel to save the report, rerun them, and capture the
> output.
> 
> -- 
> John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
> http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2
> 
> -- 
> 
> --- 
> 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.

-- 

--- 
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: Feature idea: custom named reports!

2016-08-01 Thread John Wiegley
> "CE" == Craig Earls  writes:

CE> My most used reports run ledger a few times and format the output. I use
CE> python scripts for those. Simple reports are save in emacs modewhere they
CE> can be linked back to the input file.

Same here; I use org-babel to save the report, rerun them, and capture the
output.

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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: Feature idea: custom named reports!

2016-07-28 Thread nx
Might be better to have a link to a repo on the plaintextaccounting.org
site with shellscripts for running complex reports.

On Thu, Jul 28, 2016, 12:31 PM Richard Lawrence  wrote:

> Hi Josh,
>
> Josh Hanson  writes:
>
> > Since I don't have every detail of Ledger's syntax memorized, and there
> are
> > a few standard reports that I run regularly, I have several ledger
> command
> > lines recorded as comments in my journal that I can copy and paste as
> > needed.
> >
> > I'd really like to be able to run those automatically. Here's an easy,
> > straightforward implementation that feels very "ledger-y" to me: add a
> > "report" directive to save named reports in the journal, and a "report"
> > command to run those reports.
> >
> > The syntax for the directive might be:
> > *report  *To run the
> report,
> > you'd run at the command line: *ledger report *
>
> I like this idea.  It might be especially useful for very complex reports.
>
> I do wonder if ledger itself is the best place to implement it, though.
> You can already mostly achieve what you want with shell aliases.  That's
> what I do.  I have a bunch of lines like this in my .bashrc:
>
> alias ldg="ledger --no-color"
> alias regcc="ldg register --aux-date -S 'date' 'liabilities:Richard:Chase
> CC'"
> alias cash="ldg bal --limit 'account =~ /Savings$|Checking$|Cash$/'"
>
> So the alias command acts as the name for a report.  It doesn't have the
> advantage of recording the report in your journal file, but at least it
> means you don't have to copy and paste!
>
> HTH,
> Richard
>
> --
>
> ---
> 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.
>

-- 

--- 
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: Feature idea: custom named reports!

2016-07-28 Thread Richard Lawrence
Hi Josh,

Josh Hanson  writes:

> Since I don't have every detail of Ledger's syntax memorized, and there are 
> a few standard reports that I run regularly, I have several ledger command 
> lines recorded as comments in my journal that I can copy and paste as 
> needed.
>
> I'd really like to be able to run those automatically. Here's an easy, 
> straightforward implementation that feels very "ledger-y" to me: add a 
> "report" directive to save named reports in the journal, and a "report" 
> command to run those reports.
>
> The syntax for the directive might be: 
> *report  *To run the report, 
> you'd run at the command line: *ledger report *

I like this idea.  It might be especially useful for very complex reports.

I do wonder if ledger itself is the best place to implement it, though.
You can already mostly achieve what you want with shell aliases.  That's
what I do.  I have a bunch of lines like this in my .bashrc:

alias ldg="ledger --no-color"
alias regcc="ldg register --aux-date -S 'date' 'liabilities:Richard:Chase CC'"
alias cash="ldg bal --limit 'account =~ /Savings$|Checking$|Cash$/'"

So the alias command acts as the name for a report.  It doesn't have the
advantage of recording the report in your journal file, but at least it
means you don't have to copy and paste!

HTH,
Richard

-- 

--- 
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: Feature idea: custom named reports!

2016-07-28 Thread Craig Earls
My most used reports run ledger a few times and format the output. I use
python scripts for those. Simple reports are save in emacs modewhere they
can be linked back to the input file.



On Wednesday, July 27, 2016, Josh Hanson  wrote:

> Since I don't have every detail of Ledger's syntax memorized, and there
> are a few standard reports that I run regularly, I have several ledger
> command lines recorded as comments in my journal that I can copy and paste
> as needed.
>
> I'd really like to be able to run those automatically. Here's an easy,
> straightforward implementation that feels very "ledger-y" to me: add a
> "report" directive to save named reports in the journal, and a "report"
> command to run those reports.
>
> The syntax for the directive might be:
> *report  *To run the
> report, you'd run at the command line: *ledger report *
>
> So, for example, you could use the directive like this: *report salestax
> --period 'every 3 months from 2015-12-01' register*
>
> To run this report, instead of typing all the arguments, you'd just run
> the command:
>
> *ledger report salestax*The result would be the same as if you had run: 
> *ledger
> --period 'every 3 months from 2015-12-01' register*
>
> This feels to me very much in keeping with ledger's philosophy and way of
> doing things. What do other people think of it?
>
> --
>
> ---
> 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.
>


-- 
Craig, Corona De Tucson, AZ
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.