Announcing snapd-glib

Robert Ancell robert.ancell at canonical.com
Fri Aug 19 02:33:04 UTC 2016


Hi all,

At the Heidelberg sprint we decided to create a library that would allow
GLib based projects to more easily access snapd and reduce duplication
across these projects.

I've got the first cut of this done, meet snapd-glib!

- On Launchpad [1]
- Implements all [2] of the snapd REST API [3].
- Provides both synchronous and asynchronous methods
- Supports GObject introspection (i.e. Python etc support)
- Supports Vala.
- Will support Qt/QML in the future [4].
- Uploaded to Ubuntu Yakkety, will be there once it is accepted into the
NEW queue. Use the libsnapd-glib-dev or gir1.2-snapd-0 packages.
- Currently using so version number 0 - ABI is not guaranteed to be stable
until we go to 1.
- Will SRU to Ubuntu 14.04 once the API/ABI is stable.

Here's a taste of the API:

#!/usr/bin/python

import gi

gi.require_version ('Snapd', '0')
from gi.repository import Snapd

c = Snapd.Client ()
c.connect_sync ()
snaps = c.list_sync ()
for s in snaps:
    print s.get_name () + ' ' + s.get_version ()

Happy Hacking! (And patches welcome).

--Robert

[1] http://launchpad.net/snapd-glib
[2] OK, just the main stuff and what I was able to get to work. But the
goal is to access everything there.
[3] https://github.com/snapcore/snapd/blob/master/docs/rest.md
[4] https://bugs.launchpad.net/bugs/1614797
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160819/ae5a6fdc/attachment.html>


More information about the Snapcraft mailing list