mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-12-01 13:44:16 +00:00
markdown linting
This commit is contained in:
@@ -21,7 +21,7 @@ See the [keyword arguments](#keyword-arguments) section for parameters and descr
|
||||
|
||||
To start the OpenBB Platform API, open a terminal, activate the environment where it is installed, and then enter:
|
||||
|
||||
```
|
||||
```sh
|
||||
openbb-api
|
||||
```
|
||||
|
||||
@@ -59,38 +59,41 @@ The behavior of the script can be configured with the use of arguments and keywo
|
||||
|
||||
Launcher specific arguments:
|
||||
|
||||
--app Absolute path to the Python file with the target FastAPI instance. Default is the installed OpenBB Platform API.
|
||||
--name Name of the FastAPI instance in the app file. Default is 'app'.
|
||||
--factory Flag to indicate if the app name is a factory function. Default is 'false'.
|
||||
--editable Flag to make widgets.json an editable file that can be modified during runtime. Default is 'false'.
|
||||
--build If the file already exists, changes prompt action to overwrite/append/ignore. Only valid when --editable true.
|
||||
--no-build Do not build the widgets.json file. Use this flag to load an existing widgets.json file without checking for updates.
|
||||
--exclude JSON encoded list of API paths to exclude from widgets.json. Disable entire routes with '*' - e.g. '["/api/v1/*"]'.
|
||||
--no-filter Do not filter out widgets in widget_settings.json file.
|
||||
--widgets-json Absolute/relative path to use as the widgets.json file. Default is ~/envs/{env}/assets/widgets.json, when --editable is 'true'.
|
||||
--apps-json Absolute/relative path to use as the apps.json file. Default is ~/OpenBBUserData/workspace_apps.json.
|
||||
--agents-json Absolute/relative path to use as the agents.json file. Including this will add the /agents endpoint to the API.
|
||||
|
||||
```text
|
||||
--app Absolute path to the Python file with the target FastAPI instance. Default is the installed OpenBB Platform API.
|
||||
--name Name of the FastAPI instance in the app file. Default is 'app'.
|
||||
--factory Flag to indicate if the app name is a factory function. Default is 'false'.
|
||||
--editable Flag to make widgets.json an editable file that can be modified during runtime. Default is 'false'.
|
||||
--build If the file already exists, changes prompt action to overwrite/append/ignore. Only valid when --editable true.
|
||||
--no-build Do not build the widgets.json file. Use this flag to load an existing widgets.json file without checking for updates.
|
||||
--exclude JSON encoded list of API paths to exclude from widgets.json. Disable entire routes with '*' - e.g. '["/api/v1/*"]'.
|
||||
--no-filter Do not filter out widgets in widget_settings.json file.
|
||||
--widgets-json Absolute/relative path to use as the widgets.json file. Default is ~/envs/{env}/assets/widgets.json, when --editable is 'true'.
|
||||
--apps-json Absolute/relative path to use as the apps.json file. Default is ~/OpenBBUserData/workspace_apps.json.
|
||||
--agents-json Absolute/relative path to use as the agents.json file. Including this will add the /agents endpoint to the API.
|
||||
```
|
||||
|
||||
All other arguments will be passed to uvicorn. Here are the most common ones:
|
||||
|
||||
--host TEXT Host IP address or hostname.
|
||||
[default: 127.0.0.1]
|
||||
--port INTEGER Port number.
|
||||
[default: 6900]
|
||||
--ssl_keyfile TEXT SSL key file.
|
||||
--ssl_certfile TEXT SSL certificate file.
|
||||
--ssl_keyfile_password TEXT SSL keyfile password.
|
||||
--ssl_version INTEGER SSL version to use.
|
||||
(see stdlib ssl module's)
|
||||
[default: 17]
|
||||
--ssl_cert_reqs INTEGER Whether client certificate is required.
|
||||
(see stdlib ssl module's)
|
||||
[default: 0]
|
||||
--ssl_ca_certs TEXT CA certificates file.
|
||||
--ssl_ciphers TEXT Ciphers to use.
|
||||
(see stdlib ssl module's)
|
||||
[default: TLSv1]
|
||||
```text
|
||||
--host TEXT Host IP address or hostname.
|
||||
[default: 127.0.0.1]
|
||||
--port INTEGER Port number.
|
||||
[default: 6900]
|
||||
--ssl_keyfile TEXT SSL key file.
|
||||
--ssl_certfile TEXT SSL certificate file.
|
||||
--ssl_keyfile_password TEXT SSL keyfile password.
|
||||
--ssl_version INTEGER SSL version to use.
|
||||
(see stdlib ssl module's)
|
||||
[default: 17]
|
||||
--ssl_cert_reqs INTEGER Whether client certificate is required.
|
||||
(see stdlib ssl module's)
|
||||
[default: 0]
|
||||
--ssl_ca_certs TEXT CA certificates file.
|
||||
--ssl_ciphers TEXT Ciphers to use.
|
||||
(see stdlib ssl module's)
|
||||
[default: TLSv1]
|
||||
```
|
||||
|
||||
Run `uvicorn --help` to get the full list of arguments.
|
||||
|
||||
@@ -121,7 +124,6 @@ Contact the system administrator if you are using a work device and require addi
|
||||
|
||||

|
||||
|
||||
|
||||
## Example Application
|
||||
|
||||
Examples below will assume this code block is at the start of the file.
|
||||
@@ -338,14 +340,12 @@ async def hello_data() -> list[MyData]:
|
||||
return [MyData(column_1=datetime.date.today(), column_2="Hello!")]
|
||||
```
|
||||
|
||||
|
||||
### PDF Widget
|
||||
|
||||
To create a PDF widget, import the custom response model below and define it as a return type.
|
||||
|
||||
The model handles conversion of the document, from a bytes object, to a base64 encoded string.
|
||||
|
||||
|
||||
```python
|
||||
from openbb_platform_api.response_models import PdfResponseModel
|
||||
|
||||
@@ -402,7 +402,6 @@ async def open_pdf(
|
||||
|
||||
To define a chart widget, update the widget "type" and return the content from the `Figure.to_plotly_json()` method.
|
||||
|
||||
|
||||
```python
|
||||
@app.get(
|
||||
"/hello_chart",
|
||||
@@ -437,7 +436,6 @@ The entry in `widgets.json` will be automatically created if the conditions belo
|
||||
- POST method takes 1 positional argument, a sub-class of Pydantic BaseModel.
|
||||
- Create a model, like annotated table fields, defining all inputs to the form.
|
||||
|
||||
|
||||
#### Example
|
||||
|
||||
The code below creates a widget with a form as the input, and an output table of all submitted forms, as processed through the `IntakeForm` model.
|
||||
@@ -600,7 +598,6 @@ async def create_omni_widget(item: TestOmniWidgetQueryModel):
|
||||
|
||||

|
||||
|
||||
|
||||
## Widget Config
|
||||
|
||||
Any value from the [`widgets.json`](https://docs.openbb.co/terminal/custom-backend/widgets-json-reference) structure can be passed into the `@app` decorator by including an `openapi_extra` dictionary with the key, `"widget_config"`.
|
||||
@@ -662,7 +659,6 @@ If you would like to construct this file manually, create the file and define th
|
||||
openbb-api --widgets-json /Users/some_user/path/to/widgets.json
|
||||
```
|
||||
|
||||
|
||||
### Location of `workspace_apps.json`
|
||||
|
||||
By default, the location is:
|
||||
|
||||
Reference in New Issue
Block a user