No project description provided
Project description
pygrocydm
Installation
pip install pygrocydm
Usage
Import the package:
from pygrocydm import GrocyDataManager
Obtain a grocy data manager instance:
gdm = GrocyDataManager("https://example.com", "GROCY_API_KEY")
or
gdm = GrocyDataManager("https://example.com", "GROCY_API_KEY", port = 9192, verify_ssl = True)
Product list :
products = gdm.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)
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.1.0.tar.gz
(5.8 kB
view hashes)
Built Distribution
pygrocydm-0.1.0-py3-none-any.whl
(10.1 kB
view hashes)
Close
Hashes for pygrocydm-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a857e7ecac10704d5f7236dff37492259dff1b5d76d59177704b020c1ff22449 |
|
MD5 | 8c6054aab364c30f94c6b1a1e1670af4 |
|
BLAKE2b-256 | 019bfc00ce111d3b0df577b3b5cf926651ee9f36d9c5d510346ce660564e166a |