#service #planning #xml-parser #journey #open

ojp-rs

A library for interacting with Open Journey Planner (OJP) services

7 releases

Uses new Rust 2024

0.2.4 Nov 28, 2025
0.2.3 Nov 28, 2025
0.1.1 Nov 19, 2025

#1115 in Web programming

Download history 13/week @ 2025-11-13 50/week @ 2025-11-20 48/week @ 2025-11-27 19/week @ 2025-12-04 100/week @ 2025-12-11 22/week @ 2025-12-18 12/week @ 2025-12-25 14/week @ 2026-01-01 7/week @ 2026-01-08 14/week @ 2026-01-15 39/week @ 2026-01-22

74 downloads per month
Used in hrdf-routing-engine

Custom license

60KB
1.5K SLoC

Crates.io Documentation Codecov Dependency status

OJP-RS

The ojp-rs crate is a Rust library for interacting with Open Journey Planner (OJP) services, a European standard for distributed, multimodal journey planning (see https://opentransportdata.swiss/en/cookbook/open-journey-planner-ojp/).

Disclaimer

This crate is very early stage and used for testing purposes. It may or may not be extended in the future.

Features

  • Build and send OJP-compliant requests:
    • TripRequest: Plan journeys across multiple modes.
    • LocationInformationRequest: Search for stops and places.
  • Parse XML responses into Rust types.
  • Support for OJP v2.0 schema.
  • Extensible design for additional OJP services (e.g., FareRequest, TripInfoRequest, StopEventRequest).
  • Async support for HTTP requests.

Use Cases

  • Public transport apps
  • Backend services for trip planning
  • Research and analytics on multimodal transport

Installation

Add to your Cargo.toml:

cargo add ojp-rs

Configuration

  • Requires an API key from opentransportdata.swiss.
  • By default the environment variable that must be set is TOKEN with the API key.

Example

An example can be run with:

cargo run --example find_journeys

Dependencies

~17–38MB
~484K SLoC