Skip to main content

No project description provided

Project description

pygrocydm

Build Status CodeFactor Coverage Status PyPI Automated Release Notes by gren DeepSource FOSSA Status

Installation

pip install pygrocydm

Documentation

Check Grocy API

https://blueblueblob.github.io/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)

License

FOSSA Status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pygrocydm, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size pygrocydm-0.5.0-py3-none-any.whl (33.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pygrocydm-0.5.0.tar.gz (15.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page