PublicTransport

Plasma 4 Widgets

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

60
Score 85.2%
Description:

This is a Plasma data engine, applet and runner for public transport timetable data. The applet shows a departure/arrival board for a given stop. It can also show journeys to or from the given "home stop". It displays additional information like delays, news about journeys, routes, vehicle types (with icons). Timetable data is available for trams, buses, subway, trains, ferries and planes (using flightstats.com). You can set alarms for departures and filter departures (by type of vehicle, target/origin, delay, transport line string/number, intermediate stops). Filters can also be combined.
Timetable data gets received from provider plugins. Since version 0.11 there are two types of plugins: GTFS and script providers. Script providers need a network connection and can be used to read timetable data from any document type, eg. XML, binary or HTML. GTFS providers only need to import the GTFS feed once and can then be used offline (but a network connection can be used for GTFS-realtime).

My Blog: http://fpuelz-kde.blogspot.com/
PublicTransport on UserBase: http://userbase.kde.org/Plasma/Public_Transport
PublicTransport on KDE projects: https://projects.kde.org/projects/playground/base/publictransport
PublicTransport on ohloh.net: https://www.ohloh.net/p/publicTransport

You can donate me ;)

News
17.01.2013: Version 0.11 beta released
30.12.2012: Version 0.11 alpha 2 released
04.12.2012: Version 0.11 alpha released

Installation
To install PublicTransport download a package for your distribution. If there is no such package you can ask the appropriate packagers for your distribution to create one. Please leave a comment if a new package is created or if you use a package not mentioned in the download list here, so that I can add it.
If you want to install PublicTransport, but there are no packages available for you (yet?) or you want to try the newest version with no new package yet, you can use the installer script (install.sh) included in the Sources download.
But note that software installed with that installer script isn't managed by your package manager in any way and may produce conflicts with installed packages, eg. if PublicTransport is already installed via the package manager. The script should be quite easy to use and also lets you uninstall the software again. You need GIT to use the installer, because the sources are actually downloaded using GIT by the script (from git://anongit.kde.org/publictransport).

There's also a script for packagers, that can download tarballs for all PublicTransport components for a specific version.
You can clone the GIT repository from git://anongit.kde.org/publictransport (read only), which also clones all history. From your local clone of the repository you can checkout all tagged versions (see the HINTS_FOR_PACKAGE_MAINTAINERS file).
If you want to contribute code, you need a KDE account and you can clone the repository with SSH from this URL: git@git.kde.org:publictransport (read + write). You can of course also send me patches via email.

Note: The Sources tarball does not contain the sources, but a script to download them from it's GIT repository and the translations from KDE's SVN. The script asks for the version to compile and install.

Adding a Service Provider Plugin
- Install TimetableMate, maybe not included in the packages, but in the source archive.
- The filenames start with the country code, followed by "_" and an abbreviation of the service provider, e.g. "ch_sbb" for switzerland, service provider "SBB".
- You can test your script and the URLs with TimetableMate. It also offers syntax completion with documentation and templates for the parser functions, that get called by the data engine.
- Also works for GTFS providers
- After installation of your plugin you can open the configuration dialog of the public transport applet and the new provider should be in there.
- You can also open/edit existing providers by simply clicking "Open in TimetableMate..." in the provider data dialog (accessible from the configuration dialog).
- Checkout the documentation of the data engine, it contains much information about the data sources of the engine and how to create new provider plugins.

You are welcome to optimize the scripts in the existing providers in the "serviceProviders" directory in the data engine source directory.

Comments are appreciated.
Last changelog:

6 years ago

17.01.2013:
(version 0.11 beta)
Many crash/bug fixes, visual polishing, see http://fpuelz-kde.blogspot.de/. (The install.sh script is actually unchanged, just select the new version)

30.12.2012:
(version 0.11 alpha 2)
Providers are now hosted on openDesktop.org, download via GHNS, many fixes etc. See http://fpuelz-kde.blogspot.de/. (The install.sh script is actually unchanged, just select the new version)

04.12.2012:
(version 0.11 alpha)
Many improvements, new features, GTFS support, etc. See http://fpuelz-kde.blogspot.de/.
Update: Improved install script, automatically select latest version for installation, show available versions sorted by date, allow switching to another version when starting the script again with the repository already cloned
Update 2: Allow selecting git HEAD for installation again (the script shows Current_Development_Version for it), HEAD contains a fix for building with GTFS support but without protocol buffers installed

