All Projects → iRail → Irail

iRail / Irail

Licence: other
iRail API / scraper

Labels

Projects that are alternatives of or similar to Irail

Toronto.university
Independent platform for higher education in Toronto. Made in University of Toronto.
Stars: ✭ 30 (-67.03%)
Mutual labels:  opendata
Opendataday
Open Data Day website
Stars: ✭ 70 (-23.08%)
Mutual labels:  opendata
Openml R
R package to interface with OpenML
Stars: ✭ 81 (-10.99%)
Mutual labels:  opendata
Qri
you're invited to a data party!
Stars: ✭ 1,003 (+1002.2%)
Mutual labels:  opendata
Freeyourstuff.cc
freeyourstuff.cc - universal content liberation
Stars: ✭ 60 (-34.07%)
Mutual labels:  opendata
Aus Search
A collection of Node JS scripts to create an Elasticsearch index of Australian addresses.
Stars: ✭ 76 (-16.48%)
Mutual labels:  opendata
Opendata
A project to collect, collate and share an open data set with contributions from users of the GoldenCheetah application
Stars: ✭ 21 (-76.92%)
Mutual labels:  opendata
Opendefinition
Open Definition source
Stars: ✭ 87 (-4.4%)
Mutual labels:  opendata
Korona Info
Suomen koronavirus-tartuntatilanne
Stars: ✭ 70 (-23.08%)
Mutual labels:  opendata
Json Stat
JSON-stat Toolkit version 0
Stars: ✭ 79 (-13.19%)
Mutual labels:  opendata
Tra Info
快速地查詢臺鐵時刻表,沒有廢話。
Stars: ✭ 53 (-41.76%)
Mutual labels:  opendata
Nepalmap app
An application that maps census and other official data for Nepal to make data more easily accessible and understandable to the public. Want to help us? Check out the Wiki.
Stars: ✭ 60 (-34.07%)
Mutual labels:  opendata
Dataiku Contrib
Public repository for DSS plugins
Stars: ✭ 76 (-16.48%)
Mutual labels:  opendata
Seek
For finding, sharing and exchanging Data, Models, Simulations and Processes in Science.
Stars: ✭ 38 (-58.24%)
Mutual labels:  opendata
Coronabr
Série histórica dos dados sobre COVID-19, a partir de informações do Ministério da Saúde
Stars: ✭ 83 (-8.79%)
Mutual labels:  opendata
Digitraffic
Content development for Traffic Management Finland's Digitraffic web pages.
Stars: ✭ 21 (-76.92%)
Mutual labels:  opendata
Frrrenchies
Liste de ressources R utiles pour les Français
Stars: ✭ 76 (-16.48%)
Mutual labels:  opendata
Lib.reviews
A free/libre code and information platform for reviews of anything
Stars: ✭ 90 (-1.1%)
Mutual labels:  opendata
Eleicoes Brasil
Scripts para capturar dados do Repositório de Dados Eleitorais do TSE, limpá-los, normalizá-los e agrupá-los
Stars: ✭ 85 (-6.59%)
Mutual labels:  opendata
Covid19italia
Condividiamo informazioni e segnalazioni sul COVID19
Stars: ✭ 78 (-14.29%)
Mutual labels:  opendata

iRail

License AGPL-3.0 Join the chat at https://gitter.im/iRail/iRail

iRail supports digital creativity concerning mobility in Belgium. This is an attempt to make the railway time schedules in Belgium easily available for anyone.

Our main site consists of a very easy mobile website to look up time schedules using our own API.

Native applications using the iRail API and created or supported by the iRail team are named BeTrains and RailerApp.

All information can be found on our blog at hello.iRail.be.

API Documentation

API Documentation can be found at https://docs.irail.be.

Installation for development purposes

note: you'll also need to have nodejs, composer and PHP curl extension installed on your system

  • Step 1: Clone this repo
  • Step 2: If you don't need the occupancy functionality, you can remove the mongodb/mongodb requirement from the composer file. You can now run composer install. If you'd like to have support for the occupancy scores, read below on how to setup mongo before proceeding to run composer install.
  • Step 3: Make sure storage is writable: chmod 777 storage
  • Step 4: Run your test server: php -S localhost:8008 -t api
  • Step 5: Enjoy your own iRail API at http://localhost:8008/connections.php?from=Gent%20Sint%20Pieters&to=Antwerp

MongoDB / Spitsgids setup

Optional: if you want to set up the iRail API with occupancy scores you will need to set up a MongoDB database:

  • Install MongoDB
  • Install the MongoDB module for PHP: pecl install mongodb Make sure PHP loads the module: the conf.d folder for your PHP installation should contain a file with contents extension=mongodb.so in order to load the module. Both the CLI and web version need this, as Composer will run from the CLI
  • Add MongoDB environment variables: cp .env.example .env (If your MongoDB URL is different or you want another database name you can change this file)
  • Import the data (the structural.csv file) in MongoDB: mongoimport -d irail -c structural --type csv --file occupancy/data/structural.csv --headerline
  • Run the startscript to push structural data to the occupancy table: php occupancy/scripts/startscript.php
  • Once the startscript has ran, the task of pushing structural data to the occupancy table should be automated: crontab -e => 30 3 * * * php $PATH_TO_IRAIL_FOLDER/occupancy/scripts/cronjob.php
  • Enjoy the occupancy scores in all the GET requests. Read the docs on how to post occupancy data.

Important: If you plan on using spitsgids in a production environment, don't forget to add indices. Most queries check either the connection (routes, liveboards endpoints) or vehicle field (vehicle endpoint). Example indices can be found below.

  • For queries on vehicles: db.occupancy.createIndex({vehicle: 1}) or db.occupancy.createIndex({date: -1, vehicle: 1})
  • For queries on connections: db.occupancy.createIndex({connection: 1})

Improving performance

Optional: you can improve performance by using APCu. APCu in-memory caching will automaticly be used when the APCu extension is available. When installed, every request to the NMBS will be cached for 15 seconds.

Install with docker

  1. Clone this repo
  2. Run docker-compose build on the project root
  3. After building the container, start them using docker-compose up -d
  4. Run docker-compose exec php composer install to install project dependency
  5. Enjoy your own iRail API at http://localhost:8008/connections.php?from=Gent%20Sint%20Pieters&to=Antwerp

Optional: if you want to set up the iRail API with occupancy scores you will need to import data to MongoDB:

  1. First run cp .env.example .env
  2. Replace MONGODB_URL="mongodb://localhost:27017" with MONGODB_URL="mongodb://mongo:27017"
  3. Run this to to push structural data to the occupancy table : docker-compose exec php php cupancy/scripts/startscript.php
  4. Run this to import the data (the structural.csv file) in MongoDB docker-compose exec mongo mongoimport -d irail -c structural --type csv --file /data/structural.csv --headerline
  5. Once the startscript has ran, the task of pushing structural data to the occupancy table should be automated. In order to do this, edit the docker/php/crontab file and uncomment the following line: 30 3 * * * root /usr/local/bin/php /var/www/html/occupancy/scripts/cronjob.php >> /var/log/cron.log 2>&1

Update stations list

Stations are updated through the irail/stations composer package. Just perform a composer update in the root of the project.

More links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].