Sailfish/Python Development

= Python 2 =

Python 2.7.5 is provided in the "jolla" repository, and can be installed using pkcon:



Python 2.7 Modules
In default Jolla repositories, the modules below can be used as dependencies :

boost-python, dbus-python, libiptcdata-python, libuser-python, libxml2-python, libxslt-python, PackageKit-python, pacrunner-python, pygobject2, pyOpenSSL, python-M2Crypto, python-cairo, python-deltarpm, python-giscanner, python-imaging, python-lcms, python-lxml, python-magic, python-markdown, python-setuptools, python-sip, python-solve, python-tools, python-twisted, python-yaml, python-zope-interface, rpm-python

In mer-tools Jolla repository (which can be enabled), but consider that the majority of users will not enable it, so the modules below can't be used as dependencies :

pygpgme, python-cheetah, python-initparse, python-markdown, python-pycurl, python-pygments, python-urlgrabber, python-zypp

The community Python modules/packages can't be used as dependencies :

pygpgme, python-cheetah, python-docutils, python-imaging, python-initparse, python-jinja2, python-markdown, python-markupsafe, python-pycurl, python-pygments, python-sphinx, python-urlgrabber
 * mer-tools:devel :

python-docutils, python-imaging, python-jinja2, python-markupsafe, python-pygments, python-sphinx
 * lbt Mer project :

python-beautifulsoup, python-coverage, python-cython, python-distribute, python-pip, python-pycurl, python-urlgrabber
 * MartinK Sailfish Mer project :

python-htmltmpl, python-pycsw
 * MartinK Sailfish Geo Mer project :

python-beaker, python-mako, python-markupsafe, python-numpy
 * mkosola Mer project :

ipython, python-dateutil, python-jinja2, python-markupsafe, python-matplotlib, python-numpy, python-pyparsing, python-pytz, python-pyzmq, python-six, python-sympy, python-tornado, python-uncertainties
 * rcolistete Mer project :

mutagen, postgresql-plpython, python-gstreamer, python-sip
 * OpenRepos.net repositories :

= Python 3 =

Starting with Sailfish OS 1.0.3.8, Python 3.3.3 and PyOtherSide are shipped in the official repositories. Currently there is Python 3.4.0.



Python 3 Modules
The community Python modules/packages can't be used as dependencies :

dbus-python3, python3-cairo, python3-gobject
 * Nemo:devel MW Mer project :

dbus-python3, python3-lxml
 * MartinK Sailfish Mer project :

python3-sympy, python3-uncertainties
 * rcolistete Mer project :

python3-requests
 * thp:gpodder Mer project :

python3-setuptools, python-sip
 * OpenRepos.net repositories :

= Python and Qt 5 =

There are different options for developing Python Qt 5 apps on Sailfish OS:


 * PyOtherSide: In official repositories, supports Qt 5 and Python 3. It is supported in Jolla Harbour Store since January 7th 2015.
 * PyQt: Available from OpenRepos.net, supports Qt 5.
 * PySide: Not in official repositories or OpenRepos, as it doesn't support Qt 5 yet. If you need PySide-style bindings, use PyQt.

PyOtherSide (POS)
PyOtherSide homepage | PyOtherSide on github

Starting with Sailfish OS 1.0.3.8, PyOtherSide is now available in the official repos.


 * It is supported in Jolla Harbour Store since January 7th 2015, see "Python application support in Jolla store (Harbour)" in together.jolla.com

The PyOtherSide QML plugin can be installed directly without adding any addition repos using pkcon:



PyQt
PyQt homepage | PyQt for Sailfish OS on OpenRepos.net


 * Available from OpenRepos.net.
 * Not supported in Jolla Harbour.

PyQt can be installed by adding the sailfish_lib repo:

For Python 2:

For Python 3:

Coding
POS is a QML plugin which means that you'll have to start your program from a few lines of C++ code and from your QML code you import the POS plugin and from there you import your Python modules. PyQt basically is a 1:1 glue layer for the Qt C++ API so you just use it as you would use any other Python module. If all you need from Qt is QML then you could happily stick to POS, if you need more than that then you would need to use PyQt.

License
POS is distributed under non copy-left conditions which means that your code could use any license you like. PyQt is distributed under the GPLv3 license so your code must use that license too or buy a commercial license from Riverbank Computing.

Publishing
POS applications you can publish on Openrepos without having to deal with third party repos. And Harbour is accepting POS apps since January 7th 2015. PyQt will probably never be accepted in Harbour so Openrepos is your only option for now.

= Software = Using PyOtherSide : Using PyQt :
 * DefaultPasswords - search default passwords for devices and software (GitHub)
 * Derivative - calculates mathematical derivatives (GitHub)
 * gPodder - downloads and manages podcasts (GitHub)
 * Helsinki Transit Live - Real-time locations of Helsinki Region Transport (HSL) public transportation vehicles (GitHub)
 * Integral - calculates mathematical integrals (GitHub)
 * Limit - calculates mathematical limits (GitHub)
 * Modrana - flexible GPS navigation system for mobile Linux devices (GitHub)
 * Perth Trains - Perth trains live departure information app (GitHub)
 * ownNotes - A markdown notes taking application with ownCloud/WebDav synchronization (GitHub)
 * Poor Maps - application for Sailfish OS to display tiled maps (e.g. OpenStreetMap), places and routes (GitHub)
 * PreyUI - User interface for NielDK's SailfishOS Prey client
 * SailSenso - A little game of memory skill based on an electronic game called Simon/Senso back in the 80s
 * sailtoVienna (GitHub) Wienerlinien departure app
 * TheSessionFinder - allows you to search for traditional session music on thesession.org and to store favourites in a local database (GitHub)
 * Panucci - audiobook and podcast player (GitHub)

= Links =
 * Python & Qt5 on Sailfish thread on TMO
 * Python & Qt5 discussion of SailfishDevel mailing list