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.1.tar.gz (14.4 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.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snap_python-0.1.1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.8 Linux/6.8.0-1020-azure

File hashes

Hashes for snap_python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9988177c41e45424974515a2edd6ae0eec6e0c861b72a9d8f283f3cce4f58ac0
MD5 3803dc7f34854cadb6559537b6911773
BLAKE2b-256 a69352d44b00b4f3756e95283054de9eba6bfc8e49b45f1be1695c8534d148ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: snap_python-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.8 Linux/6.8.0-1020-azure

File hashes

Hashes for snap_python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5644c23b32efa914023ec34c6205de802f42fa0bb8c2d9b5a265aba0fcb58ee2
MD5 12387f31d6a6de4daf1a6c8b3b074860
BLAKE2b-256 4ed5e8c1d96bb51cad4ec43a2b269059d3636b79fac956363e1ab66c82e4e56c

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