OpenBB icon indicating copy to clipboard operation
OpenBB copied to clipboard

feature/commodities-lbma-fixing: Adds Commodity Extension and LBMA Gold/Silver daily fixing levels

Open deeleeramone opened this issue 1 year ago • 10 comments

This PR adds a Commodity extension, and creates one endpoint: obb.commodity.lbma_fixing()

The function returns daily AM/PM prices for gold, and daily for silver, in USD/EUR/GBP. The data provider is Nasdaq Data Link, and the time series can be collapsed as monthly, quarterly, and annual. It can also be transformed by difference, rate of change, cumulative, and normalized. Daily data goes back to 1968.

Screenshot 2023-11-19 at 9 31 09 PM

deeleeramone avatar Nov 20 '23 05:11 deeleeramone

@deeleeramone Do you know we have some of the Nasdaq tests failing and also yfinance on this branch?

IgorWounds avatar Nov 21 '23 10:11 IgorWounds

@deeleeramone Do you know we have some of the Nasdaq tests failing and also yfinance on this branch?

They appear to be cassettes needing to be re-recorded, I'll investigate, but maybe it gets resolved when I merge latest develop into this branch.

deeleeramone avatar Nov 21 '23 16:11 deeleeramone

@deeleeramone I see that query_params.py is defined in the openbb_nasdaq/models folder. This file should go in the openbb_nasdaq/utils folder, as it's not a model file but instead a helpers file.

the-praxs avatar Nov 27 '23 11:11 the-praxs

@deeleeramone I see that query_params.py is defined in the openbb_nasdaq/models folder. This file should go in the openbb_nasdaq/utils folder, as it's not a model file but instead a helpers file.

It is a model. They are the common query params accepted by Nasdaq Data Link for any request. The code doesn't do anything, it's a Query Params model.

deeleeramone avatar Nov 28 '23 00:11 deeleeramone

@deeleeramone I see that query_params.py is defined in the openbb_nasdaq/models folder. This file should go in the openbb_nasdaq/utils folder, as it's not a model file but instead a helpers file.

It is a model. They are the common query params accepted by Nasdaq Data Link for any request. The code doesn't do anything, it's a Query Params model.

A standard model will contain a QueryParams and Data class. I like your idea of having a single standard model file for grouping similar types of models (financial_statements in this case). This means we have multiple QueryParams and Data class in a single file.

However, a provider model is considered a model because it contains the QueryParams, Data and Fetcher class. This file doesn't and should instead be moved to the utils folder.

the-praxs avatar Nov 28 '23 07:11 the-praxs

@deeleeramone What is the state of this PR?

IgorWounds avatar Dec 18 '23 11:12 IgorWounds

@deeleeramone What is the state of this PR?

It's been ready to go for weeks.

deeleeramone avatar Dec 18 '23 21:12 deeleeramone

Let's resolve the conflicts and switch it to use our custom parameterized. Then we merge :D

IgorWounds avatar Dec 18 '23 22:12 IgorWounds

Let's resolve the conflicts and switch it to use our custom parameterized. Then we merge :D

I'm confused, switch what to use what?

deeleeramone avatar Dec 19 '23 02:12 deeleeramone

@deeleeramone we now have a custom parametrize decorator that we import. It is wrapped around the pytest one to allow for testing modularity.

IgorWounds avatar Dec 19 '23 18:12 IgorWounds

@deeleeramone we now have a custom parametrize decorator that we import. It is wrapped around the pytest one to allow for testing modularity.

A) What is it? How do you use it? B) Is this documented somewhere? C) How is it any different than all other provider-specific parameters? A standard model is still being used, there is simply a shared set of parameters for Nasdaq Data Link only.

deeleeramone avatar Jan 02 '24 02:01 deeleeramone