Skip to main content

A Python package to fetch, scrape, and analyze earnings call transcripts.

Project description

Earnings Call Sentiment Analyzer

This Python package provides a tool to fetch company profile data, scrape the latest earnings call transcript from The Motley Fool, perform sentiment analysis, and correlate sentiment with stock performance.

Features

  • Flexible Transcript Scraping: Automatically finds and scrapes earnings call transcripts for a given stock ticker from fool.com, with options to specify a particular quarter and year or default to the latest.
  • Company Data: Fetches company profile information (sector, industry) from the Financial Modeling Prep API.
  • AI-Powered Sentiment Analysis: Uses the Google Gemini API to analyze the transcript and provide a sentiment score, confidence level, and key discussion themes.
  • Data Persistence: Stores company profiles, earnings call details, sentiment analysis results, and stock performance data in a local SQLite database (earnings_analyzer.db).
  • Structured Output: Returns a clean dictionary object containing all the fetched and analyzed data, including the earnings call date and quarter.
  • Robust Error Handling: Includes comprehensive error handling and logging for API calls, data processing, and database operations.

Installation

You can install the package from PyPI:

pip install earnings-analyzer

Prerequisites

Before using the package, you must set up the required API keys.

Financial Modeling Prep (FMP) API Key

The Financial Modeling Prep (FMP) API is used to fetch company profile information (sector, industry). You can obtain a free API key by signing up on their website: https://financialmodelingprep.com/developer/docs/

Google Gemini API Key

The Google Gemini API is used for AI-powered sentiment analysis of the transcripts. You can obtain a Gemini API key from the Google AI Studio: https://aistudio.google.com/app/apikey

Setting Environment Variables

Create a file named .env in the directory where you will run the script (or set them as system-wide environment variables) and add the following keys:

GEMINI_API_KEY=your_gemini_api_key_here
FMP_API_KEY=your_financial_modeling_prep_api_key_here

Alternatively, you can set them directly in your shell:

Windows (Command Prompt):

set GEMINI_API_KEY=your_gemini_api_key_here
set FMP_API_KEY=your_financial_modeling_prep_api_key_here

Windows (PowerShell):

$env:GEMINI_API_KEY="your_gemini_api_key_here"
$env:FMP_API_KEY="your_financial_modeling_prep_api_key_here"

macOS/Linux:

export GEMINI_API_KEY=your_gemini_api_key_here
export FMP_API_KEY=your_financial_modeling_prep_api_key_here

Usage

The package provides an EarningsAnalyzer class that encapsulates the entire workflow. You can use it in your own Python script or via the command-line interface.

Data Usage Disclaimer

This tool is for educational and research purposes. Users are responsible for:

  • Obtaining proper API keys and respecting rate limits
  • Complying with data provider terms of service
  • Not using for illegal market manipulation

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

earnings_analyzer-1.0.2.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

earnings_analyzer-1.0.2-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file earnings_analyzer-1.0.2.tar.gz.

File metadata

  • Download URL: earnings_analyzer-1.0.2.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for earnings_analyzer-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3ee3f46d6d7e3a2d6c57becb0440b511f653cd5dcf02b5df43a46c392cd3569f
MD5 0af57bc95dd9dd71cbced4717a670251
BLAKE2b-256 6db500d94cb2aa464cf492f4225f734ce017302b2601211e8168c0dcf9869558

See more details on using hashes here.

File details

Details for the file earnings_analyzer-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for earnings_analyzer-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e57a695c22d7dd8e0c626aa76117e4cef5aa98949df097d10ac7c8684ce26da
MD5 83c57c001088fd4d7fd6f97004c00466
BLAKE2b-256 dfa641f81c6f2ed0faf4a865100cb2bb5bf078dff14e4d41ec748a873abda0ee

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