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.0

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.0
File Size Uploaded
pyrailworks-0.1.0.tar.gz 11.3 kB Details

Built distribution (wheel)

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

Total release size: 19.6 kB

Release files / pyrailworks-0.1.0.tar.gz

Download URL pyrailworks-0.1.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2c279394bd1edb60a082c337edf523b87f9f70f41b8c02ba7f192a3f4e37cad0
BLAKE2b-256 checksum
How to use checksums
cd6aedeb2a1cefff34ce8ddb154e8704e1d4290187113372bfd0a4f364f29133
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.0-py3-none-any.whl

Download URL pyrailworks-0.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8af2e054f6d3d566473a345527255e4fce0a0d1c1ba77fc76a39d9c949a32e06
BLAKE2b-256 checksum
How to use checksums
7eb7fd6d0a4f9efeb50f673bdc89280d680a85eac7e4fe20ab1488217c9bf149
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

0.1.1

2 release files

This release

0.1.0 This release

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