Skip to content

Commit f24dc43

Browse files
committed
minor updates
1 parent 70d3f0a commit f24dc43

File tree

1 file changed

+31
-13
lines changed

1 file changed

+31
-13
lines changed

README.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# neardeps
22
_an iOS shortcut for displaying nearest public transport departures_
3+
34
## General
45
This repository contains source code and auxiliary files for deploying Docker container - **back-end** and download link for iCloud shortcut - **front-end**.
56
> [!TIP]
6-
> If the user does not want to deploy their own Docker container, they can use author's one, that runs this exact Python script. It can be found on following link:
7+
> If the user does not want to deploy their own Docker container, they can use author's one. It can be found on following link:
78
>
89
> [`http://gtfs.vojtechlukas.cz/departures`](http://gtfs.vojtechlukas.cz/departures)
910
>
@@ -29,8 +30,8 @@ At this stage of the project, API endpoint `/departures` implemented in [app.py]
2930
| `city` | str | yes | City whose GTFS data shall be examined. So far, just `brno` is implemented |
3031
| `lat` | float | yes | Latitude GPS coordinate of current user position |
3132
| `lon` | float | yes | Longitude GPS coordinate of current user position |
32-
| `time` | str(`HH:MM:SS`) | no | Time for querying public transport departures |
33-
| `date` | str(`YYYY-MM-DD`) | no | Date for querying public transport departures |
33+
| `time` | str(`HH:MM:SS`) | no | Time for querying public transport departures. Omitted = current time |
34+
| `date` | str(`YYYY-MM-DD`) | no | Date for querying public transport departures. Omitted = current date |
3435

3536
### Example Usage
3637
```
@@ -41,24 +42,41 @@ domain.com/departures?city=brno&lat=49.123&lon=16.456
4142
domain.com/departures?city=brno&lat=49.123&lon=16.456&date=2024-12-31&time=12:35:00
4243
```
4344
- returns JSON with departures on Dec 31 2024 at nearest (based on `lat` and `lon` fields) public transport stop
45+
4446
### Returns
45-
Endpoint returns JSON with following structure and example values:
47+
Following request
48+
```
49+
http://domain.com/departures?
50+
lat=49.21630&
51+
lon=16.57843&
52+
city=brno&
53+
time=1:00:00&
54+
date=2024-12-15
55+
```
56+
returns JSON with following structure and values:
4657
```json
4758
{
4859
"departures": [
4960
{
50-
"departure_time": "16:05:00",
51-
"route_short_name": "36",
52-
"trip_headsign": "Komín, sídliště",
53-
"trip_id": 54186
61+
"departure_time": "01:12:00",
62+
"route_short_name": "N89",
63+
"trip_headsign": "U Luhu",
64+
"trip_id": 56550
65+
},
66+
{
67+
"departure_time": "02:12:00",
68+
"route_short_name": "N89",
69+
"trip_headsign": "U Luhu",
70+
"trip_id": 56557
5471
},
5572
{
56-
"departure_time": "16:20:00",
57-
"route_short_name": "36",
58-
"trip_headsign": "Komín, sídliště",
59-
"trip_id": 54108
73+
"departure_time": "03:12:00",
74+
"route_short_name": "N89",
75+
"trip_headsign": "U Luhu",
76+
"trip_id": 56563
6077
},
61-
// altogether returns 10 earliest public transport departures
78+
// ...
79+
}
6280
],
6381
"nearest_stop": "Makovského náměstí"
6482
}

0 commit comments

Comments
 (0)