Mr-Djez (30db1a6e) at 27 Jul 23:10
Merge branch 'feature/Djez' of https://git.duniter.org/ji_emme/g1_w...
... and 3 more commits
Mr-Djez (70a1f807) at 27 Jul 22:36
[doc] add ascii art
Mr-Djez (122ce73d) at 02 May 10:09
Removal of the pandas module to keep the support of python 3.6.8
Excuse me if I'm changing too many things. I'm coming from more of a data analytics background, so I'm learning about the python development ecosystem.
Why pandas:
The "dataframe" data type provided by pandas
is very powerful. In the case of a csv output, after thinking about it, I preferred to use a dataframe, because it avoids writing code by yourself.
We just have to make a function that returns a dataframe from a list(list())
and we have access to the csv format with the to_csv
method.
And this method is much more robust than the first csv draft I made for my needs ;).
Moreover, the dataframe object provides other methods that would allow to have other output formats with a minimum of code to maintain (to_html
, to_markdown
, to_latex
)
After, I understand that you don't like the abandonment of python3.6.
I can propose you to remove pandas
and to leave only the json and yaml formats to be able to integrate them to the next version and so support python 3.6 ?
Sorry if I was clumsy, I'm trying to help.
Mr-Djez (ca2850e2) at 28 Apr 13:20
add tests for generate_dataframe(), list_list_to_list_dict() and ma...
... and 1 more commit
This function returns a dataframe object and not a csv ... comment to correct.
I have trouble with the tests.
Mr-Djez (c619d9f1) at 25 Apr 22:38
Rewrite CSV format + add HTML format
I don't know how to answer the question about dependencies... (I know that numpy is essential to pandas)
it will allow to make for example for the csv:
def generate_csv(header, txs_list, entt_prefix_csv):
"""
This function creates a csv from 3 parameters:
- header: c.f. get_header()
- txs_lst: c.f. generate_table()
- entt_prefix_csv: list of header keys that we want to appear in the first columns of the final csv
"""
entt_txs_csv = txs_list.pop(0)
df_txs = pd.DataFrame(txs_list, columns=entt_txs_csv)
tmp = list()
for f in entt_prefix_csv:
tmp.append(header[f])
prefix_csv = list()
for i in range(1, len(txs_list) + 1):
prefix_csv.append(tmp)
prefix_csv = pd.DataFrame(prefix_csv, columns=entt_prefix_csv)
df = pd.concat([prefix_csv, df_txs], axis=1)
return df.to_csv()
PS I'm sorry, I have difficulty to speak in English ;)
Hello.
I would like to integrate the Pandas module in order to facilitate data manipulation. For example rewrite the history csv part to have something more robust. Unfortunately, the pandas module is only compatible with version 3.7.1< of python.
https://pandas.pydata.org/pandas-docs/stable/getting_started/install.html
The silkaj project wants to be compatible from python 3.6.8. Can this change? Or do I have to make up my mind.
Add:
data = make_data_structured(header, txs_list, "Transactions")
end function modif:
def make_data_structured(header, txs_list, name_key):
Mr-Djez (21477be8) at 25 Apr 16:22
Unicode support in json and yaml + typo
Personally I need a stdout to redirect the stream to other programs ;) (the --display option would be fine ;) )
EDIT: I wonder if putting by default in a file (.JSON,.CSV,etc..) is really useful ? The standard default output seems to me to be sufficient, because a simple stream redirection creates a file:
$ silkaj history -u -f -o csv 8GBahagzjVv3G2j6WYSMHUF2RjoEz9JynPuDZ3htWP2K > hist.csv
$ silkaj history -u -f -o json 8GBahagzjVv3G2j6WYSMHUF2RjoEz9JynPuDZ3htWP2K > hist.json
$ silkaj history -u -f -o yaml 8GBahagzjVv3G2j6WYSMHUF2RjoEz9JynPuDZ3htWP2K > hist.yaml
Hello.
I would like to be able to select a specific range between a start date and an end date in the transaction history of an account.
Mr-Djez (6c9f143e) at 23 Apr 11:46
Add hearders to format CSV, JSON, YAML