Real-time trend intelligence with HackerNews, RSS feeds, trend velocity, and multi-domain sentiment
Project description
TrendScout
Real-time trend intelligence — HackerNews search, RSS feed parsing, trend velocity scoring, and multi-domain sentiment analysis. No API key required.
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
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
trendscout-1.1.0.tar.gz
(15.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trendscout-1.1.0.tar.gz.
File metadata
- Download URL: trendscout-1.1.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15dcd5d0fc19bb4af5a0b2344e1a9665c867e50d1b8a85fc2bff388dd955639b
|
|
| MD5 |
e4b54d317f8805c6eeb13f275e566e2c
|
|
| BLAKE2b-256 |
1b487e2300570e07b7046d1ee37a808f408ebee1a110149e82dc500805a8f259
|
File details
Details for the file trendscout-1.1.0-py3-none-any.whl.
File metadata
- Download URL: trendscout-1.1.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84e92054780b01657b0bf82c11e22483f816be05db7711821a9e9e3dcc95e17e
|
|
| MD5 |
550b3e0f8f901435b17356270a1b7edd
|
|
| BLAKE2b-256 |
96ddaf3d579d30f6dc771251b926d64e6982a046c04655b3c6520f3ac3897a5f
|