Metadata-Version: 2.5
Name: safeway-coupons
Version: 0.14.0
Summary: Automatic coupon clipper for Safeway and other Albertsons brands' online "for U" coupons
Project-URL: Homepage, https://smkent.github.io/safeway-coupons
Project-URL: Repository, https://github.com/smkent/safeway-coupons
Project-URL: Issues, https://github.com/smkent/safeway-coupons/issues
Author-email: Stephen Kent <smkent@smkent.net>
License-Expression: GPL-3.0-or-later
License-File: COPYING
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: filelock>=4
Requires-Dist: patchright>=1.62
Requires-Dist: platformdirs>=4.14
Requires-Dist: pydantic>=2.14
Requires-Dist: requests
Requires-Dist: rich>=15
Requires-Dist: tomlkit>=0.15
Requires-Dist: typer>=0.27
Description-Content-Type: text/markdown

# safeway-coupons

Automatic coupon clipper for Safeway and other Albertsons brands' online "for U" coupons

[![License](https://img.shields.io/github/license/smkent/safeway-coupons)](https://github.com/smkent/safeway-coupons/blob/main/COPYING)
[![PyPI](https://img.shields.io/pypi/v/safeway-coupons)](https://pypi.org/project/safeway-coupons/)
[![Python](https://img.shields.io/pypi/pyversions/safeway-coupons)](https://pypi.org/project/safeway-coupons/)
[![CI](https://github.com/smkent/safeway-coupons/actions/workflows/ci.yaml/badge.svg)](https://github.com/smkent/safeway-coupons/actions/workflows/ci.yaml)
[![Coverage](https://codecov.io/gh/smkent/safeway-coupons/branch/main/graph/badge.svg)](https://codecov.io/gh/smkent/safeway-coupons)
[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen?logo=renovatebot)](https://renovatebot.com)
[![GitHub stars](https://img.shields.io/github/stars/smkent/safeway-coupons?style=social)](https://github.com/smkent/safeway-coupons)

**safeway-coupons** is a tool that will log in to an Albertsons brand store
account (such as Safeway), and attempt to select all of the "for U" electronic
coupons on the site so they don't have to each be clicked manually.

**[See the documentation site for full project details!][docs]**

## Supported store brands

The web sites for all Albertsons brands (including Safeway) use the same
platform, so coupon clipping works the same way on each. safeway-coupons
supports the following Albertsons brands:

[Acme](https://acmemarkets.com),
[Albertsons Market](https://shopalbertsonsmarket.com),
[Albertsons](https://albertsons.com),
[Amigos](https://shopamigos.com),
[Andronico's](https://andronicos.com),
[Balducci's](https://balduccis.com),
[Carrs](https://carrsqc.com),
[Haggen](https://haggen.com),
[Jewel-Osco](https://jewelosco.com),
[Kings](https://kingsfoodmarkets.com),
[Market Street](https://shopmarketstreet.com),
[Pavilions](https://pavilions.com),
[Randalls](https://randalls.com),
[Safeway](https://safeway.com),
[Shaw's](https://shaws.com),
[Star Market](https://starmarket.com),
[Tom Thumb](https://tomthumb.com),
[United Supermarkets](https://shopunitedsupermarkets.com),
[Vons](https://vons.com)

## Quick start

### PyPI package

Ensure [Google Chrome][google-chrome] is installed.

Install with [`uv`][uv-tool] or [`pipx`][pipx]:

```sh
uv tool install safeway-coupons
```

```sh
pipx install safeway-coupons
```

Configure a store account (`account-name` is a label you choose, such as `main`
or `test`):

```sh
safeway-coupons accounts add safeway account-name my.account.email@example.com
```

Sign in interactively, using a multi-factor authentication (MFA) code if
prompted:

```sh
safeway-coupons --login-only
```

Clip all coupons:

```sh
safeway-coupons
```

### Docker Compose

Set up Docker Compose using the [sample `compose.yaml`][repo-compose-yaml].

Configure a store account (`account-name` is a label you choose, such as `main`
or `test`):

```sh
docker compose run --rm safeway-coupons accounts add safeway account-name my.account.email@example.com
```

Sign in interactively, using a multi-factor authentication (MFA) code if
prompted:

```sh
docker compose run --rm safeway-coupons --login-only
```

Start the service to clip coupons on a schedule:

```sh
docker compose up -d
```

When run with no arguments, the container runs the service to clip coupons on a
schedule. To clip all coupons on demand, run with at least one argument (such as
`-n`/`--no-notify`):

```sh
docker compose run --rm safeway-coupons --no-notify
```

### Further information

**[See the documentation site for full project details!][docs]**

## Design notes

[Google Chrome][google-chrome] is used to complete the sign in process. To
reduce how often sign in prompts for multi-factor authentication (MFA)
verification codes, a persistent browser profile directory is created for each
configured store account and is reused for logins with the same account.

Once a signed in session is established, coupon clipping is performed using HTTP
requests via [requests][requests].

The store sign in page is protected by a web application firewall (WAF). Sign in
may fail based on your IP's reputation, either by presenting an interactive
challenge (such as a captcha) or denying sign in attempts altogether.
safeway-coupons can't complete these interactive challenges.

## License

Copyright (C) 2012 Stephen Kent and contributors

Licensed under the GNU General Public License v3.0 or later
([`GPL-3.0-or-later`](https://github.com/smkent/safeway-coupons/blob/main/COPYING)).

## Project template

This project is based on and maintained with [copier-project][copier-project].

[copier-project]: https://smkent.github.io/copier-project
[docs]: https://smkent.github.io/safeway-coupons/
[google-chrome]: https://www.google.com/chrome/
[pipx]: https://pipx.pypa.io
[repo-compose-yaml]: https://github.com/smkent/safeway-coupons/blob/main/compose.yaml
[requests]: https://requests.readthedocs.io/en/latest/
[uv-tool]: https://docs.astral.sh/uv/guides/tools/
