Coder Social home page Coder Social logo

pasvistelik / minsktrans-parser Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 49 KB

Минсктранс - Парсер остановок, маршрутов и расписания.

Home Page: https://www.npmjs.com/package/minsktrans-parser

License: MIT License

JavaScript 100.00%
minsk minsktrans parser transport timetable belarus minsktrans-parser npm npm-package

minsktrans-parser's Introduction

minsktrans-parser

Loads and parses lists of stations, routes, timetables and ways-polylines of the Minsk public transport (Minsktrans company: bus, trolleybus, tram and metro).

Usage example:

npm i minsktrans-parser
import DataProvider from 'minsktrans-parser';

const stations = await DataProvider.getStations();
const routes = await DataProvider.getRoutes();
const times = await DataProvider.getTimes();
const routesPolylines = await DataProvider.getRoutesPolylines();

You also can run npm run save_json to save this objects as *.json files.

Results examples

Stations object

[
  {
    local_id: 14340,
    name: "Филимонова",
    lat: 53.92889,
    lng: 27.63977
  },
  ...
]

Routes object

[
  {
    route_type: "bus",
    route_number: "1",
    route_name: "ДС Веснянка - Вокзал",
    ways: [
      {
        local_id: 214500,
        way_name: "ДС Веснянка - Вокзал",
        stations_ids_list: [15846, 54756, 54757, ...]
      },
      ...
    ]
  },
  ...
]

Times object

[
  {
    way_id: 214500,
    trips_by_days: [
      {
        days_of_week: [0,6],
        arrives: [
          [340, 355, 370, 385, 400, 412, ...], // times (in minutes) of arrives to first station of way
          [342, 357, 372, 387, 402, 414, ...], // to second station of way, ...
          ...
        ]
      },
      ...
    ]
  },
  ...
]

Ways polylines object

[
  {
    local_id: 52524,
    polyline:
    [
      { lat: 53.90686, lng: 27.43751 },
      { lat: 53.90632, lng: 27.44737 },
      ...
    ]
  },
  ...
]

minsktrans-parser's People

Contributors

pasvistelik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.