18.10.2011:
(version 0.10 RC2)
Applet:
- Fix link errors
- Fix memory leaks
- Fix applet collapsing to popup icon in desktop
- Drawing performance improvements
- Use of KPixmapCache for vehicle type icons
- New monochrome icons, shown in the popup icon
- Add possibility to put the applet into the notification area
- Better layout adjustments for small sizes
- Change applet tooltip according to current departure group in popup icon
- Shorter alarm names, alarm names in notifications
- Nicer alarm background
- Fix color groups and route time display for arrivals
TimetableMate:
- Fix for missing KWebKitPart include file, it now uses KWebView directly
Library:
- Fix a crash with GraphicalTimetableLine (missing null pointer check)

C

fpuelz

7 years ago

What is the error message?
If all build deps are installed, cmake succeeds, but make fails? It may help to cleanup the build directory after changing eg. BUILD_PROVIDER_TYPE_GTFS.

Report

robsn81

7 years ago

only with option -DBUILD_PROVIDER_TYPE_GTFS=OFF I get a sucessful build under ubuntu raring. Build-Deps are installed

Report

9

Ireyon

7 years ago

It seems that the DB service doesn't work anymore. I just get "This stop name is ambigous" and "No departures due to an error" messages from the applet.

Report

9

jenzuslongus

7 years ago

Unfortunately it seems that Deutsche Bahn changed their "Reiseinformationssystem" (travel information system). There is st least one other site (zugmonitor.sueddeutsche.de) that encounters similar problems. It looks like there are major changes necessary to get the provider Deutsche Bahn working again.

Report

9

meyerm

7 years ago

Is public transport still being developed? Just curious as the last release (a RC) is a year old. Thank you!

Report

C

fpuelz

7 years ago

Hi, sorry for not posting updating here.. But there's hope :)
Actually there has been a very silent 0.10 release in git. But it's not very usable, because most provider scripts in that version do not work any longer (changed HTML layouts..). I'm quite busy finishing the next version, which will have much better, faster and more stable support for HAFAS providers like de_db, along with a new QtScript API. It will no longer depend on HTML scraping, but uses XML sources (and even very small binary sources for journeys with more details).
I'll try to find enough time to release 0.11 soon :)

Report

9

Ireyon

7 years ago

Good news, thanks a lot for your effort!

Report

9

meyerm

7 years ago

Awesome! Thank you very much for this truly outstanding plasmoid. I am happy to hear that the project is not dead. Hopefully you're successful with your plans so that we will reach the right U-Bahn from the faculty for lunch once again in time! ;-)

Report

cmlr

7 years ago

The Arch Linux package has been renamed; please update the link as follows:
https://aur.archlinux.org/packages.php?ID=60812

Report

markum

7 years ago

Hey, Weser-Ems-Transport-Provider is currently broken. Every stop is reported as being ambigious or just showing nothing after being selected. I believe it may have something to do with the fact they are now proving realtime-information for public transport in Bremen. Example for a station not working is "Bremen Domsheide".

Report

C

fpuelz

7 years ago

That provider is working again in 0.11 alpha with more supported features and it also shows the delays (reads HAFAS XML instead of HTML now).

Report

bernhardh

7 years ago

it's a pitty, but the 32bit edition for ubuntu is down :(

Report

takanowaka

7 years ago

hey.. can anyone update imhd.sk parser? the landing page and layout has changed so the widget doesn't work anymore

new landing page: http://imhd.zoznam.sk/{city}/search.html?hladaj={stop}

but i can't figure out the regexp unless i learn js :(

thanks

Report

9

Finswimmer

7 years ago

Hi,

I have updated my ebuilds.
They are now stored here: http://tobiaskaminsky.de/publictransport/publictransport-ebuild.tar

Included is:
publictransport-0.10-r2.ebuild
publictransport-9999.ebuild (which is master)

Tobi

Report

H00K

7 years ago

Why don't you try to get your ebuild into the official Portage tree?

Or at least into one of the overlays (KDE perhaps?)

Report

9

Finswimmer

7 years ago

10.2 seems not to work with > KDE-4.7.4

