Skip to content
No description or website provided.
Python
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
pygrocy
test
.gitignore
.travis.yml
Dockerfile-grocy
LICENSE
README.md
docker-compose.yml
github_deploy_key_sebrut_pygrocy.enc
requirements-dev.txt
requirements.txt
setup.py

README.md

pygrocy

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.product_id, entry.amount))

Dev 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 Easy case : install docker and docker-compose and run : For pre-release Grocy version :

  docker-compose build grocy
  docker pull grocy/grocy-docker:nginx
  docker-compose up -d
  curl -kX GET https://localhost

For latest Grocy version :

  docker pull
  docker-compose up -d
  curl -kX GET https://localhost

License

FOSSA Status


ko-fi

You can’t perform that action at this time.