This web-scraping tool aims to extract portfolio asset information (such as stocks, cryptos and ETFs) from Scalable Capital and Trade Republic, given that both neobrokers currently do not feature a portfolio value export. The main features are:
- Import of portfolio asset of both Scalable Capital and Trade Republic, incl. assets name, ISINs and assets current value.
- Semi-automatic login option, where login and password are automatically filled if user adds the parameters
login
andpassword
. It waits until 2FA login confirmation. - Save of the imported assets as an Excel, .csv or a simply copy it as a table to the system clipboard.
The code runs locally in the user's machine and imitates, via Chrome WebDriver and the Selenium library, user's behavior and extracts the assets information from Scalable Capital and Trade Republic. No information is collected and send externally.
Warning
For security reason, it is recommended to keep the default parameters login = None
and password = None
.
python -m pip install "git+https://github.com/roboes/neobroker-portfolio-importer.git@main"
scalable_capital_portfolio_import(login=None, password=None, file_type='.xlsx', output_path=os.path.join(os.path.expanduser('~'), 'Downloads', 'Assets Scalable Capital.xlsx'))
trade_republic_portfolio_import(login=None, password=None, file_type='.xlsx', output_path=os.path.join(os.path.expanduser('~'), 'Downloads', 'Assets Trade Republic.xlsx'))
- Scrapes and imports portfolio asset information from Scalable Capital and Trade Republic.
- The selected language must be set to
English
for both Scalable Republic and Trade Republic.
login
: str, default: None. If defined (e.g.login = 'email@email.com'
), login information is automatically filled; otherwise, user needs to manually add them once the WebDriver initiates.password
: str, default: None. If defined (e.g.password = '12345'
), password information is automatically filled; otherwise, user needs to manually add them once the WebDriver initiates.file_type
: str, options: '.xlsx', '.csv' and None, default: '.xlsx'. If None, imported assets dataset is copied to the system clipboard.output_path
: path object, default: None. If None, imported assets dataset is copied to the system clipboard.return_df
: bool, default: False. Returns DataFrame from function.
# Import packages
import os
from neobroker_portfolio_importer.scalable_capital import scalable_capital_portfolio_import
from neobroker_portfolio_importer.trade_republic import trade_republic_portfolio_import
# Scrap, import and save as .xlsx portfolio asset information from Scalable Capital
scalable_capital_portfolio_df = scalable_capital_portfolio_import(
login=None,
password=None,
file_type='.xlsx',
output_path=os.path.join(
os.path.expanduser('~'),
'Downloads',
'Assets Scalable Capital.xlsx',
),
return_df=True,
)
# Scrap, import and save as .xlsx portfolio asset information from Trade Republic
trade_republic_portfolio_df = trade_republic_portfolio_import(
login=None,
password=None,
file_type='.xlsx',
output_path=os.path.join(
os.path.expanduser('~'),
'Downloads',
'Assets Trade Republic.xlsx',
),
return_df=True,
)
pytr: Use Trade Republic in terminal.