Grocy Client¶
The Grocy class is the main entry point for the library. It wraps the low-level API client and returns rich data model objects.
Usage¶
Class Reference¶
Grocy(base_url, api_key, port=DEFAULT_PORT_NUMBER, path=None, verify_ssl=True, debug=False)
¶
Bases: object
stock()
¶
expiring_products(get_details=False)
¶
due_products(get_details=False)
¶
overdue_products(get_details=False)
¶
expired_products(get_details=False)
¶
missing_products(get_details=False)
¶
product(product_id)
¶
product_by_barcode(barcode)
¶
all_products()
¶
chores(get_details=False, query_filters=None)
¶
execute_chore(chore_id, done_by=None, tracked_time=None, skipped=False)
¶
chore(chore_id)
¶
add_product(product_id, amount, price, best_before_date=None, transaction_type=TransactionType.PURCHASE)
¶
consume_product(product_id, amount=1, spoiled=False, transaction_type=TransactionType.CONSUME, allow_subproduct_substitution=False)
¶
consume_recipe(recipe_id)
¶
open_product(product_id, amount=1, allow_subproduct_substitution=False)
¶
inventory_product(product_id, new_amount, best_before_date=None, shopping_location_id=None, location_id=None, price=None, get_details=True)
¶
add_product_by_barcode(barcode, amount, price, best_before_date=None, get_details=True)
¶
consume_product_by_barcode(barcode, amount=1, spoiled=False, get_details=True)
¶
inventory_product_by_barcode(barcode, new_amount, best_before_date=None, location_id=None, price=None, get_details=True)
¶
shopping_list(get_details=False, query_filters=None)
¶
add_missing_product_to_shopping_list(shopping_list_id=1)
¶
add_product_to_shopping_list(product_id, shopping_list_id=None, amount=None, quantity_unit_id=None)
¶
clear_shopping_list(shopping_list_id=1)
¶
remove_product_in_shopping_list(product_id, shopping_list_id=1, amount=1)
¶
product_groups(query_filters=None)
¶
add_product_pic(product_id, pic_path)
¶
get_userfields(entity, object_id)
¶
set_userfields(entity, object_id, key, value)
¶
get_last_db_changed()
¶
get_system_info()
¶
get_system_time()
¶
get_system_config()
¶
tasks(query_filters=None)
¶
task(task_id)
¶
complete_task(task_id, done_time=None)
¶
meal_plan(get_details=False, query_filters=None)
¶
recipe(recipe_id)
¶
batteries(query_filters=None, get_details=False)
¶
battery(battery_id)
¶
charge_battery(battery_id, tracked_time=None)
¶
add_generic(entity_type, data)
¶
get_generic(entity_type, object_id)
¶
update_generic(entity_type, object_id, updated_data)
¶
delete_generic(entity_type, object_id)
¶
get_generic_objects_for_type(entity_type, query_filters=None)
¶
meal_plan_sections(query_filters=None)
¶
meal_plan_section(meal_plan_section_id)
¶
users()
¶
user(user_id=None)
¶
equipment(query_filters=None, get_details=False)
¶
Return a list of equipment items.
get_equipment(equipment_id)
¶
Return a single equipment item by ID.
get_equipment_by_name(name)
¶
Return a single equipment item by name.
get_all_equipment_objects()
¶
Return all equipment objects with full details.