PyTransportNSWv2 0.8.8__tar.gz → 0.8.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyTransportNSWv2
3
- Version: 0.8.8
3
+ Version: 0.8.9
4
4
  Summary: Get detailed per-trip transport information from TransportNSW
5
5
  Home-page: https://github.com/andystewart999/TransportNSW
6
6
  Author: andystewart999
@@ -24,8 +24,9 @@ Description: # TransportNSWv2
24
24
  The source API details can be found here: https://opendata.transport.nsw.gov.au/sites/default/files/2023-08/Trip%20Planner%20API%20manual-opendataproduction%20v3.2.pdf
25
25
 
26
26
  ### Parameters
27
+ Only the first three paramters are mandatory, the rest are optional. All parameters and their defaults are as follows:
27
28
  ```python
28
- .get_trip(origin_stop_id, destination_stop_id, api_key, [trip_wait_time = 0], [transport_type = 0], [strict_transport_type = True|False], [raw_output = True|False], [journeys_to_return = 1], [route_filter = ''], [include_realtime_location = True], [include_alerts = 'none'], [alert_type = 'all'], check_stop_ids = True, forced_gtfs_uri = [])
29
+ .get_trip(origin_stop_id, destination_stop_id, api_key, trip_wait_time = 0, transport_type = 0, strict_transport_type = False, raw_output = False, journeys_to_return = 1, route_filter = '', include_realtime_location = True, include_alerts = 'none', alert_type = 'all', check_stop_ids = True, forced_gtfs_uri = [])
29
30
  ```
30
31
 
31
32
  Transport types:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyTransportNSWv2
3
- Version: 0.8.8
3
+ Version: 0.8.9
4
4
  Summary: Get detailed per-trip transport information from TransportNSW
5
5
  Home-page: https://github.com/andystewart999/TransportNSW
6
6
  Author: andystewart999
@@ -24,8 +24,9 @@ Description: # TransportNSWv2
24
24
  The source API details can be found here: https://opendata.transport.nsw.gov.au/sites/default/files/2023-08/Trip%20Planner%20API%20manual-opendataproduction%20v3.2.pdf
25
25
 
26
26
  ### Parameters
27
+ Only the first three paramters are mandatory, the rest are optional. All parameters and their defaults are as follows:
27
28
  ```python
28
- .get_trip(origin_stop_id, destination_stop_id, api_key, [trip_wait_time = 0], [transport_type = 0], [strict_transport_type = True|False], [raw_output = True|False], [journeys_to_return = 1], [route_filter = ''], [include_realtime_location = True], [include_alerts = 'none'], [alert_type = 'all'], check_stop_ids = True, forced_gtfs_uri = [])
29
+ .get_trip(origin_stop_id, destination_stop_id, api_key, trip_wait_time = 0, transport_type = 0, strict_transport_type = False, raw_output = False, journeys_to_return = 1, route_filter = '', include_realtime_location = True, include_alerts = 'none', alert_type = 'all', check_stop_ids = True, forced_gtfs_uri = [])
29
30
  ```
30
31
 
31
32
  Transport types:
@@ -16,8 +16,9 @@ If it's available, the general occupancy level and the latitude and longitude of
16
16
  The source API details can be found here: https://opendata.transport.nsw.gov.au/sites/default/files/2023-08/Trip%20Planner%20API%20manual-opendataproduction%20v3.2.pdf
17
17
 
18
18
  ### Parameters
19
+ Only the first three paramters are mandatory, the rest are optional. All parameters and their defaults are as follows:
19
20
  ```python
20
- .get_trip(origin_stop_id, destination_stop_id, api_key, [trip_wait_time = 0], [transport_type = 0], [strict_transport_type = True|False], [raw_output = True|False], [journeys_to_return = 1], [route_filter = ''], [include_realtime_location = True], [include_alerts = 'none'], [alert_type = 'all'], check_stop_ids = True, forced_gtfs_uri = [])
21
+ .get_trip(origin_stop_id, destination_stop_id, api_key, trip_wait_time = 0, transport_type = 0, strict_transport_type = False, raw_output = False, journeys_to_return = 1, route_filter = '', include_realtime_location = True, include_alerts = 'none', alert_type = 'all', check_stop_ids = True, forced_gtfs_uri = [])
21
22
  ```
22
23
 
23
24
  Transport types:
@@ -269,7 +269,7 @@ class TransportNSWv2(object):
269
269
  occupancy = first_stop['properties']['occupancy']
270
270
 
271
271
  alerts = "[]"
272
- if include_alerts != 'none':
272
+ if self.include_alerts != 'none':
273
273
  # We'll be adding these to the returned JSON string as an array
274
274
  # Only include alerts of the specified priority or greater, and of the specified type
275
275
  alerts = self.find_alerts(legs, self.include_alerts, self.alert_type)
@@ -524,14 +524,13 @@ class TransportNSWv2(object):
524
524
 
525
525
  alert_priorities = {
526
526
  "all" : 0,
527
- "veryLow" : 1,
527
+ "verylow" : 1,
528
528
  "low" : 2,
529
529
  "normal" : 3,
530
530
  "high" : 4,
531
- "veryHigh" : 5
531
+ "veryhigh" : 5
532
532
  }
533
-
534
- return alert_priorities.get(alert_priority, 99)
533
+ return alert_priorities.get(alert_priority.lower(), 4)
535
534
 
536
535
 
537
536
  def get_mode_list(self, mode, agencyid):
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="PyTransportNSWv2",
8
- version="0.8.8",
8
+ version="0.8.9",
9
9
  author="andystewart999",
10
10
  author_email="andy.stewart@live.com",
11
11
  description="Get detailed per-trip transport information from TransportNSW",