1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (C) 2017 Kisio Digital and/or its affiliates.
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Affero General Public License as published by the
// Free Software Foundation, version 3.

// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
// details.

// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>

//! The `transit_model` crate proposes a model to manage transit data.
//! It can import and export data from [GTFS](http://gtfs.org/) and
//! [NTFS](https://github.com/CanalTP/ntfs-specification/blob/master/ntfs_fr.md).

#![deny(missing_docs)]

#[macro_use]
pub(crate) mod utils;
mod add_prefix;
use add_prefix::AddPrefix;
pub mod apply_rules;
pub(crate) mod common_format;
#[macro_use]
pub mod objects;
pub mod gtfs;
pub mod hellogo_fares;
#[cfg(feature = "proj")]
pub mod kv1;
pub mod merge_stop_areas;
mod minidom_utils;
pub mod model;
#[cfg(feature = "proj")]
pub mod netex_idf;
mod netex_utils;
pub mod ntfs;
mod read_utils;
#[doc(hidden)]
pub mod test_utils;
pub mod transfers;
#[cfg(feature = "proj")]
pub mod transxchange;
pub mod vptranslator;

/// Current version of the NTFS format
pub const NTFS_VERSION: &str = "0.9.2";

lazy_static::lazy_static! {
    /// Current datetime
    pub static ref CURRENT_DATETIME: String = chrono::Local::now().format("%FT%T").to_string();
}

#[cfg(test)]
#[path = "../model-builder/src/builder.rs"]
pub mod model_builder;

/// The error type used by the crate.
pub type Error = failure::Error;

/// The corresponding result type used by the crate.
pub type Result<T> = std::result::Result<T, Error>;

pub use crate::model::Model;