Skip to content

feat(schedule): implement full GTFS export module with deterministic validation #7#8

Open
Gepacam wants to merge 5 commits intomainfrom
feature/export-gtfs-#7
Open

feat(schedule): implement full GTFS export module with deterministic validation #7#8
Gepacam wants to merge 5 commits intomainfrom
feature/export-gtfs-#7

Conversation

@Gepacam
Copy link
Collaborator

@Gepacam Gepacam commented Nov 7, 2025

Description

  • Implements export_gtfs_schedule() for full GTFS Schedule export to a valid ZIP archive.
  • Serializes 9 Schedule models (Agency, Routes, Stops, Trips, StopTimes, Calendar, CalendarDates, Shapes, FeedInfo).
  • Deterministic datasets verified via unit tests and manual CLI execution.
  • Metadata (version, timestamp) embedded into feed_info.txt during export.
  • MBTA feed import/export remains experimental, due to dataset size — to be optimized via bulk inserts.

Changes


Subissue


Checklist

  • All 9 core GTFS Schedule models exported successfully.
  • Deterministic synthetic data verified via pytest.
  • Exported ZIP validated manually (tmp_gtfs/exported_feed.zip).
  • MBTA feed integration planned for optimization phase.
  • Tests pass locally

Implements core GTFS Schedule entities (agency, routes, trips, stops, stop_times, shapes, calendar, calendar_dates, feed_info)
with ForeignKeys and UniqueConstraints as specified in GTFS v2.0.

Migrations were created and applied successfully under PostGIS backend.

Closes #3.
…CPKs per academic guidance

Implements deterministic CRUD test coverage for the GTFS Schedule module, ensuring referential integrity across
AgencySchedule, CalendarSchedule, and ShapeSchedule.
Composite Primary Keys (CPKs) were intentionally not implemented, per academic guidance from course instructor,
to maintain compatibility with Django ORM and simplify admin integration.
…gration #5

Adds management command `create_schedule_fixtures` to generate a minimal, deterministic GTFS Schedule dataset.
Includes --seed and --output options, produces a tiny, loaddata-friendly JSON, and is exercised by a pytest test.

- Shapes PKs are numeric to align with Django's AutoField/BigAutoField.
- Tests run without PostGIS by using the non-GIS test settings.
- Validated end-to-end via `pytest -v tests/test_fixtures.py`.
#6

Implements complete GTFS Schedule import pipeline supporting all 9 core files:
agency, routes, stops, trips, calendar, calendar_dates, stop_times, shapes, and feed_info.

Validates referential integrity across related models and performs bulk inserts under a single transaction.
Includes integration test (test_import_full_gtfs.py) generating synthetic GTFS ZIP in tmp_gtfs/ to verify end-to-end ingestion.
…validation #7

Implements export_gtfs_schedule() to serialize all Schedule models into GTFS v2.0-compliant text files and ZIP package.
Includes deterministic validation with synthetic data and metadata embedding.
MBTA feed import/export remains experimental due to dataset size.
@Gepacam Gepacam requested a review from fabianabarca November 7, 2025 07:09
@Gepacam Gepacam self-assigned this Nov 7, 2025
Gepacam added a commit that referenced this pull request Nov 12, 2025
…hooks (#8)

Add ETABuilder with deterministic ETA generation and Bytewax integration.
Includes management command to build stop_times.txt reproducibly and tests with synthetic data.
Fulfills Subissue #8 acceptance criteria (pluggable interface, deterministic output, synthetic testing).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant