OpenBB-finance / OpenBB

Investment Research for Everyone, Everywhere.
https://openbb.co
Other
34.01k stars 3.11k forks source link

[IMPROVE] Consistent approach for flags with multiple inputs #2887

Closed jmaslek closed 2 years ago

jmaslek commented 2 years ago

When using a function that can have multiple inputs, we should specify a single way of handling. For example.

In stocks/ca, we add using csv deliniation

add AAPL,MSFT

But in economy, we do

fred dgs2 dgs5

We need to pick one and stick to it.

deeleeramone commented 2 years ago

Screen Shot 2022-10-17 at 12 14 50 PM Screen Shot 2022-10-17 at 12 15 19 PM

jmaslek commented 2 years ago

Screen Shot 2022-10-17 at 12 14 50 PM Screen Shot 2022-10-17 at 12 15 19 PM

Since each api has a different naming convention, this is fun. Everything should be case insensitive, so I could do UnItED-StaTes or united_states.

My thought is that we should have convention of

cmd -p val_one,val_two,val_three

When these are parameters. So for ycrv, change to united_states (and process before model) and for macro it would be united_states,united_arab_emerates,canada

@DidierRLopes @JerBouma @montezdesousa ?

montezdesousa commented 2 years ago

Screen Shot 2022-10-17 at 12 14 50 PM Screen Shot 2022-10-17 at 12 15 19 PM

Since each api has a different naming convention, this is fun. Everything should be case insensitive, so I could do UnItED-StaTes or united_states.

My thought is that we should have convention of

cmd -p val_one,val_two,val_three

When these are parameters. So for ycrv, change to united_states (and process before model) and for macro it would be united_states,united_arab_emerates,canada

@DidierRLopes @JerBouma @montezdesousa ?

Agree, this improves user experience and is useful for developing cross menu functions without having to standardize formatting. For e.g. in the future forecast menu models might want to use an economy function.

I'd add these conventions to the OpenBB style guide in contributing guidelines as well.

JerBouma commented 2 years ago

Agreed, let's go with the comma one. This was me being a rebel going for my own style :)

DidierRLopes commented 2 years ago

Agreed, let's go with it 🙏🏽