Skip to content

helomri/gtfs_bindings

Repository files navigation

A utility package to read the contents of a GTFS Schedule dataset.

Features

  • GTFS Schedule
    • Files

      • Basic files
        • ✅ agency.txt
        • ✅ stops.txt
        • ✅ routes.txt
        • ✅ trips.txt
        • ✅ stop_times.txt
        • ✅ calendar.txt
        • ✅ calendar_dates.txt
      • GTFS-Fares (V1 and V2)
        • ✅ fare_attributes.txt
        • ✅ fare_rules.txt
        • ✅ fare_media.txt
        • ✅ fare_products.txt
        • ✅ rider_categories.txt
        • ✅ fare_leg_rules.txt
        • ✅ fare_leg_join_rules.txt
        • ✅ fare_transfer_rules.txt
        • ✅ timeframes.txt
        • ✅ networks.txt
        • ✅ route_networks.txt
        • ✅ areas.txt
        • ✅ stop_areas.txt
      Unsupported files (WIP)
      • ❌ shapes.txt
      • ❌ frequencies.txt
      • ❌ transfers.txt
      • ❌ pathways.txt
      • ❌ levels.txt
      • ❌ location_groups.txt
      • ❌ location_group_stops.txt
      • ❌ locations.geojson
      • ❌ booking_rules.txt
      • ❌ translations.txt
      • ❌ feed_info.txt
      • ❌ attributions.txt
    • Features

      • ✅ Load data from any supported file using query parameters
      • ✅ List services for one or more days
      • ✅ Works with streamed data
      • ✅ List directions for a route
      • ✅ See next departures from a stop
  • ❌ GTFS Realtime

Getting started

Add this package to your Dart/Flutter project :

dart pub add gtfs_bindings
flutter pub add gtfs_bindings

Usage

Schedule

Construct a GTFSDataset, populate (load in memory) its primary bindings, enjoy.

import 'package:gtfs_bindings/schedule.dart';
import 'package:path_provider/path_provider.dart';

Future<void> main() async {
  final dataset = DownloadableDataset(uri); // Place the URL to the dataset here.
  await dataset.pipe(tempDir: await getTemporaryDirectory()); // Will download and cache the dataset (do not fill tempDir while on Web).
  await dataset.populateList(dataset.primaryBindings); // Will load the main small files into memory for faster access.
}

Additional information

WIP: THIS IS NOT STABLE. The API may change at any instant. Please wait for 1.0.0 to start deeply integrating any function. The actual APIs to query data are stable

About

Parse GTFS Schedule datasets and access utility functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages