API¶
Top-level functions¶
- joml.loads(string)¶
Parse journeys from a JOML document.
- Parameters:
string – A JOML document.
- Returns:
The journeys described by the document, in the order they appear.
Journeys¶
- class joml.Journey(legs: list[Leg])¶
A sequence of legs, travelled in order.
- Attr legs:
The legs of the journey, in the order they are travelled.
Parser¶
Tokeniser¶
- joml.tokenise(s: str) list[Token]¶
Split a JOML document into a list of tokens.
Comments, which begin with
#and continue to the end of the line, are discarded.- Parameters:
s – A JOML document.
- Returns:
The tokens in the document, in the order they appear.
- class joml.tokeniser.Token(type: TokenType, value: str)¶
A low-level token from a JOML document.
- Attr type:
The type of the token.
- Attr value:
The value of the token.
- class joml.tokeniser.TokenType(*values)¶
The type of a token.
- class joml.tokeniser.Keyword(*values)¶
A keyword that delimits parts of a JOML document.