GnuCash statistics
Bob Hossley
SegundoBob at earthlink.net
Sun Dec 2 14:47:55 EST 2012
On 2012-12-02 06:25, Cristian Marchi wrote:
> I've now a script that downloads a json file for each release of GnuCash
> in the 2.4 series with data from 2010-11-01 to 2012-11-30. It is like this:
>
> for i in {0..11}; do wget
> "http://sourceforge.net/projects/gnucash/files/gnucash%20%28stable%29/2.4.$i/stats/json?start_date=2010-11-01&end_date=2012-11-30"
> -O gnucash2.4.$i.json; done
>
> I can then convert each json file to a csv file with your script so that
> I can copy-paste data in a single spreadsheet to generate the graph.
>
> In order to make the process more automatic, would it be possible to
> create a csv file with only ["downloads"] data ordered as shown in the
> attached downloads.csv file?
Cristian,
Hopefully the attached is what you want.
usage: stats01.py [options] jsonPath csvOpath
GnuCash Stats for Cristian Marchi
positional arguments:
jsonPath Pathname of the directory containing all the json files
containing stats.
csvOpath Pathname of csv file to create
optional arguments:
-h, --help show this help message and exit
I used the bash file you supplied to download all the json files into a
directory. I CD'ed to this directory and ran command line:
stats01.py ./ stats1.csv
This produced the stats1.csv file that is attached.
Note: I sort the columns into ascending order first by major release
level then by minor release level, then by bug fix level, treating all
release levels as integers.
I sort the rows into ascending date order. I allow each json file to
contain a different set of dates.
SegundoBob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stats1.csv
Type: text/csv
Size: 1719 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20121202/efe2e236/attachment.csv>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stats01.py
Type: text/x-python
Size: 3946 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20121202/efe2e236/attachment.py>
More information about the gnucash-devel
mailing list