This is a Rust wrapper for the Nigiri core (currently this fork) of the MOTIS project. It enables retrieving static and realtime timetable data from the various formats (e.g. GTFS/GTFS-RT) parsed by Nigiri. The nigiri-sys
crate provides the raw, unsafe bindings, while the motis-nigiri
crate in the root of this repository provides a safe wrapper with an abstracted API.
It is currently not possible to completely build these crates in the Cargo build lifecycle. You will need Docker and/or the necessary build dependencies installed locally.
- Run
nigiri-sys/build-docker.sh
once. This currently probably only works on Linux. For other platforms, adapt thenigiri-sys/build-docker.sh
or try to runnigiri-sys/build.sh
directly on your machine. If you already havenigiri
checked out on your machine, before running, you may want to symlink it to thenigiri-sys
directory or adapt the build script. Note that as long as patches to nigiri are not merged upstream, you should manually clone https://github.com/traines-source/nigiri intonigiri-sys/nigiri
and check out theabi-journeys
branch. It will take some time to buildnigiri
. - Afterwards, you should be able to build the Rust crates (
nigiri-sys
andmotis-nigiri
, which depends on the former) or depending crates as usual (cargo build
). This requires glibc 2.34 and possibly some other C/C++ stdlib dependencies installed on your machine. Alternatively, you can runbuild-docker.sh
in the root of this repository.
Note that when using the raw nigiri-sys
bindings you must always call the respective *_destroy_*
functions when done, otherwise memory will be leaked. When using motis-nigiri
, this is done automatically when the respective structs are dropped.