Skip to content

samb1232/metro_ekb_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Metro Schedule Parser for Yekaterinburg Metro

Overview

This Python script scrapes and parses train schedules for all stations of the Yekaterinburg Metro system from the official website (https://metro-ektb.ru). It extracts timetable information for both weekdays and weekends, in both directions (toward "Botanicheskaya" and "Prospekt Kosmonavtov" stations).

Features

  • Scrapes schedule data for all metro stations
  • Outputs clean, structured JSON data
  • Formats times as "HH:MM" strings

Requirements

  • Python 3.6+
  • Required packages:
    • requests
    • beautifulsoup4
    • lxml (or another HTML parser for BeautifulSoup)

Install dependencies with:

pip install -r requirements.txt

Usage

  1. Run the script:
python parser.py

Output Format

The script generates a JSON file with the following structure:

{
  "stations": {
    "1": {
      "name": "Название первой станции",
      "schedule": {
        "weekday": {
          "to_last": ["08:00", "08:15", "08:30"]
        },
        "weekend": {
          "to_last": ["08:05", "08:20", "08:35"]
        }
      }
    },
    "2": {
      "name": "Название второй станции",
      "schedule": {
        "weekday": {
          "to_first": ["08:10", "08:25", "08:40"],
          "to_last": ["08:12", "08:27", "08:42"]
        },
        "weekend": {
          "to_first": ["08:15", "08:30", "08:45"],
          "to_last": ["08:17", "08:32", "08:47"]
        }
      }
    },
    // ... станции 3-8 ...
    "9": {
      "name": "Название последней станции",
      "schedule": {
        "weekday": {
          "to_first": ["08:20", "08:35", "08:50"]
        },
        "weekend": {
          "to_first": ["08:25", "08:40", "08:55"]
        }
      }
    }
  },
  "station_order": [1, 2, 3, 4, 5, 6, 7, 8, 9]
}

License

This project is open-source and available for free use.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages