Skip to main content

Interact with snapd and snapstore(s) from Python

Project description

snap-python

snap-python provides an API client to interact with snapd

Click here to read the documentation

Installation

To install snap-python, you can use pip:

pip install snap-python

Usage

Here is a simple example of how to use snap-python:

# uses asyncio, must be run in an event loop
>>> import asyncio
>>> from snap_python.client import SnapClient
>>> sc = SnapClient()
>>> installed_snaps = asyncio.run(sc.snaps.list_installed_snaps())
>>> [snap.name for snap in installed_snaps.result]
[..., 'vlc', 'snapcraft', 'firefox', 'store-tui', 'gtk-common-themes', 'thunderbird', ...]

Get details for installed snap vlc

# uses asyncio, must be run in an event loop
>>> import asyncio
>>> from snap_python.client import SnapClient
>>> sc = SnapClient()
>>> vlc_snap = asyncio.run(sc.snaps.get_snap_info("vlc"))
>>> vlc_snap.result.version
'3.0.20-1-g2617de71b6'

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snap_python-0.1.3.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snap_python-0.1.3-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file snap_python-0.1.3.tar.gz.

File metadata

  • Download URL: snap_python-0.1.3.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.9 Linux/6.8.0-1021-azure

File hashes

Hashes for snap_python-0.1.3.tar.gz
Algorithm Hash digest
SHA256 04219fa45294a5bef9b646bcb6bfa568da76f868d4a3b9867faaa99b3d2ec63e
MD5 2b4444808ab7dbd1576074f3e914a7ce
BLAKE2b-256 caf5e4f77626fa0815e2e68f87109fb97f7b79dc87bbe10e045867408cdd2a6d

See more details on using hashes here.

File details

Details for the file snap_python-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: snap_python-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.9 Linux/6.8.0-1021-azure

File hashes

Hashes for snap_python-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 949f30fb705cbedc2e85b0d5500f07cb4af3b38759886de865feeeaa4df19209
MD5 603076c19346ba1629b1341fd4b3398e
BLAKE2b-256 a06cdcf38450f1298c1ad9610c2e2ebd793d6c5216611f84b3edb3f7869d8127

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page