Metadata-Version: 2.4
Name: pygrocy2
Version: 2.6.0
Author-email: George Green <iamkarlson@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/iamkarlson/pygrocy2
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: deprecation~=2.1.0
Requires-Dist: pydantic~=2.12.2
Requires-Dist: tzdata
Requires-Dist: tzlocal~=5.2
Dynamic: license-file

# pygrocy2

[![Development Build Status](https://api.travis-ci.com/SebRut/pygrocy.svg?branch=develop)](https://travis-ci.com/SebRut/pygrocy)
[![PyPI](https://img.shields.io/pypi/v/pygrocy.svg)](https://pypi.org/project/pygrocy/)
![Python Version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue)
![Grocy Version](https://img.shields.io/badge/grocy-3.1.0-yellow)
[![Coverage Status](https://coveralls.io/repos/github/SebRut/pygrocy/badge.svg?branch=master)](https://coveralls.io/github/SebRut/pygrocy?branch=master)
[![CodeFactor](https://www.codefactor.io/repository/github/sebrut/pygrocy/badge)](https://www.codefactor.io/repository/github/sebrut/pygrocy)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[Documentation](https://sebrut.github.io/pygrocy/)

## Installation

`pip install pygrocy2`

## Usage

Import the package:

```python
from pygrocy2 import Grocy
```

Obtain a grocy instance:

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

or

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

Get current stock:

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

# Support

If you need help using pygrocy check the [discussions](https://github.com/flipper/pygrocy2/issues) section. Feel free to create an issue for feature requests, bugs and errors in the library.

## Development testing

You need tox and Python 3.13 to run the tests. Navigate to the root dir of `pygrocy2` and execute `tox` to run the tests.
