Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds feature for printing holding summary in commandline #277

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

marcusmoller
Copy link

A small patch that adds feature for printing holding summary (cost, value, day change, total change) in the terminal.
Easily parseable using AWK - see the readme.

Fixes #180

@marcusmoller
Copy link
Author

Seems I've missed som formatting (the lint failure). Is there anything I need to do?

@achannarasappa
Copy link
Owner

Thanks for the contribution @marcusmoller! On quick glance it looks like an issue with the linting tool rather than your change so no action needed.

I'll have closer review and merge within a couple days

@achannarasappa
Copy link
Owner

Thanks again for this contribution

Could you share the use case for this format of output?

I have a few general comments:

  1. If a new output format is being added, I think it should generally match a widely used data serialization standard rather than being something proprietary
  2. If a new type of data is being output, I think it should support all existing output formats (i.e. JSON and CSV) unless there's some specific reason to exclude it

@marcusmoller
Copy link
Author

marcusmoller commented Oct 28, 2024

The use case is either a) just printing and reading the holdings summary without being inside a TUI or b) for easy parsing values for other terminal use-cases. Please see the readme for easy parsing using AWK.
I personally use it for adding my daily change to my window manager bar (i3bar with i3blocks) using the following:

[stock]
command=/home/marcus/PROGRAMMING/ticker/ticker print --summary | awk '/Day change/{print $3 " " $4}'
interval=60 # updated every min
color=#EBDBB2

image

As for 1) and 2) perhaps I could add two extra flags for printing in JSON and CSV format? Eg

$ ticker --config=./.ticker.yaml print --summary --json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add option to print current portfolio value on the cli
2 participants