ojp-rs

Crates.ioojp-rs
lib.rsojp-rs
version0.2.4
created_at2025-11-19 16:03:58.847734+00
updated_at2025-11-28 14:15:49.11337+00
descriptionA library for interacting with Open Journey Planner (OJP) services
homepage
repositoryhttps://github.com/urban-travel/ojp-rs
max_upload_size
id1940328
size447,570
Orestis (omalaspinas)

documentation

README

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
Commit count: 0

cargo fmt