Skip to main content

Israeli Rail unofficial API

Project description

Israel Rail API

image image Build status

This is a unofficial wrapping of the API of Israeli Rail network in Python.

Use this script for checking your own train schedule, integrating with Alexa, and so on!

Installing

Tested with Python 3.8-3.14.

pip install israel-rail-api

Usage

import israelrailapi

schedule = israelrailapi.TrainSchedule()
routes = schedule.query('Tel Aviv University', 'Jerusalem Yitzhak Navon')

for route in routes:
    print(route)

Each returned route contains one or more train segments in route.trains. Every segment is a TrainRoutePart with:

  • src / dst: source and destination station ids
  • departure / arrival: scheduled departure and arrival timestamps
  • platform / dst_platform: origin and destination platforms
  • departure_delay: departure delay in minutes for the segment origin station

Example:

import israelrailapi

schedule = israelrailapi.TrainSchedule()
routes = schedule.query('Tel Aviv HaHagana', 'Ben Gurion Airport', '2026-04-24', '09:00')

for route in routes:
    for train in route.trains:
        print(
            train.departure,
            train.arrival,
            f"delay={train.departure_delay}m",
        )

CLI example:

python3 israelrailapi/schedule.py "tel aviv hahagana" "ben gurion airport" 2026-04-24 0900

Contributing

We'd love your contributions! Fire up a (tested!) Pull request, and we'll be happy to approve it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

israel_rail_api-0.1.5.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

israel_rail_api-0.1.5-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file israel_rail_api-0.1.5.tar.gz.

File metadata

  • Download URL: israel_rail_api-0.1.5.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for israel_rail_api-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c66a94e66a8b7781451f23e36e933516a3305ffc0dbdf88f3ae81d8f776415eb
MD5 fbc21e8f86e262107ce398654857a2d7
BLAKE2b-256 5e7fb392be011f50b197150bdcefc98698c81a5ed2dc454d5c24d41f1790b8f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for israel_rail_api-0.1.5.tar.gz:

Publisher: release.yml on sh0oki/israel-rail-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file israel_rail_api-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: israel_rail_api-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for israel_rail_api-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f06f6b7392dff55c7ac31a03fdf672ecdd7e2e367d3bcf53f71ac1e2febfa18a
MD5 680c0707abcf764f180f2782d806d121
BLAKE2b-256 088f2637c1fad27192a813adc78600cc91e1a2357e82ee5b3e8c8e98652c4b19

See more details on using hashes here.

Provenance

The following attestation bundles were made for israel_rail_api-0.1.5-py3-none-any.whl:

Publisher: release.yml on sh0oki/israel-rail-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page