Python library for easier use of www.trafiklab.se api's'
Project description
sthlmkollektivtrafik
Platsuppslag
Examples
from sthlmkollektivtrafik import platsuppslag
result = platsuppslag.search("apiKey", "searchString")
print("Name: {} Id: {}".format(result.name, result.id))
Parameters
Name | Type | Description |
---|---|---|
.name | String | name of the place |
.id | Integer | station id |
.type | String | station, adrees or POI |
.all | json file | everything |
.code | Integer | statuscode from call |
.responses | Integer | number of results |
.stations | String-list | all search-results, names |
.log | String-list | log |
Realtidsinformation
Example
from sthlmkollektivtrafik import realtidsinformation
result = realtidsinformation.departure("apiKey", "stationId", "timewindow")
for i in range(len(result.busDest)):
print("{} {} - {}".format(result.busDest[i], result.busNum[i], result busTime[i]))
Parameters
Name | Type | Description |
---|---|---|
.all | json file | everything |
.buses | json file | all bus departures |
.metros | json file | all metro departures |
.trains | json file | all train departures |
.(bus/metro/train)Dest | String-list | ex .busDest |
.(bus/metro/train)Time | String-list | ex .metroTime |
.(bus/metro/train)Num | String-list | ex .trainNum |
.log | String-list | log |
Storningsinformation
Example
from sthlmkollektivtrafik import storningsinformation
result = realtidsinformation.departure("apiKey", "stationId")
print(result.headers[0])
print(result.details[0])
Parameters
Name | Type | Description |
---|---|---|
.all | json file | everything |
.headers | String-list | titles |
.details | String-list | text |
.log | String-list | log |
Reseplanerare
Example
from sthlmkollektivtrafik import reseplanerare
result = reseplanerare.searchJourney("apiKey", "startId", "destId")
for leg in res.journey[0]:
print("{} {}: Take {} to {} ".format(leg[1], leg[0], leg[2], leg[4]))
Parameters
journey = [journey1, journey2, journey3...]
journey1 = [leg1, leg2, leg3....]
leg = [startTime, startName, transportName, destTime, destName]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for sthlmkollektivtrafik-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2da6e597a5be217f24095c5e766f6a90cdd2973b60923df5df3dea2883201a20 |
|
MD5 | 5c496115bd18c5b0ee18f539b4a64ece |
|
BLAKE2b-256 | 207875e06034a0a64b7568606f920fed87871015111e7d25c6ff432604525140 |
Close
Hashes for sthlmkollektivtrafik-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06c10993c67becc1084fd83875f291af821d5d523b45fd899589d285ac301e1d |
|
MD5 | 31bdbfd7c69ecde53d68375f4fc53b71 |
|
BLAKE2b-256 | 29d87e3d03d03ca5a40f87db4c6b9212463a92c4ec8d2ca5a936a915981fe798 |