Skip to main content

Our Groceries Unofficial Python Package

Project description

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


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/*

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

ourgroceries-1.5.4.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

ourgroceries-1.5.4-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file ourgroceries-1.5.4.tar.gz.

File metadata

  • Download URL: ourgroceries-1.5.4.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for ourgroceries-1.5.4.tar.gz
Algorithm Hash digest
SHA256 37977ba07dc790054d8a3f8ec272e93192096d77654aec59a624990fdb7c9eeb
MD5 cf3ebf0bd18f0380050d5d19fda6316d
BLAKE2b-256 59f58c6d796fc487245a118113ffad24e843a383e96882bf1f8fad06e93e4b91

See more details on using hashes here.

File details

Details for the file ourgroceries-1.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for ourgroceries-1.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fc125c13ad0a4cb56d3d5ce34bcba557c1c565cbe8ae86d3d9dd61523c3d3d43
MD5 aec6c4c541cc499e98325df50ef98323
BLAKE2b-256 361b33a4f581734943852b72ef34d3001510644952eb0a56f3a0709315d4af9c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page