Skip to main content

Automate your grocery shop.

Project description

autogroceries

test_deploy pypi

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:

Your browser does not support the video tag.

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

autogroceries-2.0.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autogroceries-2.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

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

Hashes for autogroceries-2.0.0.tar.gz
Algorithm Hash digest
SHA256 7815a11923f47e15a6f479a6204eb6463889cd349d18c6444f67b3243c7dd453
MD5 a1f2176b105bd6874ea119aef5a2dcec
BLAKE2b-256 1542bea0771eed07188bf8f0a3a0b9c2545885eb4df02a8d8d6d35cb0ffba577

See more details on using hashes here.

Provenance

The following attestation bundles were made for autogroceries-2.0.0.tar.gz:

Publisher: test_deploy.yml on dzhang32/autogroceries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for autogroceries-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ccc61d5fe0f544d8f5c05ccdd3b3781345e2da9f5eacfd2b5690e85466953fd
MD5 7b7ee4d0128fc390ad2a3c77ce36a88e
BLAKE2b-256 eb9a1bb8e8669e8ca3c73f50349e5cced354e839e709c9dd9cc4002f6119412c

See more details on using hashes here.

Provenance

The following attestation bundles were made for autogroceries-2.0.0-py3-none-any.whl:

Publisher: test_deploy.yml on dzhang32/autogroceries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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