Coder Social home page Coder Social logo

piemadd / amtrak-data Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 3.37 MB

Extracts of Amtrak reporting data from their monthly reports for easier use in data analytics. Avaiable in JSON, CSV, and XML from August of 2021 until present (?).

JavaScript 100.00%
amtrak csv data json xml

amtrak-data's Introduction

Amtrak Data

This repository contains the data extracted from Amtrak's monthly reports in various formats. The repository is structured like so:

root
├───data
│   ├───csv
│   │   └───{year}
│   │       └───{month}
│   │           ├───operatingResults.csv
│   │           ├───capitalResults.csv
│   │           ├───keyPerformanceIndicators.csv
│   │           ├───sourcesAndUsesAccount.csv
│   │           └───routeLevelResults.csv
│   ├───json
│   │   └───{year}
│   │       └───{month}
│   │           ├───operatingResults.json
│   │           ├───capitalResults.json
│   │           ├───keyPerformanceIndicators.json
│   │           ├───sourcesAndUsesAccount.json
│   │           └───routeLevelResults.json
│   └───xml
│       └───{year}
│           └───{month}
│               ├───operatingResults.xml
│               ├───capitalResults.xml
│               ├───keyPerformanceIndicators.xml
│               ├───sourcesAndUsesAccount.xml
│               └───routeLevelResults.xml
├───reports
│   └───{year}
│       └───{month}
│           ├───report.pdf
│           └───unprocessed
│               ├───tabula-report-0.csv
│               ├───tabula-report-1.csv
│               ├───tabula-report-2.csv
│               ├───tabula-report-3.csv
│               └───tabula-report-4.csv
├───scripts
│   ├───parseRawToJSON.js
│   └───parseJSONtoOthers.js
└───[various config files, including package.json]

I used Tabula to extract the table data from PDFs. This will take a bit of manual work and also may not be in the right format for my scripts to process. If I haven't updated this data yet and a report has been published, you email me (on my website) and I will knock it out on one of my lunch breaks.

To run the scripts yourself, clone the repo, make sure you have some modern level of node installed (i think node 14+, not sure tho) and run ye old:

npm install

and to run

cd scripts
node parseRawToJSON.js
node parseJSONtoOthers.js

All I am doing currently is extracting the data into other formats to allow for further analasys. I do not plan on doing any further analysis within these scripts.

Just a little key for personal needs when extracting the tables from the pdfs:

  • 0: operatingResults
  • 1: capitalResults
  • 2: keyPerformanceIndicators
  • 3: sourcesAndUsesAccount
  • 4: routeLevelResults

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.