mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-09 10:51:57 +00:00
* Small typo * Updated SEO for OpenBB Bot Docs * Updated SEO for all SDK docs pages * Updated all SEO for OpenBB Terminal Docs pages. Plus grammar edits * Updated spelling edits for SDK and Terminal * fix: headtitle component * Updated Page titles for SDK and Terminal FAQ pages * Updated page titles for all SDK docs pages * Updated page titles for all Terminal Docs Pages (not reference pages) * Updated page titles for Bot (not reference pages) * Add | OpenBB Docs title for SDK and Terminal (#4883) * add Terminal | OpenBB Docs * SDK | OpenBB Docs added --------- Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: jose-donato <zmcdonato@gmail.com>
97 lines
5.5 KiB
Markdown
Vendored
97 lines
5.5 KiB
Markdown
Vendored
---
|
|
title: Exporting & Importing Datasets
|
|
sidebar_position: 3
|
|
description: Export and import data from your computer or server to and from the OpenBB Terminal.
|
|
keywords: [export, import, data, excel, xlsx, csv, json, png, pdf, jpg, openbbuserdata, openbb terminal, terminal, user, data, presets, screener, portfolio, styles, themes, folder, default, macos, windows]
|
|
---
|
|
|
|
import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
|
|
|
|
<HeadTitle title="Exporting & Importing Data - Terminal | OpenBB Docs" />
|
|
|
|
The OpenBB Terminal offers a variety of ways to export financial data. This can be through XLSX, CSV or JSON but also through PNG, JPG, PDF and SVG giving plenty of flexibility to export the data the way you desire.
|
|
|
|
## The OpenBBUserData Folder
|
|
|
|
The `OpenBBUserData` folder's default location is the home of the system user account. By default this will be the following paths:
|
|
- macOS: `Macintosh HD/Users/<YOUR_USERNAME>/OpenBBUserData`
|
|
- Windows: `C:/Users/<YOUR_USERNAME>/OpenBBUserData`
|
|
|
|
Within the folder you can find files that you have exported as well as files that you wish to import directly into the OpenBB Terminal. For example, this could be an orderbook which you can store in `OpenBBUserData/portfolio/holdings`.
|
|
|
|

|
|
|
|
This folder contains all things user-created. For example:
|
|
|
|
- Screener presets
|
|
- Portfolio files
|
|
- Exported files
|
|
- Files to be imported by various functions
|
|
- Styles and themes
|
|
- Preferred data sources
|
|
|
|
**Note:** With a WSL-enabled Windows installation, this folder will be under the Linux partition
|
|
|
|
## Exporting Files
|
|
|
|
Within many of the functionalities, we offer the capability to export to Excel (xlsx and csv) or JSON. This can be demonstrated with the `--export` argument, e.g. if you wish to export to `xlsx` you would add `--export xlsx`.
|
|
|
|
For example, if you wish to download market data you can do so from the stocks menu with the following:
|
|
|
|
```console
|
|
/stocks/load AAPL -s 2010-01-01 --export xlsx
|
|
```
|
|
|
|
This results in the following:
|
|
|
|

|
|
|
|
We also allow you to define a file name, for example for the same stock tickers, we can also add in the filename. This time, we export to `csv`.
|
|
|
|
```console
|
|
/stocks/load AAPL -s 2010-01-01 --export apple.csv
|
|
```
|
|
|
|
Which results in the following:
|
|
|
|

|
|
|
|
Lastly, when you select the `xlsx` option, you can also specify the sheet name with `--sheet-name` which allows multiple datasets to be send to the same Excel file. Using the same stock ticker, we can define the following. First, get market data from the `stocks` menu:
|
|
|
|
```console
|
|
/stocks/load AAPL -s 2010-01-01 --export apple.xlsx --sheet-name Market Data
|
|
```
|
|
|
|
Then enter the `fa` (Fundamental Analysis) menu and copy and paste the code below. This requires an API key from FinancialModelingPrep which you can obtain for free. Please have a look [here](https://docs.openbb.co/terminal/usage/guides/api-keys).
|
|
|
|
|
|
```console
|
|
income --source FinancialModelingPrep -l 10 --export apple.xlsx --sheet-name Income Statement
|
|
balance --source FinancialModelingPrep -l 10 --export apple.xlsx --sheet-name Balance Sheet
|
|
cash --source FinancialModelingPrep -l 10 --export apple.xlsx --sheet-name Cash Flow Statement
|
|
```
|
|
|
|
This generates a file for Apple with market data from 2010-01-01 until now and income, balance and cash flow statements over the last 10 years as seen in the image below.
|
|
|
|

|
|
|
|
Next to that, we also allow exporting to images, this can be PNG, JPG, PDF and SVG. For example, using our `portfolio` menu we can export the charts to any type of format which again can be found within the `OpenBBUserData` folder.
|
|
|
|

|
|
|
|
## Importing Data
|
|
|
|
Menus, such as [Econometrics](https://docs.openbb.co/terminal/usage/intros/econometrics) or [Portfolio](https://docs.openbb.co/terminal/usage/intros/portfolio), allow the user to import their own dataset. Files available to import will be included with the selections made available by auto-complete. In the Econometrics menu, this is activated after pressing the space bar, `load -f `
|
|
|
|

|
|
|
|
The Econometrics menu looks into the `exports` and `custom_imports/econometrics` folder. For the Portfolio functionalities the `portfolio` menu looks into the `portfolio/holdings` folder whereas the `portfolio/po` menu looks into the `portfolio/allocation` and `portfolio/optimization` folder for the `load` and `file` command respectively. Please make sure to read the relevant guides to understand how this works.
|
|
|
|
## Custom Path for OpenBBUserData Folder
|
|
|
|
The location of this folder can be set by the user from the /settings menu. There should be no need to update paths in this menu unless the folders have been moved manually. If the location of the OpenBBUserData folder must be changed, it is best to move the entire existing folder to the new path. The path is then changed under the settings menu with:
|
|
|
|
```console
|
|
userdata --folder "/complete_path_to/OpenBBUserData"
|
|
```
|