Code Monkey home page Code Monkey logo

transitland-lib's Introduction

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.

Test & Release 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
  • lib/pq
  • 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

transitland-lib's People

Contributors

dependabot[bot] avatar drewda avatar irees avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.