A complete PySpark project accompanying the VLAI PySpark Tutorial (19 topics).
- Download data:
python scripts/crawl_nyc_taxi.py - Run batch pipeline:
python -m taxi_analytics.jobs.run_analytics - Run streaming pipeline:
python -m taxi_analytics.jobs.run_streaming - Run tests:
pytest -q
scripts/crawl_nyc_taxi.py— Download NYC Taxi datasrc/taxi_analytics/— Core packageutils/spark.py— SparkSession creationpipeline/— Batch pipeline (io, clean, enrich, aggregate)streaming/— Streaming pipeline (same logic, different I/O)jobs/run_analytics.py— Batch entry pointjobs/run_streaming.py— Streaming entry pointml/— MLlib models
src/lessons/— Per-topic example scriptstests/— pytest suite
Dataset: NYC TLC Yellow Taxi, Jan-Mar 2023 (~140 MB Parquet)
- Download data:
python scripts/crawl_nyc_taxi.py - Batch pipeline:
python -m taxi_analytics.jobs.run_analytics [trips_path] [zones_path] [output_path] - Streaming pipeline:
python -m taxi_analytics.jobs.run_streaming [stream_input] [output_path]- In another terminal:
cp data/stream_backup/*.parquet data/stream_input/to feed data
- In another terminal:
- Tests:
pytest -q