isabellaalstrom / pygrocy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pygrocy

Development Build Status PyPI Coverage Status CodeFactor FOSSA Status

Documentation

Installation

pip install pygrocy

Usage

Import the package:

from pygrocy import Grocy

Obtain a grocy instance:

grocy = Grocy("https://example.com", "GROCY_API_KEY")

or

grocy = Grocy("https://example.com", "GROCY_API_KEY", port = 9192, verify_ssl = True)

Get current stock:

for entry in grocy.stock():
    print("{} in stock for product id {}".format(entry.id, entry.amount))

Development testing

You need a Grocy instance running in demo mode at localhost with https (docker or a php server) You can setup url, port and ssl in test/test_const.py

  curl -L https://github.com/grocy/grocy-docker/raw/master/Dockerfile-grocy > Dockerfile-grocy
  docker-compose build grocy
  docker pull grocy/grocy-docker:nginx
  docker-compose up -d
  curl -kX GET https://localhost

License

FOSSA Status


ko-fi

About

License:MIT License


Languages

Language:Python 100.0%