terminal-stocks
terminal-stocks copied to clipboard
Feature Request: Minimal version / styling
Hey! Thanks for creating such an awesome utility. I was wondering if it would be possible to do 2 things:
1 - Allow aliasing for Stock Names. For example, pulling back 'CB3.PA' works great, but the stock name is stupidly long (at the source) - it would be great if I could have an alias for that. 2 - Allow a minimal version / selection of individual fields - for example, just return the price, or the change, by addition of switches or similar.
Thanks!
@symph0nic thanks for using terminal-stocks and providing the suggestions to improve it further.
Alias would be a nice addition to terminal-stocks and it will make it much easier to use. I will try to add support for alias soon.
Field selection can also be done will add it soon.
Some thought about the field selection feature: if the --csv
switch prints the output directly to the terminal, it would be trivial to select any field.
The current --csv
switch writes to a file (which is already problematic for automated uses) and don't print out the file name, making it unnecessarily too complicated to retrieve the actual csv output.
@quandangv --csv switch export all the fields as a json. The file name can be printed in the console that should not be a problem and that will be helpful for the automated use. Probably with next enhancement it can be taken up.
I am still trying to get my head around how to provide a clean, intuitive and user friendly interface for field selection.
I am thinking about something like this:
For field selection without export:
terminal-stocks -t <ticker> --fields name,price,percentageChage,dayChange,weekChage
so the users can pass the fields they want as a comma separated string.
For export
terminal-stocks -t <ticker> --fields name,price,percentageChage,dayChange,weekChage --csv
@quandangv @symph0nic Let me know your thoughts/suggestions.
Happy Coding!
I think your idea of the field selection is fine, the important thing is that I want the option to get the unformatted output printed in the console, not exported to a file, so that I can easily parse it and use in my application.
If you want to improve the export even more, I would suggest something like:
terminal-stocks -t <ticker> --format "%name: %price,%percentageChage,%dayChange,%weekChage"
The tokens will be replaced with the right value, and the user can take some freedom in formatting it.