Skip to main content

A library for interacting with snapd via its REST API.

Project description

snap-http

check

snap-http is a Python library used to interact with snapd's REST API, allowing you to programmatically install and manage snaps in your Python applications. It has no dependencies other than Python 3.8 or higher.

Installation

pip install snap-http

Usage

Take a look at the api module to see what methods are available. Here's a couple examples:

List installed snaps

>>> import snap_http
>>> response = snap_http.list()
>>> for snap in response.result:
...     print(snap["name"])
juju
snapd
core20
snapcraft
snap-store
<etc>

Install a snap

Most actual changes to snaps happen asynchronously, so you need to check back on the change using the change ID if you want to know the final result.

N.B.: installation may require root permissions.

>>> import snap_http
>>> response = snap_http.install("hello")
>>> response
SnapdResponse(type='async', status_code=202, status='Accepted', result=None, sources=None, change='1395')
>>> response = snap_http.check_change(response.change)
>>> response.result["status"]
'Done'

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_http-1.11.0.tar.gz (16.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_http-1.11.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file snap_http-1.11.0.tar.gz.

File metadata

  • Download URL: snap_http-1.11.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.14.0-1018-oem

File hashes

Hashes for snap_http-1.11.0.tar.gz
Algorithm Hash digest
SHA256 ee9afbe38e53c242cd7970ebda6f79fcad517998d79bae50ad24ff6b357f4965
MD5 2aaf0013e0664c5a76606b836b86e34c
BLAKE2b-256 830b97fa751d236936dbb4cfc227e04c677fee110e824ce623ed382b7e66caea

See more details on using hashes here.

File details

Details for the file snap_http-1.11.0-py3-none-any.whl.

File metadata

  • Download URL: snap_http-1.11.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.14.0-1018-oem

File hashes

Hashes for snap_http-1.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 856afe2de663673104e4a431ea175c84fb342deb88003157541f3f4d4a336645
MD5 ab0995a83325180777b1c28a45e92935
BLAKE2b-256 c38ae17a649f9d75514877b641c9ddb8414d1dcd9cfffc6bdb8ce361a810c733

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