Author: Xindi Li
This project ingests a JSONL (JSON Lines) dataset into MongoDB and runs simple analytics queries from the command line. It is a small end-to-end demo of a real-world data workflow: load → clean → query → report.
- Python scripting for data pipelines
- JSON/JSONL parsing and streaming file processing
- Batch insertion into MongoDB (PyMongo)
- Basic data cleaning (ISO
publisheddatetime parsing) - Writing MongoDB queries + aggregation pipelines
- Building a CLI tool using
argparse
pip install pymongoDefault connection: mongodb://localhost:27017python main.py ingest --jsonl sample_articles.jsonl --batch 1000 --dropTop words by media type
python main.py query --mode top_words --media newsCount news vs blog on a given day
python main.py query --mode day_diff --date 2015-01-01Top news sources in a year
python main.py query --mode top_sources --year 2015Most recent articles from a source
python main.py query --mode recent --source "Example News"Default database settings are defined in config.py (db: demo_db, collection: articles).