Report

9

Eol

8 years ago

Hello.
I have a question about scripting. Wouldn't be better if script decide itself which pages does it need to download in order to generate timetable/etc? In that case there would be no need for such workarounds as sort of template engine for urls in XML (basically it is bad because it obviously doesn't cover all the situations), session key (it doesn't cover all the situations as well: provider may need more complicated stuff to be done). And instead of that let scripts to implement such methods as getTimetable(stop,date), getJourney(stop1,stop2,date), etc
It would be easier to maintain (no need to add more similar workarounds for other providers), and not-so-harder for script-writers (basically, it would add just few strings as "html = httpGet('http://somecoolprovider/timetable.php?stop='+stop.stopId+'&date='+date.format('dd-mm-yyyy')" - just an pseudocode example).

Report

C

fpuelz

8 years ago

Yes, that's better. I had something like that in mind for some time now. And now I have a working "prototype" :)

Currently it uses a new script function "getTimetable" if no template departure URL is given in the XML file. Scripts also got a new object named "network", which has a "download" function to synchronously download a document (and convert it to unicode). To not block the data engine (and plasma) while waiting for a network request to be executed, the script gets executed in a thread. That means, that KIO can't be used (not thread safe), so it uses QNetworkManager for downloading and lets the thread wait to finish the request using a QEventLoop.

With this some thing like this can be written in scripts:

function getTimetable( city, stop, dateTime, dataType, maxCount ) {
var url = "http://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?rt=1" +
"&input=" + stop + "!" +
"&boardType=" + (dataType == "arrivals" ? "arr" : "dep") +
"&date=" + helper.formatDateTime(dateTime.toString(), "dd.MM.yy") +
"&time=" + helper.formatDateTime(dateTime.toString(), "hh:mm") +
"&maxJourneys=" + maxCount +
"&disableEquivs=no&start=yes&productsFilter=111111111";
var data = network.download( url );
parseTimetable( data );
}

This function works for de_db and calls the normal "parseTimetable" function with the downloaded data. It makes the scripts much more flexible, anything can be downloaded from the script.

Now I need to finish the new thread class for the scripts, add support again for journeys/stop suggestions and have scripts use this new method. Then I can remove some of the workaround functions :)

Report

9

Eol

8 years ago

Really nice to hear that! :)
And one more thing. Is it possible (or will it be possible) for scripts to store some internal data between calls? For example, stopIDs (to generate URLs), in order not to download&parse it every time; or, maybe, some providers may provide some sort of journeyid?
I'm not sure how Kross scripting works, so...

Report

C

fpuelz

8 years ago

I can easily make it possible for scripts to store values, maybe in another script object "storage". It will only loose it's stored data, when the accessor gets deleted, ie. when no more connections using it are open. But it's also possible to store that "storage" to disk.. Maybe I'll add both. But storage on disk should then have a lifetime.

QScript is really great.. Works like a charm :) I'll remove some other hacks I did to not crash scripts in Kross. For example the helper.matchTime() function will return a JavaScript Date object instead of an array with hour and minute values as integers. And I'll replace DepartureHour and DepartureMinute with DepartureTime (this is actually a relict of the times, where there were only XML files with regexps..). There will also be a DepartureDateTime to simply store a Date object.
Scripts can then write:
result.addData({ Target: 'target', DepartureDateTime: new Date(), VehicleType: 'bus' });
The "timetableData" script object can then be removed.

Another great new thing is that scripts will be able to publish data to visualizations before everything is parsed. Currently I let the first 10 departures be published automatically and then the rest.

Because everything is so easy with QScript I'll maybe add it to version 0.10... At least with script objects with a stable API, so that scripts don't need to be updated again to work with 0.11.

Report

C

fpuelz

8 years ago

Unfortunately Kross with KJS as JavaScript interpreter tends to crash sometimes. Especially the string returned by the new network.download() function produces crashes when it gets used in the script sometimes.. and without error message. Some conversion between QString and the KJS string objects are somehow wrong, I think.

But there is another possibility: Using QtScript. There is even the possibility to import Kross into QtScript, so you can execute eg. Python from within QtScript. And it should be faster than KJS. There could also be debugging in TimetableMate.
This will not make it into 0.10 but 0.11, too many changes are needed and I want to release 0.10 very soon now.
0.11 will also offer support for GTFS, will get an interesting release, I think :)

