1
0
Fork
You've already forked libssa
0
Sainsbury's SmartShop Python lib
  • Python 100%
Find a file
2025年11月03日 16:21:02 +00:00
libssa shop: remove Shop.items(), it was never actually in the API 2025年11月03日 16:21:02 +00:00
.gitignore Remove repetition in the Shop class; Add more endpoints; Fix imports 2025年08月11日 02:42:18 +01:00
LICENSE commit message 2025年11月01日 04:16:38 +00:00
pyproject.toml commit message 2025年11月01日 04:16:38 +00:00
README.md readme tweak 2025年11月01日 04:23:05 +00:00

libssa

Python wrapper for the Sainsbury's SmartShop API.

WARNING: This is influenced by decompiled code from the app. Especially the Client.basic_auth() method (you'd need the app to figure out that thing anyway). If you don't like any implications of that, avoid!

Not sure if it matters, but just so you know.

Installation

pip install git+https://codeberg.org/plate/libssa

Usage

Use the Client class:

from libssa.client import Client
c = Client()

This defaults to the Android client. You can also supply a custom client ID and key (likely not needed):

from libssa import constants
c = Client(client_id=constants.HANDSET_CLIENT_ID, rsa_key=constants.HANDSET_KEY)
c = Client(client_id="ss_whatever_mobile_1k", rsa_key="-----BEGIN RSA PUBLIC KEY-----...")

Then you can log in as needed:

c.login_nectar("12345678900") # last 11 digits: 9623000 12345678900

Starting a shop returns a Shop (libssa.shop.Shop) object:

s = c.create_shop("1234") # start shopping at your store id
s.add_item("123456", 10) # add 10 of this item
s.finish() # finish the shop
s.move_to_pos("12") # send it to POS 12

When a request fails, you want to catch libssa.errors.RequestError, which has the status_code and content properties.