The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Sailfish/Python Development

From Mer Wiki
< Sailfish(Difference between revisions)
Jump to: navigation, search
m
(Publishing)
 
(33 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Python 2.7 is provided in the "jolla" repository, and can be installed using [[pkcon]]:
+
= Python 2 =
 +
 
 +
Python 2.7.5 is provided in the "jolla" repository, and can be installed using [[pkcon]]:
  
 
: <code>pkcon install python</code>
 
: <code>pkcon install python</code>
  
 +
== Python 2.7 Modules ==
 +
 +
In default Jolla repositories, the modules below can be used as dependencies :
 +
 +
<nowiki>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</nowiki>
 +
 +
In [http://talk.maemo.org/showthread.php?t=92036 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 :
 +
 +
<nowiki>pygpgme, python-cheetah, python-initparse, python-markdown, python-pycurl, python-pygments, python-urlgrabber, python-zypp</nowiki>
 +
 +
The community Python modules/packages can't be used as dependencies :
 +
 +
* [https://build.merproject.org/project/show/mer-tools:devel mer-tools:devel] :
 +
<nowiki>pygpgme, python-cheetah, python-docutils, python-imaging, python-initparse, python-jinja2, python-markdown, python-markupsafe, python-pycurl, python-pygments, python-sphinx, python-urlgrabber</nowiki>
 +
 +
* [https://build.merproject.org/project/show/home:lbt lbt Mer project] :
 +
<nowiki>python-docutils, python-imaging, python-jinja2, python-markupsafe, python-pygments, python-sphinx</nowiki>
 +
 +
* [https://build.merproject.org/project/show/home:MartinK:sailfish MartinK Sailfish Mer project] :
 +
<nowiki>python-beautifulsoup, python-coverage, python-cython, python-distribute, python-pip, python-pycurl, python-urlgrabber</nowiki>
 +
 +
* [https://build.merproject.org/project/show/home:MartinK:sailfish:geo MartinK Sailfish Geo Mer project] :
 +
<nowiki>python-htmltmpl, python-pycsw</nowiki>
 +
 +
* [https://build.merproject.org/project/show/home:mkosola mkosola Mer project] :
 +
<nowiki>python-beaker, python-mako, python-markupsafe, python-numpy</nowiki>
 +
 +
* [https://build.merproject.org/project/show/home:rcolistete rcolistete Mer project] :
 +
<nowiki>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</nowiki>
 +
 +
* OpenRepos.net repositories :
 +
[https://openrepos.net/content/sailfishlib/mutagen mutagen], [https://openrepos.net/content/nieldk/postgresql-plpython postgresql-plpython], [https://openrepos.net/content/sailfishlib/python-gstreamer python-gstreamer], [https://openrepos.net/content/sailfishlib/sip python-sip]
  
 
= Python 3 =
 
= Python 3 =
Python 3.3 is provided in the [https://github.com/mer-python3/ mer-python3] repository. This can be added using [[ssu]], and then installed using [[pkcon]]:
 
  
: <code>ssu addrepo mer-python3 <nowiki>http://repo.merproject.org/obs/mer-python3/latest_armv7hl/</nowiki></code>
+
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.
: <code>ssu updaterepos</code>
+
 
: <code>pkcon refresh mer-python3</code>
+
 
: <code>pkcon install python3-base</code>
 
: <code>pkcon install python3-base</code>
  
 +
== Python 3 Modules ==
 +
 +
The community Python modules/packages can't be used as dependencies :
 +
 +
* [https://build.merproject.org/project/show/nemo:devel:mw Nemo:devel MW Mer project] :
 +
<nowiki>dbus-python3, python3-cairo, python3-gobject</nowiki>
 +
 +
* [https://build.merproject.org/project/show/home:MartinK:sailfish MartinK Sailfish Mer project] :
 +
<nowiki>dbus-python3, python3-lxml</nowiki>
 +
 +
* [https://build.merproject.org/project/show/home:rcolistete rcolistete Mer project] :
 +
<nowiki>python3-sympy, python3-uncertainties</nowiki>
 +
 +
* [https://build.merproject.org/project/show/home:thp:gpodder thp:gpodder Mer project] :
 +
<nowiki>python3-requests</nowiki>
 +
 +
* OpenRepos.net repositories :
 +
[https://openrepos.net/content/nodevel/python3-setuptools python3-setuptools], [https://openrepos.net/content/sailfishlib/python-sip python-sip]
  
 
= Python and Qt 5 =
 
= Python and Qt 5 =
  
There are currently two options for developing Python Qt 5 apps on Sailfish OS: [[#PyOtherSide|PyOtherSide]] and [[#PyQt|PyQt]]. PySide does not currently support Qt5.
+
There are different options for developing Python Qt 5 apps on Sailfish OS:
  
 +
* [[#PyOtherSide|PyOtherSide]]: In official repositories, supports Qt 5 and Python 3. It is supported in Jolla Harbour Store since January 7th 2015.
 +
* [[#PyQt|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 ==
+
== PyOtherSide (POS) ==
 
[http://thp.io/2011/pyotherside/ PyOtherSide homepage] | [https://github.com/thp/pyotherside PyOtherSide on github]
 
[http://thp.io/2011/pyotherside/ PyOtherSide homepage] | [https://github.com/thp/pyotherside PyOtherSide on github]
  
* Requires Python 3.
+
Starting with Sailfish OS 1.0.3.8, PyOtherSide is now available in the official repos.
* Available in <code>mer-python3</code> repo.
+
* Will be supported in [[Jolla Harbour]] "soon" <ref>[https://harbour.jolla.com/faq Jolla Harbour FAQ]</ref><ref>[http://www.merproject.org/logs/%23nemomobile/%23nemomobile.2013-12-03.log.html#t2013-12-03T12:50:26 thp discusses PyOtherSide and Jolla Harbour]</ref>.
+
  
 +
* It is supported in Jolla Harbour Store since January 7th 2015, see [https://together.jolla.com/question/6116/python-application-support-in-jolla-store-harbour/?answer=23476#post-id-23476 "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]]:
  
After adding the [[#Python 3|mer-python3 repo]], the PyOtherSide QML plugin can be installed using [[pkcon]]:
 
 
: <code>pkcon install pyotherside-qml-plugin-python3-qt5</code>
 
: <code>pkcon install pyotherside-qml-plugin-python3-qt5</code>
 
  
 
== PyQt ==
 
== PyQt ==
Line 37: Line 91:
  
  
PyQt can be installed by adding the [https://openrepos.net/user/876/repository sailfish_libs repo]:
+
PyQt can be installed by adding the [https://openrepos.net/user/876/repository sailfish_lib repo]:
: <code>ssu addrepo sailfish_libs <nowiki>http://sailfish.openrepos.net/sailfish_lib/personal/main</nowiki></code>
+
: <code>ssu addrepo sailfish_lib <nowiki>http://sailfish.openrepos.net/sailfish_lib/personal/main</nowiki></code>
 
: <code>ssu updaterepos</code>
 
: <code>ssu updaterepos</code>
: <code>pkcon refresh sailfish_libs</code>
+
: <code>pkcon refresh sailfish_lib</code>
 +
 
 +
For Python 2:
 
: <code>pkcon install pyqt</code>
 
: <code>pkcon install pyqt</code>
  
 +
For Python 3:
 +
: <code>pkcon install python-pyqt</code>
 +
 +
== POS vs PyQt ==
 +
 +
=== 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 [http://www.riverbankcomputing.co.uk/software/pyqt/license 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 :
 +
* [https://openrepos.net/content/gscrul3z/defaultpasswords DefaultPasswords ] - search default passwords for devices and software [https://github.com/GsCRuL3Z/DefaultPasswords (GitHub)]
 +
* [https://openrepos.net/content/rcolistete/derivative-sailfish-os Derivative] - calculates mathematical derivatives [https://github.com/rcolistete/derivative-sailfish (GitHub)]
 +
* [https://openrepos.net/content/thp/gpodder gPodder] - downloads and manages podcasts [https://github.com/gpodder/gpodder-sailfish (GitHub)]
 +
* [https://openrepos.net/content/otsaloma/helsinki-transit-live Helsinki Transit Live] - Real-time locations of Helsinki Region Transport (HSL) public transportation vehicles [https://github.com/otsaloma/helsinki-transit-live (GitHub)]
 +
* [https://openrepos.net/content/rcolistete/integral-sailfish-os Integral] - calculates mathematical integrals [https://github.com/rcolistete/integral-sailfish (GitHub)]
 +
* [https://openrepos.net/content/rcolistete/limit-sailfish-os Limit] - calculates mathematical limits [https://github.com/rcolistete/limit-sailfish (GitHub)]
 +
* [https://openrepos.net/content/martink/modrana-0 Modrana] - flexible GPS navigation system for mobile Linux devices [https://github.com/M4rtinK/modrana (GitHub)]
 +
* [https://openrepos.net/content/mattaustin/perth-trains-0 Perth Trains] - Perth trains live departure information app [https://github.com/mattaustin/fremantleline (GitHub)]
 +
* [https://openrepos.net/content/khertan/ownnotes-sailfishos ownNotes] - A markdown notes taking application with ownCloud/WebDav synchronization [https://github.com/khertan/ownNotes (GitHub)]
 +
* [https://openrepos.net/content/otsaloma/poor-maps Poor Maps] - application for Sailfish OS to display tiled maps (e.g. OpenStreetMap), places and routes [https://github.com/otsaloma/poor-maps (GitHub)]
 +
* [https://openrepos.net/content/solbrit/preyui PreyUI] - User interface for NielDK's SailfishOS Prey client
 +
* [https://openrepos.net/content/emanymton/sailsenso SailSenso] - A little game of memory skill based on an electronic game called Simon/Senso back in the 80s
 +
* [https://github.com/kelvan/sailtoVienna sailtoVienna (GitHub)] Wienerlinien departure app
 +
* [https://openrepos.net/content/roboro/thesessionfinder TheSessionFinder] - allows you to search for traditional session music on thesession.org and to store favourites in a local database [https://github.com/goroboro/TheSessionFinder (GitHub)]
 +
Using PyQt :
 +
* [https://openrepos.net/content/xerxes2/panucci Panucci] - audiobook and podcast player [https://github.com/xerxes2/panucci (GitHub)]
  
 
= Links =
 
= Links =

Latest revision as of 18:48, 10 January 2015

Contents

[edit] Python 2

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

pkcon install python

[edit] 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

python-docutils, python-imaging, python-jinja2, python-markupsafe, python-pygments, python-sphinx

python-beautifulsoup, python-coverage, python-cython, python-distribute, python-pip, python-pycurl, python-urlgrabber

python-htmltmpl, python-pycsw

python-beaker, python-mako, python-markupsafe, python-numpy

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

  • OpenRepos.net repositories :

mutagen, postgresql-plpython, python-gstreamer, python-sip

[edit] 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.

pkcon install python3-base

[edit] Python 3 Modules

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

dbus-python3, python3-cairo, python3-gobject

dbus-python3, python3-lxml

python3-sympy, python3-uncertainties

python3-requests

  • OpenRepos.net repositories :

python3-setuptools, python-sip

[edit] 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.

[edit] PyOtherSide (POS)

PyOtherSide homepage | PyOtherSide on github

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

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

pkcon install pyotherside-qml-plugin-python3-qt5

[edit] PyQt

PyQt homepage | PyQt for Sailfish OS on OpenRepos.net


PyQt can be installed by adding the sailfish_lib repo:

ssu addrepo sailfish_lib http://sailfish.openrepos.net/sailfish_lib/personal/main
ssu updaterepos
pkcon refresh sailfish_lib

For Python 2:

pkcon install pyqt

For Python 3:

pkcon install python-pyqt

[edit] POS vs PyQt

[edit] 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.

[edit] 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.

[edit] 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.

[edit] Software

Using PyOtherSide :

Using PyQt :

[edit] Links


  1. TMO: xerxes2 packages PyQt for Sailfish OS
Personal tools