Report

9

Eol

8 years ago

Hello. Thanks for this project :)

I was trying to write some accessor using Python. However, TimetableMate gave me strange syntax error (I'm pretty sure my syntax is fine). Seems like you're using own JavaScriptParser in timetablemate.cpp even if script isn't javascript at all :).

Another problem is that is says that "[...]only supports version 1.0". However the "Version" field from "accessor->general" says "1.0". In XML wrote by Timetablemate there is a line "<accessorInfo fileVersion="" version="1.0" type="HTML">". Seems like "version" and "fileVersion" are different things. So where can I provide fileVersion?

I am using 0.10_rc2 version compiled from source code. If you need more information, please tell :)

Report

C

fpuelz

8 years ago

Hm.. right TimetableMate only works with JavaScript.. Thanks for trying it out with Python :) I'll disable my JS parser if JS isn't used. I won't write another parser for Python or Ruby, so there will be a bit less support from TimetableMate. But I'll try to not let the JS parser get into the way of Python/Ruby devs.

"version" is for the version of the accessor, while "fileVersion" is for the version of the accessor's XML file structure. If you update your accessor, you can update the version in "accessor->general" and give a changelog entry in "accessor->changelog". I know it's a bit confusing.. And there is even the <?xml tag with another "version="1.0"" attribute.
Maybe TimetableMate should better offer a combobox for the "fileVersion" attribute.

More explanations about the XML files is available in the data engines documentation here: http://publictransport.horizon-host.com/doc/engine/0.10/page_accessor_infos.html.

Report

9

Eol

8 years ago

I removed all these checks as workaround, recompiled and all seems to work fine.

Report

9

Eol

8 years ago

Well, seems like lots of stuff in timetablemate are related to javascript and it works only with javascript. For example, actions in menu ("Tools -> Run script") are disabled because it thinks my code is javascript when it determines whether I provided that function or not.

Report

6 years ago

17.01.2013:
(version 0.11 beta)
Many crash/bug fixes, visual polishing, see http://fpuelz-kde.blogspot.de/. (The install.sh script is actually unchanged, just select the new version)

30.12.2012:
(version 0.11 alpha 2)
Providers are now hosted on openDesktop.org, download via GHNS, many fixes etc. See http://fpuelz-kde.blogspot.de/. (The install.sh script is actually unchanged, just select the new version)

04.12.2012:
(version 0.11 alpha)
Many improvements, new features, GTFS support, etc. See http://fpuelz-kde.blogspot.de/.
Update: Improved install script, automatically select latest version for installation, show available versions sorted by date, allow switching to another version when starting the script again with the repository already cloned
Update 2: Allow selecting git HEAD for installation again (the script shows Current_Development_Version for it), HEAD contains a fix for building with GTFS support but without protocol buffers installed

18.10.2011:
(version 0.10 RC2)
Applet:
- Fix link errors
- Fix memory leaks
- Fix applet collapsing to popup icon in desktop
- Drawing performance improvements
- Use of KPixmapCache for vehicle type icons
- New monochrome icons, shown in the popup icon
- Add possibility to put the applet into the notification area
- Better layout adjustments for small sizes
- Change applet tooltip according to current departure group in popup icon
- Shorter alarm names, alarm names in notifications
- Nicer alarm background
- Fix color groups and route time display for arrivals
TimetableMate:
- Fix for missing KWebKitPart include file, it now uses KWebView directly
Library:
- Fix a crash with GraphicalTimetableLine (missing null pointer check)

