manrajgrover / football-cli

⚽ Command line interface for Hackers who love football
MIT License
1.07k stars 80 forks source link

Add ability to output fetched data in JSON and CSV formats. #43

Closed armansujoyan closed 6 years ago

armansujoyan commented 6 years ago

Description of new feature, or changes

Implemented the ability to output fetched data in JSON and CSV formats by giving --json and --csv flags, followed by file names. If there are no file names specified in the CLI, by default files are saved as footballOut.csv or footballOut.json.

Related Issues and Discussions

Feature Request: Allow exporting output as JSON or CSV #20

People to notify

@ManrajGrover

manrajgrover commented 6 years ago

Hi @armansujoyan,

I had a quick look and overall it looks great! Could you also add a flag for providing an output directory for json/csv? We can default to current directory if flag is not set.

armansujoyan commented 6 years ago

I don't think there is need to add that flag. Righ now instead of the name you can write something like folder/filename and it will output the file there. Example of call is football fixtures -l WC --json stats/fixturesWC. This will output the file to the folder stats with the name fixtures.json, if the folder stats is available.

armansujoyan commented 6 years ago

Done!

armansujoyan commented 6 years ago

@ManrajGrover I have added another flag for showing the directory where the data needs to be saved.

manrajgrover commented 6 years ago

@armansujoyan Thank you for working on this. I'll review this ASAP.