tl

package module
v1.0.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2024 License: GPL-3.0 Imports: 3 Imported by: 1

README

Interline Transitland

transitland-lib is a library and command-line tool for reading, writing, and processing transit data in GTFS and related formats. The library is structured as a set of data sources, filters, and transformations that can be mixed together in a variety of ways to create processing pipelines. The library supports the DMFR format to describe feed resources.

GoDoc Go Report Card

Table of Contents

Installation

Download prebuilt binary

The transitland binaries for Linux and macOS are attached to each release.

Install using homebrew

The transitland binary can be installed using homebrew. The executable is code-signed and notarized.

brew install interline-io/transitland-lib/transitland-lib
Install binary from source
go get github.com/interline-io/transitland-lib/cmd/transitland

This package uses Go Modules and will also install required dependencies.

Main dependencies:

  • twpayne/go-geom
  • jmoiron/sqlx
  • Masterminds/squirrel
  • jackc/pgx
  • mattn/go-sqlite3 (requires CGO)

Usage as a CLI tool

The main subcommands are:

Breaking changes

Note: as of v0.17, we moved from Go standard library flags to Cobra's pflags; this is a breaking change in that single-dash (-flag) command flags are no longer supported, only double-dash (--flag).

Usage as a library

See library examples.

Database migrations

Migrations are supported for PostgreSQL, using the schema files in internal/schema/postgres/migrations. These files can be read and applied using golang-migrate, which will store the most recently applied migration version in schema_migrations. See the bootstrap.sh script in that directory for an example, as well as details on how to import Natural Earth data files for associating agencies with places.

SQLite database are intended to be short-lived. They can be created on an as needed basis by passing the -create flag to some commands that accept a writer. They use a single executable schema, defined in internal/schema/sqlite.sql.

Usage as a Web Service

See transitland-server documentation.

Included Readers and Writers

Target Module Supports Read Supports Write
CSV tlcsv
SQLite tldb
PostgreSQL (with PostGIS) tldb

We welcome the addition of more readers and writers.

Development

transitland-lib follows Go coding conventions.

GitHub Actions runs all tests, stores code coverage reports as artifacts, and prepares releases.

Releases

Releases follow Semantic Versioning conventions.

To cut a new release:

  1. Run go generate ./... to update auto-generated documentation.
  2. Create a GitHub release. This will create a tag and GitHub Actions will create & attach code-signed binaries.
  3. Download the files from the release, and update the homebrew formula with the updated sha256 hashes and version tag.

Licenses

transitland-lib is released under a "dual license" model:

  • open-source for use by all under the GPLv3 license
  • also available under a flexible commercial license from Interline

Documentation

Overview

Package tl provides the core types and utility functions for transitland-lib.

Index

Constants

This section is empty.

Variables

View Source
var GTFSRTVERSION = "6fcc3800b15954227af7335d571791738afb1a67"

GTFSRTVERSION is the commit for the gtfs-realtime.proto file.

View Source
var GTFSVERSION = "11a49075c1f50d0130b934833b7eeb3fe518961c"

GTFSVERSION is the commit for the spec reference.md file.

Functions

This section is empty.

Types

type VersionInfo

type VersionInfo struct {
	Tag        string
	Commit     string
	CommitTime string
}
var Version VersionInfo

Read version from compiled in git details

Directories

Path Synopsis
cmd
Package cmds provides CLI tools for running various actions
Package cmds provides CLI tools for running various actions
Package copier provides tools and utilities for copying and modifying GTFS feeds.
Package copier provides tools and utilities for copying and modifying GTFS feeds.
Package diff provides tools and utilities for comparing GTFS feeds.
Package diff provides tools and utilities for comparing GTFS feeds.
Package dmfr provides tool and utilities for working with DMFR files and database representations of feeds and feed versions.
Package dmfr provides tool and utilities for working with DMFR files and database representations of feeds and feed versions.
doc
cli
ext
Package extract provides tools and utilities for extracting subsets of GTFS feeds.
Package extract provides tools and utilities for extracting subsets of GTFS feeds.
Package filters provides tools for modifying and transforming streams of GTFS entities.
Package filters provides tools for modifying and transforming streams of GTFS entities.
internal
rt
Package rt provides support for GTFS-RealTime.
Package rt provides support for GTFS-RealTime.
pb
Package rules provides a number of GTFS validation rules and examples.
Package rules provides a number of GTFS validation rules and examples.
schema
This package is for compound entities, e.g.
This package is for compound entities, e.g.
This directory contains tests that need to be in separate packages to avoid import cycles
This directory contains tests that need to be in separate packages to avoid import cycles
Package tlcli provides helper utilities for command line programs.
Package tlcli provides helper utilities for command line programs.
Package tlcsv provides adapters to read and write GTFS from CSV format files.
Package tlcsv provides adapters to read and write GTFS from CSV format files.
Package tldb provides adapters to read and write GTFS data from PostgreSQL and SQLite databases.
Package tldb provides adapters to read and write GTFS data from PostgreSQL and SQLite databases.
Package tlxy provides simple XY geometry helper functions; these are approximate and designed for our specific use cases.
Package tlxy provides simple XY geometry helper functions; these are approximate and designed for our specific use cases.
Package validator provides GTFS and GTFS-RT validation utilities.
Package validator provides GTFS and GTFS-RT validation utilities.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL