mirror of
https://github.com/farcasclaudiu/xtb-investment-tools.git
synced 2026-06-22 07:01:58 +03:00
68cfec926e
- Created requirements.txt for dependencies including pandas, numpy, openpyxl, and yfinance. - Added setup-env.sh script to set up a Python virtual environment and install required packages. - Introduced validate-export.sh script to validate the exporter module and check expected fields. - Implemented test cases in test_portfolio_performance_exporter.py to ensure correct CSV export functionality and data handling.
25 lines
703 B
Bash
Executable File
25 lines
703 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
if [[ -n "${PYTHON:-}" ]]; then
|
|
PYTHON_BIN="$PYTHON"
|
|
elif [[ -x ".venv/bin/python" ]]; then
|
|
PYTHON_BIN=".venv/bin/python"
|
|
else
|
|
PYTHON_BIN="python3"
|
|
fi
|
|
|
|
PYTHONDONTWRITEBYTECODE=1 "$PYTHON_BIN" - <<PY
|
|
import importlib.util
|
|
from pathlib import Path
|
|
|
|
script = Path("$SCRIPT_DIR") / "exporter.py"
|
|
spec = importlib.util.spec_from_file_location("xtb_portfolio_performance_exporter", script)
|
|
module = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(module)
|
|
assert module.PORTFOLIO_FIELDS[0] == "Date"
|
|
assert module.ACCOUNT_FIELDS[0] == "Date"
|
|
print("Portfolio Performance exporter loaded")
|
|
PY
|