Skip to main content

No project description provided

Project description

pygrocy

Development Build Status PyPI Coverage Status CodeFactor pre-commit

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.available_amount, entry.id))

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

Project details


Download files

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

Source Distribution

pygrocy-0.26.0.tar.gz (16.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page