No project description provided
Project description
pygrocydm
Installation
pip install pygrocydm
Documentation
Check Grocy API
https://blueblueblob.github.io/pygrocydm/
Usage
Import the package:
from pygrocydm import GrocyAPI
Obtain a grocy data manager instance:
gapi = GrocyAPI("https://example.com", "GROCY_API_KEY")
or
gapi = GrocyAPI("https://example.com", "GROCY_API_KEY", port = 9192, verify_ssl = True)
Product list (Generic entities API)
products = gapi.generic_entities().products()
products_list = products.list
for product in products_list:
print(vars(product))
if product.name == "Cookies":
product.delete()
if product.name == "Chocolate":
data = {}
data['name'] = "Choco"
product.edit(data)
else:
new_product = {}
new_product['name'] = 'Cookies'
new_product['location_id'] = 1
new_product['qu_id_purchase'] = 1
new_product['qu_id_stock'] = 1
new_product['qu_factor_purchase_to_stock'] = 1
new_product_id = products.add(new_product)
Recipes API :
recipes_api = gapi.recipes()
for recipe in recipes_api.fullfilment_list:
if recipe.recipe_id == 5:
recipe.add_not_fulfilled_products_to_shoppinglist()
else:
recipe.consume()
recipes_api.refresh()
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pygrocydm-0.6.0.tar.gz
(13.2 kB
view hashes)
Built Distribution
pygrocydm-0.6.0-py3-none-any.whl
(25.3 kB
view hashes)
Close
Hashes for pygrocydm-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff076cb2fc9007166cb896faca9a4cb62d3eb3607edf8aec76a9338154c4ec30 |
|
MD5 | 7dfb435f521d42af98b27b475b578222 |
|
BLAKE2b-256 | b00eea4892010e1c8d3add9e2834f667ff9359d86f3eb097d4fa053a84576159 |