summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormontezdesousa <79287829+montezdesousa@users.noreply.github.com>2024-02-07 12:24:12 +0000
committerGitHub <noreply@github.com>2024-02-07 12:24:12 +0000
commit38d79d0dc3fcf19eb58352ba6f2e401fdc3c0f66 (patch)
tree73619699b72ef44fe0067e2d7dbf1d78b9085583
parente77a67d609f205655ff5e0bdb65981058dd74944 (diff)
Sync excel reference (#6039)
* sync excel reference * fix: change delimiter to comma * feat: update data connectors * test skipping wf * Update unit-test.yml * Update unit-test.yml * test skipping wf * watch label changes * Update unit-test.yml
-rw-r--r--website/content/excel/data-connectors.md14
-rw-r--r--website/content/excel/functions.json281
-rw-r--r--website/content/excel/getting-started/basics.md4
-rw-r--r--website/generate_excel_markdown.py18
4 files changed, 271 insertions, 46 deletions
diff --git a/website/content/excel/data-connectors.md b/website/content/excel/data-connectors.md
index 14df7fe3ab8..07656ec36e0 100644
--- a/website/content/excel/data-connectors.md
+++ b/website/content/excel/data-connectors.md
@@ -16,7 +16,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
<HeadTitle title="Data connectors | OpenBB Add-in for Excel Docs" />
-OpenBB Add-In for Excel allows you to access your [data connectors](https://docs.openbb.co/pro/main-menu/data-connectors) from OpenBB Terminal Pro inside Microsoft Excel.
+OpenBB Add-In for Excel allows you to access your [data connectors](https://docs.openbb.co/pro/main-menu/data-connectors) from OpenBB Terminal Pro inside Microsoft Excel. This can be done using the [OBB.BYOD](https://docs.openbb.co/excel/reference/byod) function.
To access data from a [single widget](https://docs.openbb.co/pro/main-menu/data-connectors/single-widget) use:
@@ -27,9 +27,19 @@ To access data from a [single widget](https://docs.openbb.co/pro/main-menu/data-
To access data from your own [backend](https://docs.openbb.co/pro/main-menu/data-connectors/integrate-your-own-backend) use:
```excel
-=OBB.BYOD("widget_name", "backend_name")
+=OBB.BYOD("widget_name","backend_name")
```
+If your backend supports it is possible to pass a symbol, date or other optional parameters:
+
+```excel
+=OBB.BYOD("widget_name","backend_name","my_symbol","my_date",{"param1":"value1","param2":"value2", ...})
+```
+
+:::tip
+The easiest way to pass optional parameters is write them into cells and reference them in the function. For example, `=OBB.BYOD(...,A1:B2)` where A1 contains "param1", B1 "value1", A2 "param2", B2 "value2" and so on.
+:::
+
#### Additional notes
- Make sure your backend's CORS settings allow requests coming from <https://excel.openbb.co>.
diff --git a/website/content/excel/functions.json b/website/content/excel/functions.json
index 1ee4434785c..66f7a5fbdc1 100644
--- a/website/content/excel/functions.json
+++ b/website/content/excel/functions.json
@@ -2,7 +2,7 @@
"functions": [
{
"description": "Bring Your Own Data features from OpenBB Terminal Pro.",
- "helpUrl": "https://docs.openbb.co/excel/data-conectors",
+ "helpUrl": "https://docs.openbb.co/excel/data-connectors",
"id": "BYOD",
"name": "BYOD",
"parameters": [
@@ -16,6 +16,25 @@
"name": "backend",
"optional": true,
"type": "string"
+ },
+ {
+ "description": "Symbol to get data for, if applicable.",
+ "name": "symbol",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Date to get data for, if applicable.",
+ "name": "date",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Optional parameters as (n rows by 2 columns) range selection or array constant (e.g. {\"key1\",\"value1\"}; {\"key2\",\"value2\"}).",
+ "dimensionality": "matrix",
+ "name": "optional",
+ "optional": true,
+ "type": "any"
}
],
"result": {
@@ -199,6 +218,23 @@
}
},
{
+ "description": "Current, official, currency reference rates.",
+ "helpUrl": "https://docs.openbb.co/excel/reference/currency/reference_rates",
+ "id": "CURRENCY.REFERENCE_RATES",
+ "name": "CURRENCY.REFERENCE_RATES",
+ "parameters": [
+ {
+ "description": "Options: ecb, defaults to ecb.",
+ "name": "provider",
+ "optional": true,
+ "type": "string"
+ }
+ ],
+ "result": {
+ "dimensionality": "matrix"
+ }
+ },
+ {
"description": "Currency Search. Search available currency pairs.",
"helpUrl": "https://docs.openbb.co/excel/reference/currency/search",
"id": "CURRENCY.SEARCH",
@@ -275,7 +311,7 @@
"type": "string"
},
{
- "description": "Date for which the options chains are returned. (provider: intrinio)",
+ "description": "The end-of-day date for options chains data. (provider: intrinio)",
"name": "date",
"optional": true,
"type": "string"
@@ -315,6 +351,41 @@
}
},
{
+ "description": "Balance of Payments Reports.",
+ "helpUrl": "https://docs.openbb.co/excel/reference/economy/balance_of_payments",
+ "id": "ECONOMY.BALANCE_OF_PAYMENTS",
+ "name": "ECONOMY.BALANCE_OF_PAYMENTS",
+ "parameters": [
+ {
+ "description": "Options: ecb, defaults to ecb.",
+ "name": "provider",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "The report type, the level of detail in the data. (provider: ecb)",
+ "name": "report_type",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "The frequency of the data. Monthly is valid only for ['main', 'summary']. (provider: ecb)",
+ "name": "frequency",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "The country/region of the data. This parameter will override the 'report_type' parameter. (provider: ecb)",
+ "name": "country",
+ "optional": true,
+ "type": "any"
+ }
+ ],
+ "result": {
+ "dimensionality": "matrix"
+ }
+ },
+ {
"description": "Economic Calendar.",
"helpUrl": "https://docs.openbb.co/excel/reference/economy/calendar",
"id": "ECONOMY.CALENDAR",
@@ -1019,12 +1090,72 @@
"type": "string"
},
{
- "description": "Options: fmp, defaults to fmp.",
+ "description": "The number of data entries to return.",
+ "name": "limit",
+ "optional": true,
+ "type": "number"
+ },
+ {
+ "description": "Options: benzinga, fmp, defaults to benzinga.",
"name": "provider",
"optional": true,
"type": "string"
},
{
+ "description": "Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. (provider: benzinga)",
+ "name": "fields",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Date for calendar data, shorthand for date_from and date_to. (provider: benzinga)",
+ "name": "date",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Date to query from point in time. (provider: benzinga)",
+ "name": "date_from",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Date to query to point in time. (provider: benzinga)",
+ "name": "date_to",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Importance level to filter by. (provider: benzinga)",
+ "name": "importance",
+ "optional": true,
+ "type": "number"
+ },
+ {
+ "description": "Records last updated Unix timestamp (UTC). (provider: benzinga)",
+ "name": "updated",
+ "optional": true,
+ "type": "number"
+ },
+ {
+ "description": "Filter by a specific action_company. (provider: benzinga)",
+ "name": "action",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Comma-separated list of analyst (person) IDs. (provider: benzinga)",
+ "name": "analyst",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Comma-separated list of analyst firm IDs. (provider: benzinga)",
+ "name": "firm",
+ "optional": true,
+ "type": "string"
+ },
+ {
"description": "Include upgrades and downgrades in the response. (provider: fmp)",
"name": "with_grade",
"optional": true,
@@ -3176,6 +3307,41 @@
}
},
{
+ "description": "Euro Area Yield Curve.\n\nGets euro area yield curve data from ECB.\n\nThe graphic depiction of the relationship between the yield on bonds of the same credit quality but different\nmaturities is known as the yield curve. In the past, most market participants have constructed yield curves from\nthe observations of prices and yields in the Treasury market. Two reasons account for this tendency. First,\nTreasury securities are viewed as free of default risk, and differences in creditworthiness do not affect yield\nestimates. Second, as the most active bond market, the Treasury market offers the fewest problems of illiquidity\nor infrequent trading. The key function of the Treasury yield curve is to serve as a benchmark for pricing bonds\nand setting yields in other sectors of the debt market.\n\nIt is clear that the market\u2019s expectations of future rate changes are one important determinant of the\nyield-curve shape. For example, a steeply upward-sloping curve may indicate market expectations of near-term Fed\ntightening or of rising inflation. However, it may be too restrictive to assume that the yield differences across\nbonds with different maturities only reflect the market\u2019s rate expectations. The well-known pure expectations\nhypothesis has such an extreme implication. The pure expectations hypothesis asserts that all government bonds\nhave the same near-term expected return (as the nominally riskless short-term bond) because the return-seeking\nactivity of risk-neutral traders removes all expected return differentials across bonds.",
+ "helpUrl": "https://docs.openbb.co/excel/reference/fixedincome/government/eu_yield_curve",
+ "id": "FIXEDINCOME.GOVERNMENT.EU_YIELD_CURVE",
+ "name": "FIXEDINCOME.GOVERNMENT.EU_YIELD_CURVE",
+ "parameters": [
+ {
+ "description": "A specific date to get data for.",
+ "name": "date",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "The yield curve type.",
+ "name": "yield_curve_type",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Options: ecb, defaults to ecb.",
+ "name": "provider",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "The rating type. (provider: ecb)",
+ "name": "rating",
+ "optional": true,
+ "type": "string"
+ }
+ ],
+ "result": {
+ "dimensionality": "matrix"
+ }
+ },
+ {
"description": "Government Treasury Rates.",
"helpUrl": "https://docs.openbb.co/excel/reference/fixedincome/government/treasury_rates",
"id": "FIXEDINCOME.GOVERNMENT.TREASURY_RATES",
@@ -3659,9 +3825,8 @@
"name": "INDEX.CONSTITUENTS",
"parameters": [
{
- "description": "Index for which we want to fetch the constituents.",
+ "description": "Index to fetch the constituents of.",
"name": "index",
- "optional": true,
"type": "string"
},
{
@@ -3770,6 +3935,82 @@
}
},
{
+ "description": "Index Historical Price. Load stock data for a specific index.",
+ "helpUrl": "https://docs.openbb.co/excel/reference/index/price/historical",
+ "id": "INDEX.PRICE.HISTORICAL",
+ "name": "INDEX.PRICE.HISTORICAL",
+ "parameters": [
+ {
+ "description": "Symbol to get data for.",
+ "name": "symbol",
+ "type": "string"
+ },
+ {
+ "description": "Start date of the data, in YYYY-MM-DD format.",
+ "name": "start_date",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "End date of the data, in YYYY-MM-DD format.",
+ "name": "end_date",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Options: fmp, intrinio, polygon, defaults to fmp.",
+ "name": "provider",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Number of days to look back. (provider: fmp)",
+ "name": "timeseries",
+ "optional": true,
+ "type": "number"
+ },
+ {
+ "description": "Data granularity. (provider: fmp)",
+ "name": "interval",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Sort the data in ascending or descending order. (provider: fmp);\nSort order. (provider: intrinio);\nSort order of the data. (provider: polygon)",
+ "name": "sort",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "The number of data entries to return. (provider: intrinio, polygon)",
+ "name": "limit",
+ "optional": true,
+ "type": "number"
+ },
+ {
+ "description": "Timespan of the data. (provider: polygon)",
+ "name": "timespan",
+ "optional": true,
+ "type": "string"
+ },
+ {
+ "description": "Whether the data is adjusted. (provider: polygon)",
+ "name": "adjusted",
+ "optional": true,
+ "type": "boolean"
+ },
+ {
+ "description": "Multiplier of the timespan. (provider: polygon)",
+ "name": "multiplier",
+ "optional": true,
+ "type": "number"
+ }
+ ],
+ "result": {
+ "dimensionality": "matrix"
+ }
+ },
+ {
"description": "Company News. Get news for one or more companies.",
"helpUrl": "https://docs.openbb.co/excel/reference/news/company",
"id": "NEWS.COMPANY",
@@ -3787,7 +4028,7 @@
"type": "number"
},
{
- "description": "Options: benzinga, fmp, intrinio, polygon, tiingo, ultima, defaults to benzinga.",
+ "description": "Options: benzinga, fmp, intrinio, polygon, tiingo, defaults to benzinga.",
"name": "provider",
"optional": true,
"type": "string"
@@ -3900,34 +4141,6 @@
}
},
{
- "description": "Sector News. Get news for one or more sectors.",
- "helpUrl": "https://docs.openbb.co/excel/reference/news/sector",
- "id": "NEWS.SECTOR",
- "name": "NEWS.SECTOR",
- "parameters": [
- {
- "description": "A coma separated list of sectors.",
- "name": "sectors",
- "type": "string"
- },
- {
- "description": "The number of data entries to return. Here it is the no. of articles to return.",
- "name": "limit",
- "optional": true,
- "type": "number"
- },
- {
- "description": "Options: ultima, defaults to ultima.",
- "name": "provider",
- "optional": true,
- "type": "string"
- }
- ],
- "result": {
- "dimensionality": "matrix"
- }
- },
- {
"description": "World News. Global news data.",
"helpUrl": "https://docs.openbb.co/excel/reference/news/world",
"id": "NEWS.WORLD",
diff --git a/website/content/excel/getting-started/basics.md b/website/content/excel/getting-started/basics.md
index c38fd0ed39f..64f8da4dc3f 100644
--- a/website/content/excel/getting-started/basics.md
+++ b/website/content/excel/getting-started/basics.md
@@ -39,11 +39,11 @@ Examples:
3. Getting the earnings calendar:
```excel
- =OBB.EQUITY.CALENDAR.IPO(;"2023-11-20")
+ =OBB.EQUITY.CALENDAR.IPO(,"2023-11-20")
```
:::tip
-If you want to skip a parameter use semi-colon (or comma depending on your number separator) without any value. In example iii. we are skipping the first parameter (symbol).
+If you want to skip a parameter use comma (or semi-colon depending on your number separator) without any value. In example iii. we are skipping the first parameter (symbol).
:::
## Advanced
diff --git a/website/generate_excel_markdown.py b/website/generate_excel_markdown.py
index f7c38e0ef7e..ce438e90cc9 100644
--- a/website/generate_excel_markdown.py
+++ b/website/generate_excel_markdown.py
@@ -176,7 +176,7 @@ class CommandLib:
"""Get the func of the command."""
return self.xl_funcs.get(cmd, {}).get("name", ".").split(".")[-1].lower()
- def _get_signature(self, cmd: str, parameters: dict) -> str:
+ def _get_signature(self, cmd: str, parameters: dict, sep: str = ",") -> str:
"""Get the signature of the command."""
sig = "=OBB." + self.xl_funcs[cmd].get("name", "")
sig += "("
@@ -185,8 +185,8 @@ class CommandLib:
sig += f"{p_name}"
else:
sig += f"[{p_name}]"
- sig += ";"
- sig = sig.strip("; ") + ")"
+ sig += sep
+ sig = sig.strip(f"{sep} ") + ")"
return sig
def _get_parameters(self, cmd: str) -> dict:
@@ -219,7 +219,9 @@ class CommandLib:
return data
return {}
- def _get_examples(self, cmd: str, signature_: str, parameters: dict) -> dict:
+ def _get_examples(
+ self, cmd: str, signature_: str, parameters: dict, sep: str = ","
+ ) -> dict:
"""Get the examples of the command."""
sig = signature_.split("(")[0] + "("
category = signature_.split(".")[1].lower()
@@ -233,16 +235,16 @@ class CommandLib:
for p_name, p_info in parameters.items():
if p_info["required"]:
p_value = get_p_value(cmd, p_name)
- required_eg += f"{p_value};"
- required_eg = required_eg.strip("; ") + ")"
+ required_eg += f"{p_value}{sep}"
+ required_eg = required_eg.strip(f"{sep} ") + ")"
standard_eg = sig
for p_name, p_info in parameters.items():
if p_name == "provider":
break
p_value = get_p_value(cmd, p_name)
- standard_eg += f"{p_value};"
- standard_eg = standard_eg.strip("; ") + ")"
+ standard_eg += f"{p_value}{sep}"
+ standard_eg = standard_eg.strip(f"{sep} ") + ")"
if required_eg == standard_eg:
return {"A. Required": required_eg}