A Python-based platform for managing and uploading BART station data. This monorepo includes a gRPC backend service, a CLI uploader, and shared protobuf definitions. Built for speed, reliability, and modularity.
- gRPC backend for high-throughput, real-time data ingestion.
- CLI tool for uploading CSV files to the service.
- Shared protobuf definitions for consistent data structures.
- Modular and maintainable project structure using Poetry.
- Python 3.14+
- Poetry
- gRPC server running locally (
localhost:50051) - Optional: Docker if using
docker-compose.ymlfor local services
- Clone the repository
git clone <your-repo-url>
cd bart-data-platform- Install dependencies using Poetry
poetry install
- Generate gRPC Python files (if .proto changes):
python3 -m grpc_tools.protoc \
-I=proto \
--python_out=shared/shared \
--grpc_python_out=shared/shared \
proto/bart_station.proto
- Install the shared package in your environment:
poetry add ./shared
poetry run python -m bartdataservice.bartdataservice.grpc_server
-
Runs the gRPC service on localhost:50051.
-
Handles station creation requests from the CLI.
poetry run bartdatauploader ../data/station-names.csv
- CLI prints upload results per row:
Uploaded Embarcadero: success=True, message='Created'
Uploaded Montgomery: success=True, message='Created'
-
Positional argument: FILE_PATH – path to the CSV file.
-
No subcommands required — simply pass the CSV as the first argument.