Skip to main content

TrendScout

Real-time trend intelligence — HackerNews search, RSS feed parsing, trend velocity scoring, and multi-domain sentiment analysis. No API key required.

PyPI version CI Python 3.10+ License: MIT

Installation

pip install trendscout

Quick Start

from trendscout import TrendScout

ts = TrendScout()

# Real HackerNews data — no API key needed
df = ts.get_hackernews_trends("AI agents", limit=10)
print(df[['title', 'score', 'num_comments']].head())

# Sentiment with market signal
result = ts.analyze_sentiment("GPT-5 crushes every benchmark!", domain="tech")
print(result)

# Trend velocity
velocity = ts.get_trend_velocity("rust programming language")
print(velocity)

Features at a Glance

Feature Description
HackerNews API Real stories via Algolia — free, no key, always fresh
RSS/Atom Feeds Tech, AI, business, Python presets + custom URLs
Trend Velocity Momentum score 0–1 with status: emerging/peak/stable/declining
Sentiment Analysis TextBlob + domain-aware lexicons (financial, tech, social)
Multi-topic Analysis Compare topics side-by-side in a ranked DataFrame
DataFrame Batch Bulk sentiment analysis on any text DataFrame

HackerNews Trends (Real Data)

from trendscout import TrendScout

ts = TrendScout()

# Search by keyword — uses HN Algolia API
df = ts.get_hackernews_trends("large language models", limit=20)
print(df[['title', 'score', 'num_comments', 'author']].head(5))
#                                               title  score  num_comments  author
# 0    LLMs are now good enough for production use    847            312   pg
# 1    Show HN: Open-source LLM benchmark suite      412            189   teyfikoz
# ...

# Top stories right now
from trendscout.sources.hackernews import HackerNewsSource
hn = HackerNewsSource()
top = hn.get_top_stories(limit=10)
for story in top:
    print(f"[{story.score:4d}] {story.title[:70]}")

RSS / Atom Feed Parsing

ts = TrendScout()

# Preset categories: tech | ai | business | python | startup
tech_news = ts.get_rss_trends(category="tech", limit=15)
ai_news   = ts.get_rss_trends(category="ai", limit=10)

print(tech_news[['title', 'published', 'feed_name']].head())

# Custom feed URLs
custom = ts.get_rss_trends(
    feeds=[
        "https://feeds.hnrss.org/newest?points=100",
        "https://planetpython.org/rss20.xml",
    ],
    limit=20,
)

Trend Velocity Scoring

velocity = ts.get_trend_velocity("quantum computing")
print(velocity)
# Trend   : quantum computing
# Velocity: [████████░░░░░░░░░░░░] 0.42
# Status  : PEAK
# Articles: 12  |  Avg engagement: 156
# → Trending now — maximise exposure before it plateaus

# Status meanings:
# emerging  (0.70–1.00) — fast-growing, act now
# peak      (0.40–0.70) — trending, maximise reach
# stable    (0.15–0.40) — evergreen, good for long-form
# declining (0.00–0.15) — losing momentum, pivot keywords

Multi-Topic Comparison

report = ts.analyze_topics(
    ["AI agents", "blockchain", "quantum computing", "WebAssembly", "Rust"],
    source="hackernews",
)
print(report.to_string(index=False))
#              topic  velocity_score   status  article_count  avg_engagement
#          AI agents           0.87 emerging             24           312.4
#               Rust           0.64     peak             18           198.2
# quantum computing           0.42     peak             12           156.1
#        blockchain           0.21   stable              8            89.3
#     WebAssembly            0.09 declining              4            42.0

Sentiment Analysis

# General sentiment
result = ts.analyze_sentiment("The product launch exceeded all expectations.")
print(result.label)       # positive
print(result.intensity)   # strong
print(result.polarity)    # 0.625

# Financial domain (detects bullish/bearish signals)
fin = ts.analyze_sentiment("Revenue surged 40% beating analyst estimates.", domain="financial")
print(fin.market_signal)  # bullish
print(fin.confidence)     # 0.92

# Tech news domain
tech = ts.analyze_sentiment("Critical vulnerability found in popular library.", domain="tech")
print(tech.market_signal)  # bearish
print(tech.label)          # negative

Batch DataFrame Analysis

import pandas as pd

headlines = pd.DataFrame({
    'headline': [
        "OpenAI releases new model beating GPT-4",
        "Tech stocks plunge amid regulatory fears",
        "Startup raises $50M Series B for AI platform",
        "Security breach affects millions of users",
    ]
})

result = ts.analyze_dataframe(headlines, text_col="headline", domain="financial")
print(result[['headline', 'sentiment_label', 'market_signal', 'polarity']])

Direct Source Access

from trendscout.sources.hackernews import HackerNewsSource
from trendscout.sources.rss import RSSFeedSource

# HackerNews
hn = HackerNewsSource()
stories = hn.search("python async", limit=5)
for s in stories:
    print(f"[{s.score}] {s.title}")

# RSS
rss = RSSFeedSource()
items = rss.fetch("https://feeds.hnrss.org/newest?points=100", limit=5)
for item in items:
    print(item.title)

Full Intelligence Pipeline

from trendscout import TrendScout

ts = TrendScout()
topics = ["AI agents", "edge computing", "Web3", "open source LLMs"]

# 1. Velocity comparison
report = ts.analyze_topics(topics)

# 2. Fetch real articles for the top trend
top_topic = report.iloc[0]['topic']
articles = ts.get_hackernews_trends(top_topic, limit=20)

# 3. Batch sentiment on the articles
enriched = ts.analyze_dataframe(articles, text_col="title", domain="tech")

# 4. Summary
bullish_count = (enriched['market_signal'] == 'bullish').sum()
print(f"Top trend: {top_topic}")
print(f"Velocity: {report.iloc[0]['velocity_score']:.2f} ({report.iloc[0]['status']})")
print(f"Positive articles: {bullish_count}/{len(enriched)}")

License

MIT — Teyfik Öz

Metadata

Release files for trendscout 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trendscout 1.1.0
File Size Uploaded
trendscout-1.1.0.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trendscout 1.1.0
File Interpreter ABI Platform
trendscout-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / trendscout-1.1.0.tar.gz

Download URL trendscout-1.1.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
15dcd5d0fc19bb4af5a0b2344e1a9665c867e50d1b8a85fc2bff388dd955639b
BLAKE2b-256 checksum
How to use checksums
1b487e2300570e07b7046d1ee37a808f408ebee1a110149e82dc500805a8f259
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / trendscout-1.1.0-py3-none-any.whl

Download URL trendscout-1.1.0-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84e92054780b01657b0bf82c11e22483f816be05db7711821a9e9e3dcc95e17e
BLAKE2b-256 checksum
How to use checksums
96ddaf3d579d30f6dc771251b926d64e6982a046c04655b3c6520f3ac3897a5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page