# Fetch Fundamental Data
A Python package for fetching and analyzing fundamental financial data using the EODHD API in the background. This package allows you to process Excel files containing stock tickers to generate financial analysis reports.
## Features
- **Concurrent Data Fetching**: Efficiently fetches financial data for multiple stocks simultaneously
- **Comprehensive Analysis**: Calculate key financial metrics not avaibale in EODHD including:
- Greenblatt Magic Formula rankings
- Conservative investment scores
- Quality scores
- P/E ratios, ROCE, revenue growth, EPS growth
- Free cash flow metrics, buyback data, insider ownership
- Technical indicators and moving averages
- **Excel Integration**: Read ticker lists from Excel and output results to Excel
## Installation
### From PyPI (when published)
```bash
pip install fetch-fundamental-data
```
### Development Installation
```bash
git clone https://github.com/username/fetch-fundamental-data.git
cd fetch-fundamental-data
pip install -r requirements.txt
pip install -e .
```
## Prerequisites
1. **EODHD API Key**: You need an API key from [EODHD](https://eodhd.com/) to fetch financial data
## Start
### 1. Prepare Excel File
Create an Excel file (`.xlsx`) with the following format:

**Important Notes:**
- First Column: Company names
- Second Column: Ticker symbols
- Note! Make sure to use proper ticker formats (e.g., `DANSKE.CO` for Copenhagen exchange) that are compatible with EODHD.
### 2. Run the Analysis
```bash
fetch-fundamentals --api-key YOUR_EODHD_API_KEY --input tickers.xlsx --output results.xlsx
```
### 3. View Results
The output Excel file will contain comprehensive financial data and analysis for all tickers.
The following is an example of an excel-file generated by the tickers above:


## Command Line Usage
### Basic Usage
```bash
fetch-fundamentals --api-key YOUR_API_KEY --input input.xlsx --output output.xlsx
```
### Advanced Usage
```bash
# Custom number of concurrent workers (default: 10)
fetch-fundamentals --api-key YOUR_API_KEY --input tickers.xlsx --output results.xlsx --workers 5
# Short form arguments
fetch-fundamentals --api-key YOUR_API_KEY -i tickers.xlsx -o results.xlsx -w 5
```
### Command Line Arguments
| Argument | Short | Required | Description |
|----------|-------|----------|-------------|
| `--api-key` | | Yes | Your EODHD API key |
| `--input` | `-i` | Yes | Path to input Excel file |
| `--output` | `-o` | YEs | Path to output Excel file |
| `--workers` | `-w` | | Number of concurrent workers (1-50, default: 10) |
| `--version` | | | Show version information |
| `--help` | `-h` | | Show help message |
## Python API Usage
```python
from fetch_fundamental_data import FundamentalDataFetcher
# Initialize with your API key
fetcher = FundamentalDataFetcher(api_key="YOUR_EODHD_API_KEY")
# Process an Excel file
fetcher.process_excel_file(
input_file="path/to/tickers.xlsx",
output_file="path/to/results.xlsx",
max_workers=10
)
# Or work with data directly
company_list, ticker_list = fetcher.extract_tickers_from_excel("tickers.xlsx")
df, separate_data = fetcher.fetch_all_data(company_list, ticker_list)
analyzed_df = fetcher.analyze_data(df, separate_data)
```
## Output Data
The output Excel file contains the following types of data:
### Financial Metrics
- **Price Information**: Current price, currency, sector
- **Valuation Ratios**: P/E ratios (current and 5-year average), ROCE
- **Growth Metrics**: Revenue growth, EPS growth, asset growth
- **Profitability**: Gross profitability, free cash flow metrics
- **Balance Sheet**: Accruals, total yield, insider ownership percentage
### Analysis Scores
- **Greenblatt Formula**: Magic Formula ranking based on P/E and ROCE
- **Conservative Formula**: Risk-adjusted scoring based on volatility, NPY, and momentum
- **Quality Score**: Overall quality assessment
### Technical Data
- **Moving Averages**: Various period moving averages
- **Volatility Metrics**: Historical volatility measures
- **Price Momentum**: Momentum indicators
## Examples
### Example Input File (`tickers.xlsx`)
| Company | Ticker |
|---------|--------|
| Apple | AAPL |
| Microsoft | MSFT |
| Alphabet | GOOGL |
| Amazon | AMZN |
| Tesla | TSLA |
### Example Usage
```bash
# Basic analysis
fetch-fundamentals --api-key abc123xyz --input tickers.xlsx --output analysis.xlsx
# High-speed processing (more workers)
fetch-fundamentals --api-key abc123xyz --input large_portfolio.xlsx --output results.xlsx --workers 20
# Conservative processing (fewer workers, good for rate limits)
fetch-fundamentals --api-key abc123xyz --input tickers.xlsx --output results.xlsx --workers 3
```
## Testing
Before pushing changes, run the test script to validate functionality:
```bash
python test_package.py
```
## Contributing
Contributions are welcome!
## Author
**Carl Viggo Gravenhorst-Lövenstierne**
Raw data
{
"_id": null,
"home_page": "https://github.com/username/fetch-fundamental-data",
"name": "fetch-fundamental-data",
"maintainer": "Carl Viggo Gravenhorst-L\u00f6venstierne",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "finance, stocks, fundamental analysis, financial data, EODHD",
"author": "Carl Viggo Gravenhorst-L\u00f6venstierne",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/51/3c/a2d601c7ee58f2cff2bcea7157361a41b6949ef2edfb7b7244a6ad11ba3e/fetch_fundamental_data-0.1.0.tar.gz",
"platform": null,
"description": "# Fetch Fundamental Data\n\nA Python package for fetching and analyzing fundamental financial data using the EODHD API in the background. This package allows you to process Excel files containing stock tickers to generate financial analysis reports.\n\n## Features\n\n- **Concurrent Data Fetching**: Efficiently fetches financial data for multiple stocks simultaneously\n- **Comprehensive Analysis**: Calculate key financial metrics not avaibale in EODHD including:\n - Greenblatt Magic Formula rankings\n - Conservative investment scores\n - Quality scores\n - P/E ratios, ROCE, revenue growth, EPS growth\n - Free cash flow metrics, buyback data, insider ownership\n - Technical indicators and moving averages\n- **Excel Integration**: Read ticker lists from Excel and output results to Excel\n\n## Installation\n\n### From PyPI (when published)\n```bash\npip install fetch-fundamental-data\n```\n\n### Development Installation\n```bash\ngit clone https://github.com/username/fetch-fundamental-data.git\ncd fetch-fundamental-data\npip install -r requirements.txt\npip install -e .\n```\n\n## Prerequisites\n\n1. **EODHD API Key**: You need an API key from [EODHD](https://eodhd.com/) to fetch financial data\n\n## Start\n\n### 1. Prepare Excel File\n\nCreate an Excel file (`.xlsx`) with the following format:\n\n\n\n**Important Notes:**\n- First Column: Company names\n- Second Column: Ticker symbols\n- Note! Make sure to use proper ticker formats (e.g., `DANSKE.CO` for Copenhagen exchange) that are compatible with EODHD. \n\n### 2. Run the Analysis\n\n```bash\nfetch-fundamentals --api-key YOUR_EODHD_API_KEY --input tickers.xlsx --output results.xlsx\n```\n\n### 3. View Results\n\nThe output Excel file will contain comprehensive financial data and analysis for all tickers.\n\nThe following is an example of an excel-file generated by the tickers above: \n\n\n\n\n## Command Line Usage\n\n### Basic Usage\n```bash\nfetch-fundamentals --api-key YOUR_API_KEY --input input.xlsx --output output.xlsx\n```\n\n### Advanced Usage\n```bash\n# Custom number of concurrent workers (default: 10)\nfetch-fundamentals --api-key YOUR_API_KEY --input tickers.xlsx --output results.xlsx --workers 5\n\n# Short form arguments\nfetch-fundamentals --api-key YOUR_API_KEY -i tickers.xlsx -o results.xlsx -w 5\n```\n\n### Command Line Arguments\n\n| Argument | Short | Required | Description |\n|----------|-------|----------|-------------|\n| `--api-key` | | Yes | Your EODHD API key |\n| `--input` | `-i` | Yes | Path to input Excel file |\n| `--output` | `-o` | YEs | Path to output Excel file |\n| `--workers` | `-w` | | Number of concurrent workers (1-50, default: 10) |\n| `--version` | | | Show version information |\n| `--help` | `-h` | | Show help message |\n\n## Python API Usage\n\n```python\nfrom fetch_fundamental_data import FundamentalDataFetcher\n\n# Initialize with your API key\nfetcher = FundamentalDataFetcher(api_key=\"YOUR_EODHD_API_KEY\")\n\n# Process an Excel file\nfetcher.process_excel_file(\n input_file=\"path/to/tickers.xlsx\",\n output_file=\"path/to/results.xlsx\",\n max_workers=10\n)\n\n# Or work with data directly\ncompany_list, ticker_list = fetcher.extract_tickers_from_excel(\"tickers.xlsx\")\ndf, separate_data = fetcher.fetch_all_data(company_list, ticker_list)\nanalyzed_df = fetcher.analyze_data(df, separate_data)\n```\n\n## Output Data\n\nThe output Excel file contains the following types of data:\n\n### Financial Metrics\n- **Price Information**: Current price, currency, sector\n- **Valuation Ratios**: P/E ratios (current and 5-year average), ROCE\n- **Growth Metrics**: Revenue growth, EPS growth, asset growth\n- **Profitability**: Gross profitability, free cash flow metrics\n- **Balance Sheet**: Accruals, total yield, insider ownership percentage\n\n### Analysis Scores\n- **Greenblatt Formula**: Magic Formula ranking based on P/E and ROCE\n- **Conservative Formula**: Risk-adjusted scoring based on volatility, NPY, and momentum\n- **Quality Score**: Overall quality assessment\n\n### Technical Data\n- **Moving Averages**: Various period moving averages\n- **Volatility Metrics**: Historical volatility measures\n- **Price Momentum**: Momentum indicators\n\n## Examples\n\n### Example Input File (`tickers.xlsx`)\n\n| Company | Ticker |\n|---------|--------|\n| Apple | AAPL |\n| Microsoft | MSFT |\n| Alphabet | GOOGL |\n| Amazon | AMZN |\n| Tesla | TSLA |\n\n### Example Usage\n\n```bash\n# Basic analysis\nfetch-fundamentals --api-key abc123xyz --input tickers.xlsx --output analysis.xlsx\n\n# High-speed processing (more workers)\nfetch-fundamentals --api-key abc123xyz --input large_portfolio.xlsx --output results.xlsx --workers 20\n\n# Conservative processing (fewer workers, good for rate limits)\nfetch-fundamentals --api-key abc123xyz --input tickers.xlsx --output results.xlsx --workers 3\n```\n\n## Testing\n\nBefore pushing changes, run the test script to validate functionality:\n\n```bash\npython test_package.py\n```\n\n## Contributing\n\nContributions are welcome!\n\n## Author\n\n**Carl Viggo Gravenhorst-L\u00f6venstierne**\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python package for fetching and analyzing fundamental financial data",
"version": "0.1.0",
"project_urls": {
"Bug Reports": "https://github.com/username/fetch-fundamental-data/issues",
"Documentation": "https://github.com/username/fetch-fundamental-data/blob/main/README.md",
"Homepage": "https://github.com/username/fetch-fundamental-data",
"Source Code": "https://github.com/username/fetch-fundamental-data"
},
"split_keywords": [
"finance",
" stocks",
" fundamental analysis",
" financial data",
" eodhd"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b795b38f46f191fc13ab6b8a545822a534febbdeeda17c885cf6df1c36d609c6",
"md5": "641498660a7e6c19b42ec9bdee370220",
"sha256": "60652200e27326a5bc0b26b7f1cc23f5434ea886344f52d4492d2b5b8bc9ffd0"
},
"downloads": -1,
"filename": "fetch_fundamental_data-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "641498660a7e6c19b42ec9bdee370220",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 17096,
"upload_time": "2025-07-24T14:20:09",
"upload_time_iso_8601": "2025-07-24T14:20:09.424113Z",
"url": "https://files.pythonhosted.org/packages/b7/95/b38f46f191fc13ab6b8a545822a534febbdeeda17c885cf6df1c36d609c6/fetch_fundamental_data-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "513ca2d601c7ee58f2cff2bcea7157361a41b6949ef2edfb7b7244a6ad11ba3e",
"md5": "02eec927a98b81517a462312d4e54364",
"sha256": "5509e906433533e539f5f7b0c736a6be41d00f6699c00e1d59d2a0126fe726f0"
},
"downloads": -1,
"filename": "fetch_fundamental_data-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "02eec927a98b81517a462312d4e54364",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 23628,
"upload_time": "2025-07-24T14:20:11",
"upload_time_iso_8601": "2025-07-24T14:20:11.510204Z",
"url": "https://files.pythonhosted.org/packages/51/3c/a2d601c7ee58f2cff2bcea7157361a41b6949ef2edfb7b7244a6ad11ba3e/fetch_fundamental_data-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-24 14:20:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "username",
"github_project": "fetch-fundamental-data",
"github_not_found": true,
"lcname": "fetch-fundamental-data"
}