newsdev/odf

Name: odf

Owner: NYT Newsroom Developers

Description: Scripts and tools to help in parsing the Olympic Data Feed from the International Olympic Committee

Created: 2015-03-07 22:47:50.0

Updated: 2018-05-22 22:50:56.0

Pushed: 2018-01-26 15:03:44.0

Homepage: null

Size: 642823

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ODF

Scripts and tools to help in parsing the Olympic Data Feed from the International Olympic Committee.

Competitions

Files that apply differently to different competitions, such as Common Codes, are organized under the competitions directory.

Common Codes / Sport Codes

These codes are delivered via .xlsx file through odf.olympictech.org. Since this file is not easily parsed by applications, the code data has been transformed into csv and json files. They can be found in the following directories:

competitions/[COMPETITION]/codes/[VERSION]/csv|json

For example, the json version of v7.0 of the codes for the Rio Olympics can be found at competitions/OG2016/codes/7.0/json.

These directories contain files that are a direct mapping to the tabs found in the Common Codes and Sport Codes spreadsheets, and named identically but with any ODF, GL, OG or PG prefix stripped for simplicity. For example, the Country codes from the tab called ODF_GL_Country are exported to Country.csv and Country.json. The Sport-specific codes are stored as SportCodes.

All codes are also compiled into a single file, all.json, for bulk consumption.

Updating the codes

the scripts/codes.rb file is provided to generate new codes based on later releases of the .xlsx files. You will need to have Ruby bundler installed, and run bundle install first. Then run the following:

./scripts/codes.rb [PATH TO .xlsx FILE] [COMPETITION] [VERSION]

e.g., ./scripts/codes.rb Rio\ 2016\ OLY\ Sport\ Codes.xlsx OG2016 7.0

You can also specify only the path to the .xlsx if the source filename fits the following pattern: [COMPETITION]_[CC|SC]_[VERSION].xlsx.

Licensing

Unless otherwise noted, data sourced from the odf.olympictech.org website is copyright the International Olympic Committee, under the terms layed out inside the ODF_LICENSE file. All use of such data is subject to the acceptance of those terms and conditions.

All other code is copyright The New York Times Company, and is released with the Apache 2.0 License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.