Skip to main content

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'

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.12.1.tar.gz (17.8 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.12.1-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snap_http-1.12.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/7.0.0-28-generic

File hashes

Hashes for snap_http-1.12.1.tar.gz
Algorithm Hash digest
SHA256 75e3ea0bd14bbf6498af24935160525f82035fbd0b001a86ccc541de230f5a9c
MD5 3533fdcc35d107203e8b0857d54b585e
BLAKE2b-256 946b18772132cd28914a99847913daef9c0f44ecea8f999baf51c9c7bfc7dae0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: snap_http-1.12.1-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/7.0.0-28-generic

File hashes

Hashes for snap_http-1.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 972978c7e873beca9741a3ccc2e59c68b622fe5f2cf5c2bd7a49af3c0a04661a
MD5 97f7cfe4799890ddd6d88a4a9aff1512
BLAKE2b-256 7f9806e7e07676d3de4d38673f42afd9496088008e32334010bd512787a66cb3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.12.1 This release

2 files

1.12.0

2 files

1.11.0

2 files

1.10.1

2 files

1.10.0

2 files

1.9.0

2 files

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page