Project

atco

0.01
Low commit activity in last 3 years
No release in over a year
Simple and opinionated library for parsing ATCO .cif files to JSON with Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 13.0
~> 3.9
 Project Readme

ATCO-CIF

ATCO-CIF is the format of choice for UK public transport authorities. This is a ruby library that reads .cif files and gives you JSON back.

  • ATCO (Association of Transport Coordinating Officers)

  • CIF (Common Interface File)

  • Official spec: http://www.pti.org.uk/CIF/atco-cif-spec.pdf

  • NOTE: official spec is no-longer available from the above URL but can be found on archive.org

  • A copy of the atco-cif-spec.pdf is included in the docs folder in this repo

USAGE

Currently this library is under-development and has several things left to do before it is perfect (see the TODO.md list ).

  • clone this library git clone git@github.com:davidjrice/atco.git
  • or install the gem gem install atco
  • start an irb session (with the helper console command) bin/console

Code example, for more detailed internal api usage see the spec files.

require "rubygems"
require "atco"

result = Atco.parse("filename.cif")
result = Atco.parse("data/SVRTMAO009A-20091005.cif")

=> {
  header: {}, # Atco::Header
  locations: [], # Atco::Location
  journeys: {
    "journey_identifier": {} # Atco::Journey
  },
  unparsed: [
    {line: "unparsed line", line_number:1234}
  ]
}

Author & Contributors

The ATCO-CIF Ruby library was originally authored by David Rice @davidjrice in response to an FOI request to Translink for there timetable data as part of an OpenDataNI initiative.

See CONTRIBUTORS.md