Skip to main content

A Python package for fetching financial data from Excel files and performing fundamental analysis

Project description

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.

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

  1. 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:

Alt text

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

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

Author

Carl Viggo Gravenhorst-Lövenstierne

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fetchfinancialsexcel-0.3.1.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fetchfinancialsexcel-0.3.1-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file fetchfinancialsexcel-0.3.1.tar.gz.

File metadata

  • Download URL: fetchfinancialsexcel-0.3.1.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.9

File hashes

Hashes for fetchfinancialsexcel-0.3.1.tar.gz
Algorithm Hash digest
SHA256 77c5c71d14adc2f1c1bae8e02a3695ae5c75ebba2c7fa27e174f5c5c74feb2ee
MD5 252b43766b36f0e64d0803c6cba0a7f4
BLAKE2b-256 0d8ec33fbaae8d2f660202936bf5246bd826dcf6e28b1ff366e057c514ce13f0

See more details on using hashes here.

File details

Details for the file fetchfinancialsexcel-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fetchfinancialsexcel-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6502e9c37bd80f5803babab4644d9be4fea3d1d9858d70e8758edf59446cd9d7
MD5 eaa39ca61abef4d988697b3d22dde7d1
BLAKE2b-256 f16cc707d654abb53523340d4342574a7f841e1dd9c96cfb299933de77ed421d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page