Skip to main content

Extract sections from PDFs and perform sentiment analysis

Project description

PDF Section Sentiment

PyPI version

A lightweight CLI tool to extract structured sections from PDFs and perform sentiment analysis on each section.


🚀 Features

  • Extracts headers and sections from PDFs
  • Supports Markdown-like structure
  • Performs sentiment scoring (-1 to +1)
  • Labels sentiment as positive, neutral, or negative
  • Outputs clean JSON

📦 Installation

pip install pdf-section-sentiment

## ⚙️ Usage
pdf-extract --input path/to/document.pdf --output sections.json
pdf-sentiment --input sections.json --output sentiment.json

## 📝 Output Format
[
  {
    "header": "Executive Summary",
    "content": "Lyft reported strong revenue growth and operational efficiency...",
    "sentiment_score": 0.28,
    "sentiment": "positive"
  },
  {
    "header": "Risk Factors",
    "content": "There is uncertainty in market regulation...",
    "sentiment_score": -0.15,
    "sentiment": "negative"
  }
]

## 🧪 Example
pdf-extract --input data/Lyft-Annual.pdf --output output/sections.json
pdf-sentiment --input output/sections.json --output output/sentiment.json

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

pdf_section_sentiment-0.1.5.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

pdf_section_sentiment-0.1.5-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pdf_section_sentiment-0.1.5.tar.gz.

File metadata

  • Download URL: pdf_section_sentiment-0.1.5.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pdf_section_sentiment-0.1.5.tar.gz
Algorithm Hash digest
SHA256 df8b052e846376a9e0270026a0f8effa1f38f5f98e18bf6a0e7aa912922f3051
MD5 7d0593a59c7571f1de90698e4b5e8d00
BLAKE2b-256 ae096ef50578b41a53a66825eb56523bbc016488bc053ae1a0d0cc6ad73a0b18

See more details on using hashes here.

File details

Details for the file pdf_section_sentiment-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for pdf_section_sentiment-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1ad273d3c1ef341b60b10be7379488c30518b7831945ca0b1d1028c8d51c1316
MD5 a07e29a5b9cb7de3ba4039e9ee276b84
BLAKE2b-256 e03f94c238633d2dbfac29ae556cbaa4a49c2b76c6933be0064e6dc560b44fb3

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