12345678910
141
product-maker mirkogennari Jan 15 2017 9 excellent
product-maker matafleur Apr 08 2015 9 excellent
product-maker Soru Jun 07 2014 9 excellent
product-maker MatthiasM Mar 18 2013 9 excellent
product-maker lei00 Feb 25 2013 9 excellent
product-maker meyerm Oct 12 2012 9 excellent
product-maker djselbeck Dec 30 2011 9 excellent
product-maker vortex375 Nov 12 2011 9 excellent
product-maker Rando25 Nov 10 2011 9 excellent
product-maker Eol Nov 07 2011 9 excellent
product-maker nikore90 Oct 18 2011 9 excellent
product-maker warrob Sep 15 2011 9 excellent
product-maker quippini Aug 11 2011 9 excellent
product-maker jenzuslongus Jul 29 2011 9 excellent
product-maker tobaj Jul 22 2011 9 excellent
product-maker thrawn Jul 10 2011 9 excellent
product-maker mschu Mar 30 2011 9 excellent
product-maker Vistausss Mar 27 2011 9 excellent
product-maker Genserowski Mar 26 2011 9 excellent
product-maker roadracer Mar 11 2011 9 excellent
product-maker terwarf Mar 09 2011 9 excellent
product-maker FollowByWhiteRabbit Mar 04 2011 9 excellent
product-maker FraSMOG Mar 04 2011 9 excellent
product-maker terrorbaby92 Mar 03 2011 9 excellent
product-maker vkmaheshbhat Feb 28 2011 9 excellent
product-maker misiakdurko Feb 27 2011 9 excellent
product-maker FSchulz Feb 26 2011 9 excellent
product-maker nsaibot Feb 17 2011 9 excellent
product-maker Vzlom Feb 16 2011 9 excellent
product-maker nisavid Feb 12 2011 9 excellent
product-maker flanello Feb 06 2011 9 excellent
product-maker kovariadam Feb 06 2011 9 excellent
product-maker momonster Feb 06 2011 9 excellent
product-maker Weaselweb Feb 05 2011 9 excellent
product-maker Ireyon Feb 02 2011 9 excellent
product-maker vitoubien Feb 01 2011 3 bad
product-maker Finswimmer Jan 30 2011 9 excellent
product-maker EliasP Jan 19 2011 9 excellent
product-maker fixu Dec 16 2010 9 excellent
product-maker PyroLinux Nov 08 2010 9 excellent
product-maker thecrazyzorro Oct 30 2010 9 excellent
product-maker Dieter-MZ Oct 06 2010 9 excellent
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
simgunz
Sep 29 2014
vortex375
Nov 12 2011
hoderlump
Nov 05 2011
tobaj
Oct 18 2011
jenzuslongus
Aug 03 2011
dyn0saur
Jun 03 2011
Naraku
Apr 16 2011
m00nraker
Mar 22 2011
terwarf
Mar 09 2011
FollowByWhiteRabbit
Mar 02 2011
nsaibot
Feb 16 2011
flanello
Feb 06 2011
rgreinhofer
Feb 04 2011
EliasP
Jan 19 2011
thecrazyzorro
Oct 30 2010
eikel
Jul 29 2010
rickdesantis
Jun 13 2010
thomasjfedora
May 24 2010
elric80
May 13 2010
sadiqhuq
Apr 06 2010
Rerghar
Mar 30 2010
balevas01
Mar 19 2010
poelzi
Feb 25 2010
lordlukas
Feb 16 2010
dtritscher
Feb 14 2010
H1bakusha
Feb 10 2010
msledziona
Feb 07 2010
Bottom-Egg
Feb 05 2010
nicodietrich
Jan 21 2010
knilch
Jan 20 2010
markum
Jan 02 2010
smihael
Dec 30 2009
Kummerpaule
Sep 29 2009
dixiecko
Aug 14 2009
weatherman
Aug 09 2009
JanMalte
Aug 09 2009
Hantilles
Aug 05 2009
kovariadam
Jul 29 2009
lokdp
Jul 28 2009
EinfachToll
Jul 28 2009
AndiBauer
Jul 26 2009
takanowaka
Jul 25 2009
poppei82
Jul 18 2009
frankbrian25
Jul 13 2009
alvanx
Jul 10 2009
Boccaccio
Jul 05 2009
Podstavsky
Jul 03 2009
painkiller101
Jun 26 2009
vejha
Jun 23 2009
buschmann23
Jun 19 2009
gravy
Jun 18 2009
pano
Jun 18 2009
k3ks
Jun 17 2009
Finswimmer
Jun 17 2009
Frank
Jun 16 2009
dejazmach
Jun 16 2009
jalpaka
Jun 15 2009
radecz3k
Jun 15 2009
Vistausss
Jun 14 2009
ZdadrDeM
Jun 13 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.11 beta
updated Jan 17 2013
added Jun 03 2009
downloads 24h
0
mediaviews 24h 0
pageviews 24h 26