Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Dow 30 Financial Reports Extraction Pipeline

Overview

Automates the discovery, extraction, filtering, downloading, parsing, and cloud storage of quarterly earnings reports for Dow 30 companies. Powered by Apache Airflow, OpenAI GPT-4o, Docling, and AWS S3.

Architecture Diagram

Project LANTERN Architecture


Setup Instructions

1. Prerequisites

  • RAM: 8GB+ recommended
  • Docker Desktop (Windows/Mac) or Docker Engine + Compose (Linux)
  • Git
  • AWS Account (for S3 storage)
  • OpenAI API Key

2. Clone the Repository

git clone https://github.com/Binary-Insights/Assignment_02.git
cd Assignment_02

3. Configure Environment

Create a .env file in the project root:

AIRFLOW_UID=50000
_AIRFLOW_WWW_USER_USERNAME=airflow
_AIRFLOW_WWW_USER_PASSWORD=airflow
OPENAI_API_KEY=your_openai_api_key_here
AWS_ACCESS_KEY_ID=your_access_key_here
AWS_SECRET_ACCESS_KEY=your_secret_key_here
AWS_DEFAULT_REGION=us-east-1
S3_BUCKET_NAME=damg-binaryinsights-assignment-02

4. Build and Start Airflow

# Initialize Airflow database (first time only)
docker compose up airflow-init

# Start all services
docker compose up -d

5. Access Airflow UI


Run Instructions

1. Full Pipeline (Recommended)

Run the complete pipeline via Airflow UI:

2. Manual Step-by-Step

You can run individual DAGs in order:

  1. discover_dag – Fetch Dow 30 list
  2. process_ir_dag – Extract PDF links
  3. filter_dag – Filter reports with AI
  4. download_dag – Download PDFs
  5. parsing_dag – Parse with Docling
  6. storing_dag – Upload to S3

Project LANTERN Architecture

Results Summary

  • 30 companies fetched (30 Dow)
  • 28 IR pages discovered (2 failed: DOW, INTC)
  • 25 IR pages processed
  • 25 companies filtered, downloaded, parsed, and stored in S3
  • 100% success rate for filtering, downloading, parsing, and storage stages
  • S3 Bucket: damg-binaryinsights-assignment-02 (prefix: assignment_02/parsed/)

Folder Structure

data/
├── discover/
│   ├── dow30_companies.csv          # 31 companies
│   ├── dow30_companies.json         # 31 companies
│   ├── ir_pages_discovered.json     # 29 IR pages
│   └── ir_pages.json                # 25 processed pages
├── latest_reports.csv               # 25 filtered reports
├── latest_reports.json              # 25 filtered reports
├── raw/
│   └── {TICKER}/                    # 25 companies × PDFs
└── parsed/
    └── {TICKER}/                    # 25 companies × 5+ files each
        └── {REPORT_NAME}/
            ├── document.md          # Markdown content
            ├── document.json        # Structured JSON
            ├── tables.csv           # Financial tables
            ├── document.txt         # Plain text
            └── provenance.json      # Metadata & lineage

Troubleshooting

  • AWS credentials not found: Check .env and restart containers
  • OpenAI API error: Verify API key in .env
  • Dag references non-existent pools: ['parsing_pool']: Create pool in Airflow UI (Admin → Pools) or remove pool reference from DAG
  • Chrome not found: Ensure Dockerfile installs Chrome

Support

  • See docs/ and setup/ for detailed guides

Codelabs - Documentation

Access interactive documentation and tutorials for Project LANTERN:

Automating the Dow 30 Earnings Pipeline

Video Demo

Attestation WE ATTEST THAT WE HAVEN’T USED ANY OTHER STUDENTS’ WORK IN OUR ASSIGNMENT AND ABIDE BY THE POLICIES LISTED IN THE STUDENT HANDBOOK.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages