FetchFinancialsExcel
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. It reads ticker symbols from an input Excel sheet, queries the EODHD API for relevant financial data, and outputs a comprehensive analysis report in a new Excel file.
IMPORTANT: This software is licensed for noncommercial use only under the PolyForm Noncommercial License 1.0.0. Commercial use is prohibited without a separate commercial license. See the
LICENSEfile for details.
Features
- Concurrent Data Fetching: Efficiently fetches financial data for multiple stocks concurrently.
- Comprehensive Analysis: Calculate key financial metrics not directly avaibale in EODHD including:
- 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 file and output results to an file
Installation
From PyPI
pip install FetchFinancialsExcel
Development Installation
git clone https://github.com/username/FetchFinancialsExcel.git
cd FetchFinancialsExcel
pip install -r requirements.txt
pip install -e .
Prerequisites
- EODHD API Key: You need an API key from EODHD 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.COfor Copenhagen exchange) that are compatible with EODHD.
2. Run the Analysis
fetch-financials-excel --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.
Command Line Usage
Basic Usage
fetch-financials-excel --api-key YOUR_API_KEY --input input.xlsx --output output.xlsx
Advanced Usage
# Custom number of concurrent workers (default: 10)
fetch-financials-excel --api-key YOUR_API_KEY --input tickers.xlsx --output results.xlsx --workers 5
# Short form arguments
fetch-financials-excel --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
from fetchfinancialsexcel 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
Testing
Before pushing changes, run the test script to validate functionality:
python test_package.py
License
This project is licensed under the PolyForm Noncommercial License 1.0.0. Commercial use is prohibited. See the LICENSE file or visit https://polyformproject.org/licenses/noncommercial/1.0.0/ for full terms.
Author
Carl Viggo Gravenhorst-Lövenstierne
Metadata
Release files for FetchFinancialsExcel 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fetchfinancialsexcel-0.4.0.tar.gz | 28.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fetchfinancialsexcel-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.9 kB
Release files / fetchfinancialsexcel-0.4.0.tar.gz
| Download URL | fetchfinancialsexcel-0.4.0.tar.gz |
|---|---|
| Size | 28.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffc97ba5e8cc3c3794f6e8b7087b8e8417dab9cf8f5d9514b34cb05f7cbaf6b7
|
|
BLAKE2b-256 checksum How to use checksums |
2b58066219ef37bf28e017e0bb7b691283b2d4883c037eff6d39102e5795f394
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.9
|
Release files / fetchfinancialsexcel-0.4.0-py3-none-any.whl
| Download URL | fetchfinancialsexcel-0.4.0-py3-none-any.whl |
|---|---|
| Size | 24.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b9fdbd94bee0747d9dc5ce94e0ac7f0a40235a412fa12928e30f6a099e40e28
|
|
BLAKE2b-256 checksum How to use checksums |
e7f29d7b39616f32a994485e0d7ae1616ed5b336ac9c9ba2a910edde625a6e0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.9
|
Security for FetchFinancialsExcel 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.