terminal-stocks icon indicating copy to clipboard operation
terminal-stocks copied to clipboard

Feature Request: Minimal version / styling

Open symph0nic opened this issue 3 years ago • 4 comments

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 avatar Mar 16 '21 17:03 symph0nic

@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.

shweshi avatar Mar 16 '21 18:03 shweshi

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 avatar Mar 31 '21 12:03 quandangv

@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!

shweshi avatar Mar 31 '21 19:03 shweshi

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.

quandangv avatar Apr 02 '21 02:04 quandangv