{"id":13412804,"url":"https://github.com/artonge/go-gtfs","last_synced_at":"2025-04-24T03:46:23.061Z","repository":{"id":57496829,"uuid":"96674195","full_name":"artonge/go-gtfs","owner":"artonge","description":"Load GTFS files in golang","archived":false,"fork":false,"pushed_at":"2023-08-16T07:58:40.000Z","size":414,"stargazers_count":47,"open_issues_count":0,"forks_count":23,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T03:46:12.663Z","etag":null,"topics":["go","gtfs","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artonge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"liberapay":"artonge"}},"created_at":"2017-07-09T09:30:31.000Z","updated_at":"2025-02-25T13:02:19.000Z","dependencies_parsed_at":"2024-01-08T15:02:40.376Z","dependency_job_id":"49fcbc23-772f-4ae8-b386-11a74179c5d0","html_url":"https://github.com/artonge/go-gtfs","commit_stats":{"total_commits":34,"total_committers":12,"mean_commits":"2.8333333333333335","dds":0.7352941176470589,"last_synced_commit":"a563c4c048265e100f01beaccedde89870c09184"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artonge%2Fgo-gtfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artonge%2Fgo-gtfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artonge%2Fgo-gtfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artonge%2Fgo-gtfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artonge","download_url":"https://codeload.github.com/artonge/go-gtfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250560000,"owners_count":21450168,"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":["go","gtfs","hacktoberfest"],"created_at":"2024-07-30T20:01:29.419Z","updated_at":"2025-04-24T03:46:23.046Z","avatar_url":"https://github.com/artonge.png","language":"Go","funding_links":["https://liberapay.com/artonge"],"categories":["文件处理","File Handling","Files","\u003cspan id=\"文件-files\"\u003e文件 Files\u003c/span\u003e","文件处理`处理文件和文件系统操作的库`","文件","Relational Databases"],"sub_categories":["检索及分析资料库","Search and Analytic Databases","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","SQL 查询语句构建库","Advanced Console UIs"],"readme":"# go-gtfs\nLoad GTFS files in Go.\n\n[![godoc for artonge/go-gtfs](https://godoc.org/github.com/artonge/go-gtfs?status.svg)](http://godoc.org/github.com/artonge/go-gtfs)\n\n![Go](https://github.com/artonge/go-gtfs/workflows/Go/badge.svg)\n[![goreportcard for artonge/go-gtfs](https://goreportcard.com/badge/github.com/artonge/go-gtfs)](https://goreportcard.com/report/artonge/go-gtfs)\n\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n**The project is in maintenance mode.**\n\nIt is kept compatible with changes in the Go ecosystem but no new features will be developed. PR could be accepted.\n# Install\n`go get github.com/artonge/go-gtfs`\n\n# Examples\n## Load one directory containing GTFS files:\n```bash\npath/to/gtfs_files\n├── agency.txt\n├── attributions.txt\n├── calendar_dates.txt\n├── calendar.txt\n├── fare_attributes.txt\n├── fare_rules.txt\n├── feed_info.txt\n├── frequencies.txt\n├── levels.txt\n├── pathways.txt\n├── routes.txt\n├── shapes.txt\n├── stops.txt\n├── stop_times.txt\n├── transfers.txt\n└── trips.txt\n```\n```go\ng, err := gtfs.Load(\"path/to/gtfs_files\", nil)\n```\n\n## Load a directory containing sub directories containing GTFS files:\n```bash\npath/to/gtfs_directories\n├── gtfs1\n│   ├── agency.txt\n│   ├── attributions.txt\n│   ├── calendar_dates.txt\n│   ├── calendar.txt\n│   ├── fare_attributes.txt\n│   ├── fare_rules.txt\n│   ├── feed_info.txt\n│   ├── frequencies.txt\n│   ├── levels.txt\n│   ├── pathways.txt\n│   ├── routes.txt\n│   ├── shapes.txt\n│   ├── stops.txt\n│   ├── stop_times.txt\n│   ├── transfers.txt\n│   └── trips.txt\n└── gtfs2\n    ├── agency.txt\n    ├── attributions.txt\n    ├── calendar_dates.txt\n    ├── calendar.txt\n    ├── fare_attributes.txt\n    ├── fare_rules.txt\n    ├── feed_info.txt\n    ├── frequencies.txt\n    ├── levels.txt\n    ├── pathways.txt\n    ├── routes.txt\n    ├── shapes.txt\n    ├── stops.txt\n    ├── stop_times.txt\n    ├── transfers.txt\n    └── trips.txt\n\n```\n```go\ngs, err := gtfs.LoadSplitted(\"path/to/gtfs_directories\", nil)\n```\n\nYou can then access the data through the GTFS structure.\nThat structure contains arrays of approriate structures for each files.\n```go\ntype GTFS struct {\n\tPath           string // The path to the containing directory\n\tAgency         Agency\n\tAgencies       []Agency\n\tAttributions   []Attribution\n\tCalendars      []Calendar\n\tCalendarDates  []CalendarDate\n\tFareAttributes []FareAttribute\n\tFareRules      []FareRule\n\tFeedInfos      []FeedInfo\n\tFrequencies    []Frequency\n\tLevels         []Level\n\tRoutes         []Route\n\tPathways       []Pathway\n\tShapes         []Shape\n\tStops          []Stop\n\tStopsTimes     []StopTime\n\tTrips          []Trip\n\tTransfers      []Transfer\n}\n\ntype Route struct {\n\tID        string `csv:\"route_id\"`\n\tAgencyID  string `csv:\"agency_id\"`\n\tShortName string `csv:\"route_short_name\"`\n\tLongName  string `csv:\"route_long_name\"`\n\tType      int    `csv:\"route_type\"`\n\tDesc      string `csv:\"route_desc\"`\n\tURL       string `csv:\"route_url\"`\n\tColor     string `csv:\"route_color\"`\n\tTextColor string `csv:\"route_text_color\"`\n}\n\n...\n```\n\n# Contributions\nPull requests are welcome ! :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartonge%2Fgo-gtfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartonge%2Fgo-gtfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartonge%2Fgo-gtfs/lists"}