Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hiposfer/gtfs.edn
the General Transit Feed Specification (GTFS) as pure edn data
https://github.com/hiposfer/gtfs.edn
edn-data gtfs
Last synced: about 1 month ago
JSON representation
the General Transit Feed Specification (GTFS) as pure edn data
- Host: GitHub
- URL: https://github.com/hiposfer/gtfs.edn
- Owner: hiposfer
- License: lgpl-3.0
- Created: 2018-09-07T10:13:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-08T20:20:56.000Z (about 6 years ago)
- Last Synced: 2024-07-06T16:07:23.016Z (6 months ago)
- Topics: edn-data, gtfs
- Language: Clojure
- Size: 30.3 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gtfs.edn
[![Build Status](https://travis-ci.com/hiposfer/gtfs.edn.svg?branch=master)](https://travis-ci.com/hiposfer/gtfs.edn)
[![Clojars Project](https://img.shields.io/clojars/v/hiposfer/gtfs.edn.svg)](https://clojars.org/hiposfer/gtfs.edn)The General Transit Feed Specification (GTFS) as pure edn data
Original data taken from https://github.com/google/transit
This is a convenience tool for those who would like to work with GTFS data but
dont want to manually recreate it.# Usage
This project can be used in two ways:
- as a Clojure(script) library
This is very useful if you want to work with this data in your code. There are several
convenience functions exposed through the `hiposfer.gtfs.edn` namespace.```clojure
(ns my.namespace
(:require [hiposfer.gtfs.edn :as gtfs]));; fetch the reference gtfs spec first
;; ONLY for clojure -> in clojurescript you would need to use the git submodule
;; approach. See below
(def gtfs-spec (gtfs/spec));; fetch all gtfs fields that are required
(filter :required (gtfs/fields gtfs-spec));; fetch all gtfs fields that represent a dataset unique attribute
(filter :unique (gtfs/fields gtfs-spec));; fetch all gtfs fields for the "agency.txt" feed
(filter #(= "agency.txt" (:filename %)) (gtfs/fields gtfs-spec))
```- as a git submodule
If you are only interested in the data itself, and would like to use it without Clojure, you
can add it as a git submodule. You can use one of the many [EDN reader implementations](https://github.com/edn-format/edn/wiki/Implementations)
to parse the gtfs data to your convenience.```bash
$ git submodule add https://github.com/hiposfer/gtfs.edn.git## you will find the gtfs reference spec inside the resources dir
$ my-custom-script parse gtfs.edn/resources/reference.edn
```---
Distributed under LGPL v3