Wow, that was fast! but this time I've a problem: the script generates a
csv file with only
['downloads'],Date
and without any data. Maybe I miss some python component called with
the "import" at the start of the file?
Thanks for your help, Bob!
Il 02/12/2012 20:47, Bob Hossley ha scritto:
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
_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel