Skip to main content

Unified news aggregation CLI — 9 sources, 25+ modules, natural language DSL

Project description

newscli

Unified news aggregation CLI — pull from 9 sources in one command.

newscli get hackernews topstories 5
newscli get github trending 10 language python
newscli get all 15 json

"Build Status" "PyPI Version" "License"

📄 中文版


Install

# From TestPyPI (works now, globally accessible)
pip install --index-url https://test.pypi.org/simple/ newscli-tool

# From GitHub (dev branch, latest)
pip install git+https://github.com/kzclaw/news-cli.git

# One-liner (any machine with curl + python3)
curl -sSL https://raw.githubusercontent.com/kzclaw/news-cli/main/install.sh | bash

After install, newscli is available in your terminal globally.


Features

Feature Details
9 sources Hacker News · GitHub Trending · Hugging Face · ZAKER · V2EX · Reddit · DEV.to · Lobsters · RSS
25+ modules Each source has multiple views — topstories, trending, ask, show, job, by language, by node, by subreddit…
Natural language DSL get, list, , — no flags to remember
URL enrichment Auto-fetches og:description for every item with summary = null
Deduplication Cross-source Jaccard similarity, 70% threshold, keeps richer item
JSON output NewsItem v1.0 schema — always 9 fields, null means "source doesn't have it"

Usage

Natural language mode

newscli get <source> <module> [limit] [json] [noenrich]

Examples

# Single source
newscli get hackernews topstories 5
newscli get github trending 10 language python
newscli get v2ex node python 10
newscli get reddit subreddit technology 10
newscli get huggingface daily 5

# Multi-source (AND)
newscli get hackernews topstories 5 and github trending 10 and reddit subreddit programming 5

# All sources
newscli get all 15 json

# JSON output (machine-readable)
newscli get hackernews topstories 5 json
newscli get all 3 json noenrich

# List available sources / modules
newscli list
newscli list github
newscli list v2ex

Flag mode

python3 -m newscli --source hackernews:topstories --limit 5 --json
python3 -m newscli --source "hackernews:topstories&github:trending" --limit 5

Source & Module Reference

Source Modules
hackernews topstories · new · ask · show · jobs
github trending · trending-weekly · trending-monthly · language parameter
huggingface daily · weekly · monthly
zaker hot · news · search · category parameter
v2ex hot · latest · node:<name>
reddit subreddit:<name> · popular · hot
devto latest · top · tags:<tag>
lobsters newest · hot · top · upcoming
rss feed:<url> — any RSS/Atom feed by URL

Output Schema

Every item follows NewsItem v1.0 — null means "source doesn't provide this", never faked:

Field Type Description
source str Source name (e.g. hackernews)
module str Sub-module (e.g. topstories)
title str Item title
url str Link to item
author str|null Author / submitter
published_at datetime|null Publication time
summary str|null Description or og:description
score int|null Score / points (if available)
comments int|null Comment count (if available)

Architecture

newscli/
├── cli.py          # Dual-mode entry: flags + NL DSL
├── aggregator.py   # ThreadPoolExecutor dispatcher + deduplication
├── parser.py       # NL DSL parser (no AI — pure rules)
├── enrich.py       # Concurrent og:description fetcher
└── sources/
    ├── base.py     # NewsSource ABC + NewsItem schema
    ├── hackernews.py
    ├── github.py
    ├── huggingface.py
    ├── zaker.py
    ├── v2ex.py
    ├── reddit.py
    ├── devto.py
    ├── lobsters.py
    └── rss.py

Requirements

  • Python 3.10+
  • requests · beautifulsoup4 · lxml (installed automatically)

License

MIT · kzclaw/news-cli

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

newscli_tool-1.0.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

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

newscli_tool-1.0.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file newscli_tool-1.0.0.tar.gz.

File metadata

  • Download URL: newscli_tool-1.0.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for newscli_tool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4942483c536f1f3e4cb6c8f579c5c7e8374a2f467e92d4b479bf3002c143b0d9
MD5 20203c67e8e61783e3339ce726f1fbf6
BLAKE2b-256 339852e0a61cd94e7fe2610908c9f7f6d098ba8aeea6b36658d593e043d6eb51

See more details on using hashes here.

File details

Details for the file newscli_tool-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: newscli_tool-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for newscli_tool-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4efb7f5820b0f61be24a5bd5fbfc38494d2b20845c8fb1f8a91870a000ec1fc
MD5 7e33ada04331ab12c11032df430cefb4
BLAKE2b-256 6f9fd0a8808051c6f8722851e8838cec422a6994408ea2bc14eec0cba83b0fdd

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