sthlmkollektivtrafik
Download
pip install sthlmkollektivtrafik
Environment variable names
Store your api's as an environment variables with the names:
Plattsuppslag: SKT_location_api
Realtidsinformation: SKT_realtime_api
Storningsinformation: SKT_delay_api
Reseplanerare: SKT_planner_api
Platsuppslag
Examples
from sthlmkollektivtrafik import platsuppslag
result = platsuppslag.search("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("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("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("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]
Release files for sthlmkollektivtrafik 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sthlmkollektivtrafik-0.1.5.tar.gz | 4.0 kB | Details |
Release files / sthlmkollektivtrafik-0.1.5.tar.gz
| Download URL | sthlmkollektivtrafik-0.1.5.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
985007bf1a7008c0945b25f263906dfe9496cffa7e293a3137ab1573e7cd29f3
|
|
BLAKE2b-256 checksum How to use checksums |
d5cd5b27c8566595f65cb9844187e6e8158b76e4332a1fa995dd6c6dd9783988
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.0
|