Automate your grocery shop.
Project description
autogroceries
autogroceries simplifies grocery shopping from Sainsbury's by using Playwright to automate the addition of ingredients to your basket.
Installation
I recommend using uv to manage the python version, virtual environment and autogroceries installation:
uv venv --python 3.13
source .venv/bin/activate
uv pip install autogroceries
# Install Chromium browser binary required for playwright.
playwright install chromium
Usage
autogroceries uses Playwright to interface with the Sainsbury's website, automatically filling your cart with an inputted list of ingredients.
The below demonstrates how to run autogroceries:
from autogroceries.shopper.sainsburys import SainsburysShopper
ingredients = {"milk": 1, "egg": 2}
# Store credentials securely e.g. in environment variables (use python-dotenv).
shopper = SainsburysShopper(
username=os.getenv("SAINSBURYS_USERNAME"),
password=os.getenv("SAINSBURYS_PASSWORD"),
)
shopper.shop(
{"cereal": 1, "tomatoes": 1, "lemon": 2, "salad": 1, "grapefruit": 3}
)
The video below demonstrates how Playwright automates grocery shopping when running the example code above:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autogroceries-2.0.0.tar.gz.
File metadata
- Download URL: autogroceries-2.0.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7815a11923f47e15a6f479a6204eb6463889cd349d18c6444f67b3243c7dd453
|
|
| MD5 |
a1f2176b105bd6874ea119aef5a2dcec
|
|
| BLAKE2b-256 |
1542bea0771eed07188bf8f0a3a0b9c2545885eb4df02a8d8d6d35cb0ffba577
|
Provenance
The following attestation bundles were made for autogroceries-2.0.0.tar.gz:
Publisher:
test_deploy.yml on dzhang32/autogroceries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
autogroceries-2.0.0.tar.gz -
Subject digest:
7815a11923f47e15a6f479a6204eb6463889cd349d18c6444f67b3243c7dd453 - Sigstore transparency entry: 482288060
- Sigstore integration time:
-
Permalink:
dzhang32/autogroceries@6912e52d320f59605da380e2fd70e14b050b3838 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/dzhang32
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test_deploy.yml@6912e52d320f59605da380e2fd70e14b050b3838 -
Trigger Event:
push
-
Statement type:
File details
Details for the file autogroceries-2.0.0-py3-none-any.whl.
File metadata
- Download URL: autogroceries-2.0.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ccc61d5fe0f544d8f5c05ccdd3b3781345e2da9f5eacfd2b5690e85466953fd
|
|
| MD5 |
7b7ee4d0128fc390ad2a3c77ce36a88e
|
|
| BLAKE2b-256 |
eb9a1bb8e8669e8ca3c73f50349e5cced354e839e709c9dd9cc4002f6119412c
|
Provenance
The following attestation bundles were made for autogroceries-2.0.0-py3-none-any.whl:
Publisher:
test_deploy.yml on dzhang32/autogroceries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
autogroceries-2.0.0-py3-none-any.whl -
Subject digest:
4ccc61d5fe0f544d8f5c05ccdd3b3781345e2da9f5eacfd2b5690e85466953fd - Sigstore transparency entry: 482288069
- Sigstore integration time:
-
Permalink:
dzhang32/autogroceries@6912e52d320f59605da380e2fd70e14b050b3838 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/dzhang32
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test_deploy.yml@6912e52d320f59605da380e2fd70e14b050b3838 -
Trigger Event:
push
-
Statement type: