Implementation:ANative Lab EvoAgentX InvestWorkflowFunctions
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Finance, Data_Analysis |
| Last Updated | 2026-10-21 00:00 GMT |
Overview
Concrete Python helper functions for the CATL stock investment workflow, providing data analysis, CSV-to-LLM conversion, chart generation, and HTML report formatting.
Description
The investment workflow corpus includes several Python helper modules:
- catl_data_functions.py (764 lines) — Data analysis functions for CATL (Contemporary Amperex Technology) stock: data loading, financial metrics calculation, chart generation, and report formatting.
- csv_to_llm_converter.py (341 lines) — Converts CSV financial data into natural language text summaries suitable for LLM analysis. Handles data formatting, column mapping, and text generation.
- html_report_generator.py (1636 lines) — Generates comprehensive HTML reports from stock analysis data using `reportlab` for PDF generation. Creates charts, tables, and formatted sections with financial metrics, analysis results, and recommendations.
- stock_analysis.py (323 lines) — Stock data analysis: price trends, financial ratios, technical indicators, and comparative analysis for LLM-assisted stock evaluation.
- stock_chart_tools.py (541 lines) — Generates stock charts (candlestick, line, volume, technical indicators) using `matplotlib` for the HTML report.
Usage
- Investment workflows: These functions are called by the invest workflow's agent nodes.
- Custom analysis: Import individually for stock data analysis outside the workflow.
- Report generation: Use `html_report_generator` to produce professional investment reports.
Code Reference
Source Location
- Repository: EvoAgentX
- CATL Data: Wonderful_workflow_corpus/invest/catl_data_functions.py (L1-764)
- CSV Converter: Wonderful_workflow_corpus/invest/csv_to_llm_converter.py (L1-341)
- HTML Report: Wonderful_workflow_corpus/invest/html_report_generator.py (L1-1636)
- Stock Analysis: Wonderful_workflow_corpus/invest/stock_analysis.py (L1-323)
- Stock Charts: Wonderful_workflow_corpus/invest/stock_chart_tools.py (L1-541)
Signature
# catl_data_functions.py
def load_catl_data(path: str) -> pd.DataFrame
def calculate_financial_metrics(data: pd.DataFrame) -> dict
# csv_to_llm_converter.py
def csv_to_llm_text(csv_path: str) -> str
# html_report_generator.py
def generate_html_report(analysis_data: dict, output_path: str) -> str
# stock_analysis.py
def analyze_price_trends(data: pd.DataFrame) -> dict
def calculate_financial_ratios(data: pd.DataFrame) -> dict
# stock_chart_tools.py
def generate_candlestick_chart(data: pd.DataFrame, output_path: str) -> str
def generate_line_chart(data: pd.DataFrame, output_path: str) -> str
Import
# These are workflow-local helper functions, imported within the workflow context
# from Wonderful_workflow_corpus.invest.catl_data_functions import load_catl_data
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| csv_path / data | str / DataFrame | Yes | Stock data source |
| output_path | str | Yes (reports) | Output file path |
Outputs
| Name | Type | Description |
|---|---|---|
| load_catl_data returns | DataFrame | Loaded stock data |
| generate_html_report returns | str | Path to generated HTML report |
| csv_to_llm_text returns | str | LLM-readable text summary |
Usage Examples
Generate Investment Report
# Within the invest workflow context:
# 1. Load CATL stock data
data = load_catl_data("stock_data.csv")
# 2. Convert to LLM-readable text
llm_text = csv_to_llm_text("stock_data.csv")
# 3. Analyze trends
metrics = analyze_price_trends(data)
# 4. Generate charts and HTML report
generate_candlestick_chart(data, "chart.png")
generate_html_report(metrics, "report.html")
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment