Skip to main content

Unofficial asyncio python wrapper for the Our Groceries API. This library requires Python >=3.5.

Installation

pip install ourgroceries

Usage

import asyncio
from ourgroceries import OurGroceries

username = ''
password = ''

og = OurGroceries(username, password)

loop = asyncio.get_event_loop()
loop.run_until_complete(og.login())

my_lists = loop.run_until_complete(og.get_my_lists())
print(my_lists)

my_todo_list = loop.run_until_complete(og.get_list_items(list_id=''))
print(my_todo_list)

Methods

def login()

Logs into our groceries


def get_my_lists()

Gets all of your lists


def get_category_items()

Gets all of your category items


def get_list_items(list_id)

Gets the items for a list


def create_list(name, list_type='SHOPPING')

Creates a new list. list_type can be 'RECIPES' or 'SHOPPING'


def create_category(name)

Create a new category


def toggle_item_crossed_off(list_id, item_id, cross_off=False)

Toggle a list item's crossed off property based on cross_off


def add_item_to_list(list_id, value, category="uncategorized", auto_category=False, note=None)

Adds a new item to a given list/category. Use auto_category instead of category to let Our Groceries apply the default category for this item.


async def add_items_to_list(self, list_id, items)

Adds several items to a given list. Use items to pass a sequence of items, each being just a value, or a tuple (value, category, note).


def remove_item_from_list(list_id, item_id)

Removes an item from a given list


def get_master_list()

Gets the master list


def get_category_list()

Gets the category list


def delete_list(list_id)

Deletes a list


def delete_all_crossed_off_from_list(list_id)

Deletes all crossed off items from a list


def add_item_to_master_list(value, category_id)

Adds an item to the master list


def change_item_on_list(list_id, item_id, category_id, value)

Changes an item on a list


def edit_items(list_id, edit_records)

Makes a sequence of edits to items on a single list. See make_delete_item_edit_record().


Exceptions

throws InvalidLoginException if can't login.

Development

prerequisites

python3 -m pip install --user --upgrade setuptools wheel
python3 -m pip install --user --upgrade twine

increment version in `setup.py`
delete build folder

python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*

OurGroceries is a registered trademark of OurGroceries, Inc. This project is not affiliated with, endorsed by, or supported by OurGroceries, Inc.

Metadata

Release files for ourgroceries 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ourgroceries 1.6.0
File Size Uploaded Provenance Actions
ourgroceries-1.6.0.tar.gz 6.1 kB Without provenance Details for ourgroceries-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ourgroceries 1.6.0
File Interpreter ABI Platform Actions
ourgroceries-1.6.0-py3-none-any.whl Python 3 none any Details for ourgroceries-1.6.0-py3-none-any.whl

Total release size: 12.4 kB

Release files / ourgroceries-1.6.0.tar.gz

Download URL ourgroceries-1.6.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
212c21d667b85d24d1c3ce06f14ad0d262cdffa53e968955121136cf56cff6e8
BLAKE2b-256 checksum
How to use checksums
8332095d05ceb4c85b41cfb6a7973d835dfc0b3377a82e7b8cce5071cc3022cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / ourgroceries-1.6.0-py3-none-any.whl

Download URL ourgroceries-1.6.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6462c7fbe744c5d106d3de9ffc1e0003d953f381239c33c3f19c13bba4d5b29
BLAKE2b-256 checksum
How to use checksums
e534936f69ddc1f0ba35872288c2364c82718ad918ced4b2b6f347986b6e6e35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for ourgroceries 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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