Skip to main content

pyrailworks

Python client library for the Public RO Railworks API (https://railworks.paddez.com/docs).

Provides queryable access to Iarnród Éireann's (Irish Rail) planned engineering works, station days, change logs, and iCalendar feeds.

Installation

pip install pyrailworks

Quick Start

Synchronous Client

from pyrailworks import RailworksClient, LineName

with RailworksClient() as client:
    # 1. Health check
    health = client.get_health()
    print("Upstream checked at:", health.source.checked_at)

    # 2. List stations
    stations = client.list_stations()
    print(f"Total stations: {len(stations)}")

    # 3. Check affected days for a station
    days_resp = client.get_station_days("WBROK")
    for day in days_resp.days:
        print(f"Station {days_resp.station.name} affected on {day.date}: {day.effect.value}")

    # 4. List active notices on a line
    notices = client.list_notices(line=LineName.DART, status="active")
    for notice in notices.notices:
        print(f"Notice {notice.id}: {notice.heading} ({notice.starts_on} to {notice.ends_on})")

    # 5. Follow changes with automatic cursor traversal
    for event in client.iter_changes():
        print(f"Change event: {event.type.value} on notice {event.notice_id}")

Asynchronous Client

import asyncio
from pyrailworks import AsyncRailworksClient

async def main():
    async with AsyncRailworksClient() as client:
        health = await client.get_health()
        print("Backend stale:", health.source.stale)

        async for event in client.iter_changes():
            print("Notice changed:", event.notice_id)

asyncio.run(main())

Features

  • Both Sync & Async: RailworksClient and AsyncRailworksClient powered by httpx.
  • Strict Data Validation: Pydantic v2 data models for type safety, validation, and auto-completion.
  • Problem Details Handling: Full support for RFC 9457 errors with specific exceptions (BadRequestError, NotFoundError, StationsLoadingError).
  • Change Log Streaming: Helper generators (iter_changes()) handling opaque cursor pagination.
  • Calendar Feeds: Raw iCalendar text download via get_calendar_feed().

Metadata

Release files for pyrailworks 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrailworks 0.1.1
File Size Uploaded
pyrailworks-0.1.1.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyrailworks 0.1.1
File Interpreter ABI Platform
pyrailworks-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / pyrailworks-0.1.1.tar.gz

Download URL pyrailworks-0.1.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
00e630c287115794ea4a2babf5b020a438af1fa703b889588812371b989ea68d
BLAKE2b-256 checksum
How to use checksums
844913af3ecfc0dc6e61d4e6a07ea773d8c858584adaa06bfb6a00b14100d3d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / pyrailworks-0.1.1-py3-none-any.whl

Download URL pyrailworks-0.1.1-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf92cc6fac0e21f8c7590c9b0aaf55e3e164ab1ab16bbd90e044de03b3367512
BLAKE2b-256 checksum
How to use checksums
74945fdc5bcc1a532a27775fc089a50b2b03c1afbcea4807e2177aa0b7849eb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page