{"id":13573091,"url":"https://github.com/interline-io/transitland-lib","last_synced_at":"2026-04-02T11:10:11.609Z","repository":{"id":38313664,"uuid":"188310320","full_name":"interline-io/transitland-lib","owner":"interline-io","description":"Library and tool for reading, writing, and processing transit data","archived":false,"fork":false,"pushed_at":"2025-03-21T22:24:55.000Z","size":133391,"stargazers_count":39,"open_issues_count":11,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T23:42:39.275Z","etag":null,"topics":["golang-library","gtfs","gtfs-realtime","mobility","transit","transitland","transportation"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/interline-io/transitland-lib/tl","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interline-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-23T21:39:40.000Z","updated_at":"2025-03-21T08:22:58.000Z","dependencies_parsed_at":"2024-07-19T09:22:11.156Z","dependency_job_id":"d7612a40-0802-446b-971f-952c2aa6c6d5","html_url":"https://github.com/interline-io/transitland-lib","commit_stats":{"total_commits":529,"total_committers":3,"mean_commits":"176.33333333333334","dds":"0.11531190926275992","last_synced_commit":"081a7768949d7b1f469df3976eabb01b2217ab77"},"previous_names":["interline-io/gotransit"],"tags_count":74,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interline-io%2Ftransitland-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interline-io%2Ftransitland-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interline-io%2Ftransitland-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interline-io%2Ftransitland-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interline-io","download_url":"https://codeload.github.com/interline-io/transitland-lib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247170308,"owners_count":20895451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang-library","gtfs","gtfs-realtime","mobility","transit","transitland","transportation"],"created_at":"2024-08-01T15:00:29.291Z","updated_at":"2026-04-02T11:10:11.603Z","avatar_url":"https://github.com/interline-io.png","language":"Go","funding_links":[],"categories":["Uncategorized","Sharing Data"],"sub_categories":["Uncategorized","Software for Creating APIs"],"readme":"# Interline Transitland \u003c!-- omit in toc --\u003e\n\n`transitland-lib` is a library and command-line tool for reading, writing, and processing transit data in [GTFS](http://gtfs.org) 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](https://github.com/transitland/distributed-mobility-feed-registry) format to describe feed resources.\n\n![Test \u0026 Release](https://github.com/interline-io/transitland-lib/workflows/Test%20\u0026%20Release/badge.svg) [![GoDoc](https://godoc.org/github.com/interline-io/transitland-lib/tl?status.svg)](https://godoc.org/github.com/interline-io/transitland-lib/tl) ![Go Report Card](https://goreportcard.com/badge/github.com/interline-io/transitland-lib)\n\n## Table of Contents \u003c!-- omit in toc --\u003e\n\u003c!-- to update use https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one --\u003e\n- [Installation](#installation)\n  - [Download prebuilt binary](#download-prebuilt-binary)\n  - [Install using homebrew](#install-using-homebrew)\n  - [Install binary from source](#install-binary-from-source)\n- [Usage as a CLI tool](#usage-as-a-cli-tool)\n  - [Breaking changes](#breaking-changes)\n- [Usage as a library](#usage-as-a-library)\n- [Usage as a web service](#usage-as-a-web-service)\n- [Database migrations](#database-migrations)\n- [Included Readers and Writers](#included-readers-and-writers)\n- [Development](#development)\n  - [Releases](#releases)\n- [Licenses](#licenses)\n\n## Installation\n\n### Download prebuilt binary\n\nThe `transitland` binaries for Linux and macOS are attached to each [release](https://github.com/interline-io/transitland-lib/releases).\n\n### Install using homebrew\n\nThe `transitland` binary can be installed using homebrew. The executable is code-signed and notarized.\n\n```bash\nbrew install interline-io/transitland-lib/transitland-lib\n```\n\n### Install binary from source\n\n```bash\ngo get github.com/interline-io/transitland-lib/cmd/transitland\n```\n\nThis package uses Go Modules and will also install required dependencies.\n\nMain dependencies:\n- `twpayne/go-geom`\n- `jmoiron/sqlx`\n- `Masterminds/squirrel`\n- `jackc/pgx`\n- `mattn/go-sqlite3` (requires CGO)\n\n## Usage as a CLI tool\n\nThe main subcommands are:\n* [transitland copy](doc/cli/transitland_copy.md)\t - Copy performs a basic copy from a reader to a writer.\n* [transitland diff](doc/cli/transitland_diff.md)\t - Calculate difference between two feeds, writing output in a GTFS-like format\n* [transitland dmfr-format](doc/cli/transitland_dmfr-format.md)\t - Lint DMFR files\n* [transitland dmfr-lint](doc/cli/transitland_dmfr-lint.md)\t - Format a DMFR file\n* [transitland extract](doc/cli/transitland_extract.md)\t - Extract a subset of a GTFS feed\n* [transitland fetch](doc/cli/transitland_fetch.md)\t - Fetch GTFS data and create feed versions\n* [transitland import](doc/cli/transitland_import.md)\t - Import feed versions\n* [transitland merge](doc/cli/transitland_merge.md)\t - Merge multiple GTFS feeds\n* [transitland sync](doc/cli/transitland_sync.md)\t - Sync DMFR files to database\n* [transitland unimport](doc/cli/transitland_unimport.md)\t - Unimport feed versions\n* [transitland validate](doc/cli/transitland_validate.md)\t - Validate a GTFS feed\n* [transitland rt-convert](doc/cli/transitland_rt-convert.md)\t - Convert GTFS-RealTime to JSON\n* [transitland server](doc/cli/transitland_server.md)\t - Run transitland server\n\nSee the [full list of subcommands](doc/cli/transitland.md)\n\n### Breaking changes\n\nNote: 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`).\n\n## Usage as a library\n\nSee [library examples](doc/library-example.md).\n\n## Usage as a web service\n\nTo start the server with the REST API endpoints, GraphQL API endpoint, GraphQL explorer UI, and image generation endpoints:\n\n```\ntransitland server --dburl \"postgres://your_host/your_database\"\n```\n\nAlternatively, the database connection string can be specified using `TL_DATABASE_URL` environment variable. For local development environments, you will usually need to add `?sslmode=disable` to the connection string.\n\nOpen http://localhost:8080/ in your web browser to see the GraphQL browser, or use the endpoints at `/query` or `/rest/...`\n\nThe REST API is documented with OpenAPI 3.0:\n- **Interactive documentation**: http://localhost:8080/rest/openapi.json\n- **Static schema**: [docs/openapi/rest.json](docs/openapi/rest.json)\n\nThe \"example\" server instance configured by the  `transitland server` command runs without authentication or authorization. Auth configuration is beyond the scope of this example command but can be added by configuring the server in your own package and adding HTTP middlewares to set user context and permissions data. You can use `cmd/tlserver/main.go` as an example to get started; it uses only public APIs from this package. (Earlier versions of `transitland server` included more built-in auth middlewares, but in our experience these are almost always custom per-installation, and were removed from this repo.) Additionally, this example server configuration exposes Go profiler endpoints on `/debug/pprof/...`. \n\n## Database migrations\n\nMigrations are supported for PostgreSQL, using the schema files in `internal/schema/postgres/migrations`. These files can be read and applied using [golang-migrate](https://github.com/golang-migrate/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.\n\nSQLite 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`.\n\n## Included Readers and Writers\n\n| Target                   | Module  | Supports Read | Supports Write |\n| ------------------------ | ------- | ------------- | -------------- |\n| CSV                      | `tlcsv` | ✅             | ✅              |\n| SQLite                   | `tldb`  | ✅             | ✅              |\n| PostgreSQL (with PostGIS)  | `tldb`  | ✅             | ✅              |\n\nWe welcome the addition of more readers and writers.\n\n## Development\n\n`transitland-lib` follows Go coding conventions.\n\nGitHub Actions runs all tests, stores code coverage reports as artifacts, and prepares releases.\n\nFor running tests locally, the following instructions should help get started:\n\n1. Set `TL_TEST_SERVER_DATABASE_URL` to the connection string to a test database\n   - e.g. `postgresql://localhost:5432/tlv2_test_server?sslmode=disable`\n   - You must also set `PGHOST=localhost`, `PGDATABASE=tlv2_test_server`, etc., to match this url\n2. Initialize test fixtures: `./testdata/test_setup.sh`\n   - This will create the `tlv2_test_server` database in postgres\n   - Will halt with an error (intentionally) if this database already exists\n   - Runs migrations in `transitland-lib/schema/postgres/migrations`\n   - Unpacks and imports the Natural Earth datasets bundled with `transitland-lib`\n   - Builds and installs the `cmd/tlserver` command\n   - Sets up test feeds contained in `testdata/server/server-test.dmfr.json`\n   - Fetches and imports feeds contained in `testdata/server/gtfs`\n   - Creates additional fixtures defined in `testdata/server/test_supplement.pgsql`\n   - Note that temporary files will be created in `testdata/server/tmp`; these are excluded in `.gitignore`\n3. Optional: Set `TL_TEST_REDIS_URL` to run some GBFS tests\n4. Optional: Set `TL_TEST_FGA_ENDPOINT` to a running [OpenFGA](https://github.com/openfga/openfga) server to run authorization tests\n5. Run all tests with `go test -v ./...`\n\nTest cases generally run within transactions; you do not need to regenerate the fixtures unless you are testing migrations or changes to data import functionality.\n\n### Releases\n\nReleases follow [Semantic Versioning](https://semver.org/) conventions.\n\nTo cut a new release:\n\n1. Run `go generate ./...` to update auto-generated documentation.\n2. Create a GitHub release. This will create a tag and GitHub Actions will create \u0026amp; attach code-signed binaries.\n3. Download the files from the release, and update the [homebrew formula](https://github.com/interline-io/homebrew-transitland-lib/blob/master/transitland-lib.rb) with the updated sha256 hashes and version tag.\n\n## Licenses\n\n`transitland-lib` is released under a \"dual license\" model:\n\n- open-source for use by all under the [GPLv3](LICENSE) license\n- also available under a flexible commercial license from [Interline](mailto:info@interline.io)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterline-io%2Ftransitland-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterline-io%2Ftransitland-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterline-io%2Ftransitland-lib/lists"}