Compare commits
10 Commits
f31fa65d78
...
v0.4.0-rc.
Author | SHA1 | Date | |
---|---|---|---|
5690080a6a
|
|||
f7873ac66b
|
|||
83ae0999ea
|
|||
3656a040f4
|
|||
414f3966da
|
|||
efedb2533b
|
|||
059c511e05
|
|||
c4b7197267
|
|||
3a65991257
|
|||
7b9367c0a7
|
@@ -19,13 +19,11 @@ If you have everything listed in [requirements](#requirements), then let's begin
|
|||||||
|
|
||||||
### Variant 1
|
### Variant 1
|
||||||
|
|
||||||
1. `python -m pip install pyrmv`
|
`python -m pip install pyrmv`
|
||||||
|
|
||||||
### Variant 2
|
### Variant 2
|
||||||
|
|
||||||
1. `git clone https://git.end-play.xyz/profitroll/PythonRMV.git`
|
`python -m pip install git+https://git.end-play.xyz/profitroll/PythonRMV.git`
|
||||||
2. `cd PythonRMV`
|
|
||||||
3. `python setup.py install`
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -39,7 +37,7 @@ client = pyrmv.Client("AcessId")
|
|||||||
origin = client.stop_by_name("Frankfurt Hauptbahnhof", max_number=3)[0]
|
origin = client.stop_by_name("Frankfurt Hauptbahnhof", max_number=3)[0]
|
||||||
destination = client.stop_by_coords(50.099613, 8.685449, max_number=3)[0]
|
destination = client.stop_by_coords(50.099613, 8.685449, max_number=3)[0]
|
||||||
|
|
||||||
# Find a trip by locations got
|
# Find a trip by locations you got above
|
||||||
trip = client.trip_find(origin_id=origin.id, dest_id=destination.id)
|
trip = client.trip_find(origin_id=origin.id, dest_id=destination.id)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@@ -21,10 +21,9 @@ trip = client.trip_find(origin_id=origin.id, dest_id=destination.id)
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__name__ = "pyrmv"
|
__name__ = "pyrmv"
|
||||||
__version__ = "0.3.6"
|
__version__ = "0.4.0-rc.1"
|
||||||
__license__ = "MIT License"
|
__license__ = "MIT License"
|
||||||
__author__ = "Profitroll"
|
__author__ = "Profitroll"
|
||||||
|
|
||||||
from . import const, enums, errors, raw, utility
|
from . import classes, const, enums, errors, raw, utility
|
||||||
from .classes import *
|
from .classes.client import Client
|
||||||
from .classes.Client import Client
|
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
from .Board import BoardArrival, BoardDeparture, LineArrival, LineDeparture
|
from .board import BoardArrival, BoardDeparture, LineArrival, LineDeparture
|
||||||
from .Client import Client
|
from .gis import Gis
|
||||||
from .Gis import Gis
|
from .journey import Journey
|
||||||
from .Journey import Journey
|
from .leg import Leg
|
||||||
from .Leg import Leg
|
from .message import Channel, Message, Url
|
||||||
from .Message import Channel, Message, Url
|
from .stop import Stop, StopTrip
|
||||||
from .Stop import Stop, StopTrip
|
from .ticket import Ticket
|
||||||
from .Ticket import Ticket
|
from .trip import Trip
|
||||||
from .Trip import Trip
|
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Any, Mapping
|
from typing import Any, Mapping
|
||||||
|
|
||||||
from pyrmv.classes.Message import Message
|
from pyrmv.classes.message import Message
|
||||||
|
from pyrmv.utility import ref_upgrade
|
||||||
|
|
||||||
|
|
||||||
class LineArrival:
|
class LineArrival:
|
||||||
def __init__(self, data: Mapping[str, Any], client, retrieve_stops: bool = True):
|
def __init__(self, data: Mapping[str, Any], client, retrieve_stops: bool = True):
|
||||||
self.journey = client.journey_detail(data["JourneyDetailRef"]["ref"])
|
# Upgrade is temporarily used due to RMV API mismatch
|
||||||
|
# self.journey = client.journey_detail(data["JourneyDetailRef"]["ref"])
|
||||||
|
self.journey = client.journey_detail(ref_upgrade(data["JourneyDetailRef"]["ref"]))
|
||||||
|
|
||||||
self.status = data["JourneyStatus"]
|
self.status = data["JourneyStatus"]
|
||||||
self.messages = []
|
self.messages = []
|
||||||
self.name = data["name"]
|
self.name = data["name"]
|
||||||
@@ -40,7 +44,10 @@ class LineArrival:
|
|||||||
|
|
||||||
class LineDeparture:
|
class LineDeparture:
|
||||||
def __init__(self, data: Mapping[str, Any], client, retrieve_stops: bool = True):
|
def __init__(self, data: Mapping[str, Any], client, retrieve_stops: bool = True):
|
||||||
self.journey = client.journey_detail(data["JourneyDetailRef"]["ref"])
|
# Upgrade is temporarily used due to RMV API mismatch
|
||||||
|
# self.journey = client.journey_detail(data["JourneyDetailRef"]["ref"])
|
||||||
|
self.journey = client.journey_detail(ref_upgrade(data["JourneyDetailRef"]["ref"]))
|
||||||
|
|
||||||
self.status = data["JourneyStatus"]
|
self.status = data["JourneyStatus"]
|
||||||
self.messages = []
|
self.messages = []
|
||||||
self.name = data["name"]
|
self.name = data["name"]
|
@@ -1,16 +1,24 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from typing import List, OrderedDict, Union
|
from typing import List, OrderedDict, Union
|
||||||
|
|
||||||
from pyrmv.classes import *
|
from pyrmv.classes import (
|
||||||
|
BoardArrival,
|
||||||
|
BoardDeparture,
|
||||||
|
Journey,
|
||||||
|
Message,
|
||||||
|
Stop,
|
||||||
|
StopTrip,
|
||||||
|
Trip,
|
||||||
|
)
|
||||||
from pyrmv.enums import *
|
from pyrmv.enums import *
|
||||||
from pyrmv.raw import board_arrival as raw_board_arrival
|
from pyrmv.raw import board_arrival as raw_board_arrival
|
||||||
from pyrmv.raw.board_departure import board_departure as raw_board_departure
|
from pyrmv.raw import board_departure as raw_board_departure
|
||||||
from pyrmv.raw.him_search import him_search as raw_him_search
|
from pyrmv.raw import him_search as raw_him_search
|
||||||
from pyrmv.raw.journey_detail import journey_detail as raw_journey_detail
|
from pyrmv.raw import journey_detail as raw_journey_detail
|
||||||
from pyrmv.raw.stop_by_coords import stop_by_coords as raw_stop_by_coords
|
from pyrmv.raw import stop_by_coords as raw_stop_by_coords
|
||||||
from pyrmv.raw.stop_by_name import stop_by_name as raw_stop_by_name
|
from pyrmv.raw import stop_by_name as raw_stop_by_name
|
||||||
from pyrmv.raw.trip_find import trip_find as raw_trip_find
|
from pyrmv.raw import trip_find as raw_trip_find
|
||||||
from pyrmv.raw.trip_recon import trip_recon as raw_trip_recon
|
from pyrmv.raw import trip_recon as raw_trip_recon
|
||||||
from pyrmv.utility import find_exception
|
from pyrmv.utility import find_exception
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -113,7 +121,7 @@ class Client:
|
|||||||
* BoardArrival: Instance of `BoardArrival` object.
|
* BoardArrival: Instance of `BoardArrival` object.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if isinstance(direction, Stop) or isinstance(direction, StopTrip):
|
if isinstance(direction, (Stop, StopTrip)):
|
||||||
direction = direction.id
|
direction = direction.id
|
||||||
|
|
||||||
board_raw = raw_board_arrival(
|
board_raw = raw_board_arrival(
|
||||||
@@ -819,10 +827,7 @@ class Client:
|
|||||||
* List[Trip]: List of `Trip` objects. Empty list if none found.
|
* List[Trip]: List of `Trip` objects. Empty list if none found.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if real_time_mode == None:
|
real_time_mode = None if real_time_mode is None else real_time_mode.code
|
||||||
real_time_mode = None
|
|
||||||
else:
|
|
||||||
real_time_mode = real_time_mode.code
|
|
||||||
|
|
||||||
if isinstance(context, Trip):
|
if isinstance(context, Trip):
|
||||||
context = context.ctx_recon
|
context = context.ctx_recon
|
@@ -1,7 +1,8 @@
|
|||||||
from typing import Any, Mapping
|
from typing import Any, Mapping
|
||||||
|
|
||||||
from pyrmv.classes.Message import Message
|
from pyrmv.classes.message import Message
|
||||||
from pyrmv.classes.Stop import Stop
|
from pyrmv.classes.stop import Stop
|
||||||
|
from pyrmv.utility import ref_upgrade
|
||||||
|
|
||||||
|
|
||||||
class Journey:
|
class Journey:
|
||||||
@@ -9,7 +10,11 @@ class Journey:
|
|||||||
|
|
||||||
def __init__(self, data: Mapping[str, Any]):
|
def __init__(self, data: Mapping[str, Any]):
|
||||||
self.stops = []
|
self.stops = []
|
||||||
self.ref = data["ref"]
|
|
||||||
|
# Upgrade is temporarily used due to RMV API mismatch
|
||||||
|
# self.ref = data["ref"]
|
||||||
|
self.ref = ref_upgrade(data["ref"])
|
||||||
|
|
||||||
self.direction = data["Directions"]["Direction"][0]["value"]
|
self.direction = data["Directions"]["Direction"][0]["value"]
|
||||||
self.direction_flag = data["Directions"]["Direction"][0]["flag"]
|
self.direction_flag = data["Directions"]["Direction"][0]["flag"]
|
||||||
self.stops.extend(Stop(stop) for stop in data["Stops"]["Stop"])
|
self.stops.extend(Stop(stop) for stop in data["Stops"]["Stop"])
|
@@ -2,9 +2,9 @@ from typing import Any, Mapping
|
|||||||
|
|
||||||
from isodate import parse_duration
|
from isodate import parse_duration
|
||||||
|
|
||||||
from pyrmv.classes.Gis import Gis
|
from pyrmv.classes.gis import Gis
|
||||||
from pyrmv.classes.Message import Message
|
from pyrmv.classes.message import Message
|
||||||
from pyrmv.classes.Stop import StopTrip
|
from pyrmv.classes.stop import StopTrip
|
||||||
|
|
||||||
|
|
||||||
class Leg:
|
class Leg:
|
@@ -3,7 +3,7 @@ from typing import Any, Mapping
|
|||||||
|
|
||||||
from isodate import parse_duration
|
from isodate import parse_duration
|
||||||
|
|
||||||
from pyrmv.classes.Stop import Stop
|
from pyrmv.classes.stop import Stop
|
||||||
|
|
||||||
|
|
||||||
class Url:
|
class Url:
|
@@ -1,4 +1,4 @@
|
|||||||
class Ticket():
|
class Ticket:
|
||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
"externalContent": {
|
"externalContent": {
|
||||||
@@ -44,9 +44,9 @@ class Ticket():
|
|||||||
"FreigabeId": "20730",
|
"FreigabeId": "20730",
|
||||||
"Freigabe":"2645, 3670, 5001, 5002, 5003, 5004, 5005, 5006, 5011, 5013, 5015, 5021, 5022, 5023, 5031, 5041, 5042, 5046, 5059, 5100, 5233, 6239, 6626, 6636, 6637, 6639, 6648, 6649, 6650, 6655, 6660, 6664, 6691",
|
"Freigabe":"2645, 3670, 5001, 5002, 5003, 5004, 5005, 5006, 5011, 5013, 5015, 5021, 5022, 5023, 5031, 5041, 5042, 5046, 5059, 5100, 5233, 6239, 6626, 6636, 6637, 6639, 6648, 6649, 6650, 6655, 6660, 6664, 6691",
|
||||||
"FreigabeOverview": "Bad Homburg v.d.Höhe;Bad Soden a.Ts.;Eschborn;Friedrichsdorf;Glashütten"
|
"FreigabeOverview": "Bad Homburg v.d.Höhe;Bad Soden a.Ts.;Eschborn;Friedrichsdorf;Glashütten"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
pass
|
pass
|
@@ -1,7 +1,7 @@
|
|||||||
from isodate import parse_duration
|
from isodate import parse_duration
|
||||||
|
|
||||||
from pyrmv.classes.Leg import Leg
|
from pyrmv.classes.leg import Leg
|
||||||
from pyrmv.classes.Stop import StopTrip
|
from pyrmv.classes.stop import StopTrip
|
||||||
|
|
||||||
|
|
||||||
class Trip:
|
class Trip:
|
@@ -1,2 +1,3 @@
|
|||||||
from .find_exception import find_exception
|
from .find_exception import find_exception
|
||||||
|
from .journey_ref_converter import ref_upgrade
|
||||||
from .weekdays_bitmask import weekdays_bitmask
|
from .weekdays_bitmask import weekdays_bitmask
|
||||||
|
26
src/pyrmv/utility/journey_ref_converter.py
Normal file
26
src/pyrmv/utility/journey_ref_converter.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
def ref_upgrade(ref: str) -> str:
|
||||||
|
"""This function converts older journey refs to the newer ones.
|
||||||
|
|
||||||
|
### WARNING
|
||||||
|
This function will be deprecated as soon as RMV updates their API
|
||||||
|
|
||||||
|
### Args:
|
||||||
|
* ref (`str`): Old ref like this one: `2|#VN#1#ST#1700765441#PI#0#ZI#160749#TA#0#DA#241123#1S#3004646#1T#2228#LS#3006907#LT#2354#PU#80#RT#1#CA#S30#ZE#S1#ZB# S1#PC#3#FR#3004646#FT#2228#TO#3006907#TT#2354#`
|
||||||
|
|
||||||
|
### Raises:
|
||||||
|
* `KeyError`: Some required keys are not found in the ref provided
|
||||||
|
|
||||||
|
### Returns:
|
||||||
|
* `str`: Ref of the new type
|
||||||
|
"""
|
||||||
|
|
||||||
|
items = "|".join(ref.split("|")[1:]).strip("#").split("#")
|
||||||
|
result = {items[i]: items[i + 1] for i in range(0, len(items), 2)}
|
||||||
|
|
||||||
|
for required in ["VN", "ZI", "TA", "PU"]:
|
||||||
|
if required not in result:
|
||||||
|
raise KeyError(
|
||||||
|
f"Required key {required} in the old journey ref is not found during conversion to the newer journey ref"
|
||||||
|
)
|
||||||
|
|
||||||
|
return "|".join([result["VN"], result["ZI"], result["TA"], result["PU"]])
|
@@ -1,4 +1,5 @@
|
|||||||
from os import environ
|
from os import environ
|
||||||
|
from typing import List
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@@ -13,3 +14,23 @@ def api_token() -> str:
|
|||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def api_client(api_token: str) -> Client:
|
def api_client(api_token: str) -> Client:
|
||||||
return Client(api_token)
|
return Client(api_token)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture()
|
||||||
|
def sample_stop_id() -> str:
|
||||||
|
return "A=1@O=Frankfurt (Main) Taunusanlage@X=8668765@Y=50113478@U=80@L=3000011@"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture()
|
||||||
|
def sample_journey_id() -> str:
|
||||||
|
return "1|12709|0|80"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture()
|
||||||
|
def sample_origin() -> List[str]:
|
||||||
|
return ["50.084659", "8.785948"]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture()
|
||||||
|
def sample_destination() -> List[float]:
|
||||||
|
return [50.1233048, 8.6129742]
|
||||||
|
@@ -1,7 +1,81 @@
|
|||||||
|
from datetime import datetime, timedelta
|
||||||
|
from typing import List
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from pyrmv import Client
|
from pyrmv import Client, enums
|
||||||
from pyrmv.classes import Stop
|
from pyrmv.classes import Journey, Message, Stop, Trip
|
||||||
|
from pyrmv.classes.board import BoardArrival, BoardDeparture
|
||||||
|
|
||||||
|
|
||||||
|
def test_board_arrival(api_client: Client, sample_stop_id: str):
|
||||||
|
assert isinstance(
|
||||||
|
api_client.board_arrival(id=sample_stop_id, journeys_max=3), BoardArrival
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_board_departure(api_client: Client, sample_stop_id: str):
|
||||||
|
assert isinstance(
|
||||||
|
api_client.board_departure(id=sample_stop_id, journeys_max=3), BoardDeparture
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_him_search(api_client: Client):
|
||||||
|
assert isinstance(
|
||||||
|
api_client.him_search(date_end=datetime.now() + timedelta(days=10))[0], Message
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_journey_detail(api_client: Client, sample_journey_id: str):
|
||||||
|
assert (
|
||||||
|
api_client.journey_detail(
|
||||||
|
sample_journey_id,
|
||||||
|
real_time_mode=enums.RealTimeMode.FULL,
|
||||||
|
),
|
||||||
|
Journey,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_stop_by_coords(api_client: Client, sample_origin: List[str]):
|
||||||
|
assert isinstance(
|
||||||
|
api_client.stop_by_coords(sample_origin[0], sample_origin[1], max_number=3)[0], Stop
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_stop_by_id(api_client: Client, sample_stop_id: str):
|
||||||
|
assert isinstance(api_client.stop_by_id(sample_stop_id), Stop)
|
||||||
|
|
||||||
|
|
||||||
|
def test_trip_find(
|
||||||
|
api_client: Client, sample_origin: List[str], sample_destination: List[float]
|
||||||
|
):
|
||||||
|
assert isinstance(
|
||||||
|
api_client.trip_find(
|
||||||
|
origin_coord_lat=sample_origin[0],
|
||||||
|
origin_coord_lon=sample_origin[1],
|
||||||
|
destination_coord_lat=sample_destination[0],
|
||||||
|
destination_coord_lon=sample_destination[1],
|
||||||
|
messages=True,
|
||||||
|
)[0],
|
||||||
|
Trip,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_trip_recon(
|
||||||
|
api_client: Client, sample_origin: List[str], sample_destination: List[float]
|
||||||
|
):
|
||||||
|
assert isinstance(
|
||||||
|
api_client.trip_recon(
|
||||||
|
api_client.trip_find(
|
||||||
|
origin_coord_lat=sample_origin[0],
|
||||||
|
origin_coord_lon=sample_origin[1],
|
||||||
|
destination_coord_lat=sample_destination[0],
|
||||||
|
destination_coord_lon=sample_destination[1],
|
||||||
|
messages=True,
|
||||||
|
)[0],
|
||||||
|
)[0],
|
||||||
|
Trip,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_stop_by_name(api_client: Client):
|
def test_stop_by_name(api_client: Client):
|
||||||
|
36
wiki/Home.md
36
wiki/Home.md
@@ -2,4 +2,38 @@
|
|||||||
|
|
||||||
Welcome to the project's Wiki.
|
Welcome to the project's Wiki.
|
||||||
|
|
||||||
Conceptional there are two different types of methods. Normal and raw ones. Raw methods are only beautiful variant of HTTP requests, nothing except for that actually. Normal ones are meant to be used as objects. You can still provide strings here and there, but basic concept is focused on objects usage.
|
This module aims to provide eased access to RMV's OpenData API endpoints and enable some home-projects to show the data about public transit state at the moment. As for now, async is not supported and is not necessarily planned in the future, so bigger projects should consider this before using this module in the first place.
|
||||||
|
|
||||||
|
## Basic concepts behind
|
||||||
|
|
||||||
|
So the module `pyrmv` has two options to choose from when it comes to the usage:
|
||||||
|
|
||||||
|
1. Using higher-level methods of the class [pyrmv.Client](https://git.end-play.xyz/profitroll/PythonRMV/wiki/Client). These methods provide pythonic objects, can throw exceptions and are overall pretty neat.
|
||||||
|
2. Using raw functions from [pyrmv.raw](https://git.end-play.xyz/profitroll/PythonRMV/wiki/Raw-Functions). These functions are basically a small interface for HTTP requests that happen in the background and have little to no processing behind the scenes.
|
||||||
|
|
||||||
|
Your preferred variant depends on the use case, but usually higher-level methods of the Client should be the match.
|
||||||
|
|
||||||
|
## Objects
|
||||||
|
|
||||||
|
This module does **not** use the [FPTF](https://github.com/public-transport/friendly-public-transport-format) because it aims to give full access to the API RMV provides, thus objects Client gives you will contain a bit more information.
|
||||||
|
|
||||||
|
These objects are implemented in pyrmv:
|
||||||
|
|
||||||
|
* [BoardArrival](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.BoardArrival)
|
||||||
|
* [BoardDeparture](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.BoardDeparture)
|
||||||
|
* [LineArrival](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.LineArrival)
|
||||||
|
* [LineDeparture](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.LineDeparture)
|
||||||
|
* [Gis](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Gis)
|
||||||
|
* [Journey](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Journey)
|
||||||
|
* [Leg](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Leg)
|
||||||
|
* [Channel](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Channel)
|
||||||
|
* [Message](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Message)
|
||||||
|
* [Url](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Url)
|
||||||
|
* [Stop](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Stop)
|
||||||
|
* [StopTrip](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.StopTrip)
|
||||||
|
* [Trip](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Trip)
|
||||||
|
* ~~[Ticket](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Ticket)~~ (WIP)
|
||||||
|
|
||||||
|
## Note for bigger projects
|
||||||
|
|
||||||
|
As you may already know, bigger projects like [Öffi](https://gitlab.com/oeffi/oeffi) and [DB Navigator](https://play.google.com/store/apps/details?id=de.hafas.android.db) use NVV's API instead of RMV's for navigation and public transit querying. Reasons behind this are clear as day and from perspective of pyrmv it's highly recommended you also choose that way, because RMV loves to change or break their API in unexpected places and does not cooperate with developers well enough when they do so.
|
||||||
|
1
wiki/Raw-Functions.md
Normal file
1
wiki/Raw-Functions.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
@@ -1,15 +1,21 @@
|
|||||||
## [Home](https://git.end-play.xyz/profitroll/PythonRMV/wiki)
|
# [Home](https://git.end-play.xyz/profitroll/PythonRMV/wiki)
|
||||||
|
|
||||||
### Classes
|
## Classes
|
||||||
* [Client](https://git.end-play.xyz/profitroll/PythonRMV/wiki/Client)
|
|
||||||
|
|
||||||
### Methods
|
* [Client](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client)
|
||||||
* [board_arrival](https://git.end-play.xyz/profitroll/PythonRMV/wiki/board_arrival)
|
|
||||||
* [board_departure](https://git.end-play.xyz/profitroll/PythonRMV/wiki/board_departure)
|
## Methods
|
||||||
* [him_search](https://git.end-play.xyz/profitroll/PythonRMV/wiki/him_search)
|
|
||||||
* [journey_detail](https://git.end-play.xyz/profitroll/PythonRMV/wiki/journey_detail)
|
* [board_arrival](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client.board_arrival)
|
||||||
* [stop_by_coords](https://git.end-play.xyz/profitroll/PythonRMV/wiki/stop_by_coords)
|
* [board_departure](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client.board_departure)
|
||||||
* [stop_by_id](https://git.end-play.xyz/profitroll/PythonRMV/wiki/stop_by_id)
|
* [him_search](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client.him_search)
|
||||||
* [stop_by_name](https://git.end-play.xyz/profitroll/PythonRMV/wiki/stop_by_name)
|
* [journey_detail](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client.journey_detail)
|
||||||
* [trip_find](https://git.end-play.xyz/profitroll/PythonRMV/wiki/trip_find)
|
* [stop_by_coords](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client.stop_by_coords)
|
||||||
* [trip_recon](https://git.end-play.xyz/profitroll/PythonRMV/wiki/trip_recon)
|
* [stop_by_id](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client.stop_by_id)
|
||||||
|
* [stop_by_name](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client.stop_by_name)
|
||||||
|
* [trip_find](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client.trip_find)
|
||||||
|
* [trip_recon](https://git.end-play.xyz/profitroll/PythonRMV/wiki/classes.Client.trip_recon)
|
||||||
|
|
||||||
|
## Raw functions
|
||||||
|
|
||||||
|
* [List of raw functions](https://git.end-play.xyz/profitroll/PythonRMV/wiki/Raw-Functions)
|
||||||
|
1
wiki/classes/BoardArrival.md
Normal file
1
wiki/classes/BoardArrival.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/BoardDeparture.md
Normal file
1
wiki/classes/BoardDeparture.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Channel.md
Normal file
1
wiki/classes/Channel.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
@@ -1,5 +1,6 @@
|
|||||||
# PythonRMV Client
|
# Client
|
||||||
You are now viewing the main class of the module, its heart. The main Client class, all available normal methods can be found here.
|
|
||||||
|
You are now viewing the main class of the module, all available higher-level methods can be found here.
|
||||||
|
|
||||||
This page is about the Client class, which exposes high-level methods for an easy access to the API.
|
This page is about the Client class, which exposes high-level methods for an easy access to the API.
|
||||||
|
|
||||||
@@ -11,14 +12,14 @@ client = Client("SampleAPIKey")
|
|||||||
print(client.stop_by_id("A=1@O=Offenbach (Main)-Zentrum Marktplatz\/Frankf. Straße@X=8764456@Y=50105181@U=80@L=3002510@"))
|
print(client.stop_by_id("A=1@O=Offenbach (Main)-Zentrum Marktplatz\/Frankf. Straße@X=8764456@Y=50105181@U=80@L=3002510@"))
|
||||||
```
|
```
|
||||||
|
|
||||||
# Details
|
## Details
|
||||||
|
|
||||||
## `class pyrmv.Client`
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
* access_key (`str`) – Access ID for identifying the requesting client. Get your key on [RMV website](https://opendata.rmv.de/site/start.html).
|
* access_key (`str`) – Access ID for identifying the requesting client. Get your key on [RMV website](https://opendata.rmv.de/site/start.html).
|
||||||
|
|
||||||
### Methods:
|
### Methods
|
||||||
|
|
||||||
* [board_arrival](https://git.end-play.xyz/profitroll/PythonRMV/wiki/board_arrival) -> `BoardArrival`
|
* [board_arrival](https://git.end-play.xyz/profitroll/PythonRMV/wiki/board_arrival) -> `BoardArrival`
|
||||||
* [board_departure](https://git.end-play.xyz/profitroll/PythonRMV/wiki/board_departure) -> `BoardDeparture`
|
* [board_departure](https://git.end-play.xyz/profitroll/PythonRMV/wiki/board_departure) -> `BoardDeparture`
|
||||||
* [him_search](https://git.end-play.xyz/profitroll/PythonRMV/wiki/him_search) -> `List[Message]`
|
* [him_search](https://git.end-play.xyz/profitroll/PythonRMV/wiki/him_search) -> `List[Message]`
|
||||||
@@ -27,4 +28,4 @@ print(client.stop_by_id("A=1@O=Offenbach (Main)-Zentrum Marktplatz\/Frankf. Stra
|
|||||||
* [stop_by_id](https://git.end-play.xyz/profitroll/PythonRMV/wiki/stop_by_id) -> `Union[Stop, None]`
|
* [stop_by_id](https://git.end-play.xyz/profitroll/PythonRMV/wiki/stop_by_id) -> `Union[Stop, None]`
|
||||||
* [stop_by_name](https://git.end-play.xyz/profitroll/PythonRMV/wiki/stop_by_name) -> `List[Stop]`
|
* [stop_by_name](https://git.end-play.xyz/profitroll/PythonRMV/wiki/stop_by_name) -> `List[Stop]`
|
||||||
* [trip_find](https://git.end-play.xyz/profitroll/PythonRMV/wiki/trip_find) -> `List[Trip]`
|
* [trip_find](https://git.end-play.xyz/profitroll/PythonRMV/wiki/trip_find) -> `List[Trip]`
|
||||||
* [trip_recon](https://git.end-play.xyz/profitroll/PythonRMV/wiki/trip_recon) -> `List[Trip]`
|
* [trip_recon](https://git.end-play.xyz/profitroll/PythonRMV/wiki/trip_recon) -> `List[Trip]`
|
1
wiki/classes/Client/methods/Client.board_arrival.md
Normal file
1
wiki/classes/Client/methods/Client.board_arrival.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Client/methods/Client.board_departure.md
Normal file
1
wiki/classes/Client/methods/Client.board_departure.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Client/methods/Client.him_search.md
Normal file
1
wiki/classes/Client/methods/Client.him_search.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Client/methods/Client.journey_detail.md
Normal file
1
wiki/classes/Client/methods/Client.journey_detail.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Client/methods/Client.stop_by_coords.md
Normal file
1
wiki/classes/Client/methods/Client.stop_by_coords.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Client/methods/Client.stop_by_id.md
Normal file
1
wiki/classes/Client/methods/Client.stop_by_id.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Client/methods/Client.stop_by_name.md
Normal file
1
wiki/classes/Client/methods/Client.stop_by_name.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Client/methods/Client.trip_find.md
Normal file
1
wiki/classes/Client/methods/Client.trip_find.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Client/methods/Client.trip_recon.md
Normal file
1
wiki/classes/Client/methods/Client.trip_recon.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Gis.md
Normal file
1
wiki/classes/Gis.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Journey.md
Normal file
1
wiki/classes/Journey.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Leg.md
Normal file
1
wiki/classes/Leg.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/LineArrival.md
Normal file
1
wiki/classes/LineArrival.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/LineDeparture.md
Normal file
1
wiki/classes/LineDeparture.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Message.md
Normal file
1
wiki/classes/Message.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Stop.md
Normal file
1
wiki/classes/Stop.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/StopTrip.md
Normal file
1
wiki/classes/StopTrip.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Ticket.md
Normal file
1
wiki/classes/Ticket.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Class is not available yet. Documentation will appear here after the class is finished.
|
1
wiki/classes/Trip.md
Normal file
1
wiki/classes/Trip.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
1
wiki/classes/Url.md
Normal file
1
wiki/classes/Url.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Docs are not available yet. Please, use the linting in your IDE until the documentation is there.
|
Reference in New Issue
Block a user