ourgroceries


Nameourgroceries JSON
Version 1.5.4 PyPI version JSON
download
home_pagehttps://github.com/ljmerza/py-our-groceries
SummaryOur Groceries Unofficial Python Package
upload_time2023-09-19 14:56:31
maintainer
docs_urlNone
authorLeonardo Merza
requires_python>=3.5
licenseMIT
keywords unoffical our groceries api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Unofficial asyncio python wrapper for the Our Groceries API. This library requires `Python >=3.5`.

## Installation

```bash
pip install ourgroceries
```

## Usage

```
import asyncio
from ourgroceries import OurGroceries

username = ''
password = ''

og = OurGroceries(username, password)

loop = asyncio.get_event_loop()
loop.run_until_complete(og.login())

my_lists = loop.run_until_complete(og.get_my_lists())
print(my_lists)

my_todo_list = loop.run_until_complete(og.get_list_items(list_id=''))
print(my_todo_list)
```

## Methods
```def login()```

Logs into our groceries

---

```def get_my_lists()```

Gets all of your lists

---

```def get_category_items()```

Gets all of your category items

---

```def get_list_items(list_id)```

Gets the items for a list

---

```def create_list(name, list_type='SHOPPING')```

Creates a new list. list_type can be 'RECIPES' or 'SHOPPING'

---

```def create_category(name)```

Create a new category

---

```def toggle_item_crossed_off(list_id, item_id, cross_off=False)```

Toggle a list item's crossed off property based on `cross_off`

---

```def add_item_to_list(list_id, value, category="uncategorized", auto_category=False, note=None)```

Adds a new item to a given list/category. Use `auto_category` instead of `category` to let
Our Groceries apply the default category for this item.

---

```async def add_items_to_list(self, list_id, items)```

Adds several items to a given list. Use `items` to pass a sequence of items, each being just a value, or a tuple
(value, category, note).

---

```def remove_item_from_list(list_id, item_id)```

Removes an item from a given list

---

```def get_master_list()```

Gets the master list

---

```def get_category_list()```

Gets the category list

---

```def delete_list(list_id)```

Deletes a list

---

```def delete_all_crossed_off_from_list(list_id)```

Deletes all crossed off items from a list

---

```def add_item_to_master_list(value, category_id)```

Adds an item to the master list

---

```def change_item_on_list(list_id, item_id, category_id, value)```

Changes an item on a list

---

## Exceptions

throws `InvalidLoginException` if can't login.


## Development

prerequisites
```
python3 -m pip install --user --upgrade setuptools wheel
python3 -m pip install --user --upgrade twine

increment version in `setup.py`
delete build folder

python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ljmerza/py-our-groceries",
    "name": "ourgroceries",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "unoffical our groceries api",
    "author": "Leonardo Merza",
    "author_email": "ljmerza@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/59/f5/8c6d796fc487245a118113ffad24e843a383e96882bf1f8fad06e93e4b91/ourgroceries-1.5.4.tar.gz",
    "platform": null,
    "description": "Unofficial asyncio python wrapper for the Our Groceries API. This library requires `Python >=3.5`.\n\n## Installation\n\n```bash\npip install ourgroceries\n```\n\n## Usage\n\n```\nimport asyncio\nfrom ourgroceries import OurGroceries\n\nusername = ''\npassword = ''\n\nog = OurGroceries(username, password)\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(og.login())\n\nmy_lists = loop.run_until_complete(og.get_my_lists())\nprint(my_lists)\n\nmy_todo_list = loop.run_until_complete(og.get_list_items(list_id=''))\nprint(my_todo_list)\n```\n\n## Methods\n```def login()```\n\nLogs into our groceries\n\n---\n\n```def get_my_lists()```\n\nGets all of your lists\n\n---\n\n```def get_category_items()```\n\nGets all of your category items\n\n---\n\n```def get_list_items(list_id)```\n\nGets the items for a list\n\n---\n\n```def create_list(name, list_type='SHOPPING')```\n\nCreates a new list. list_type can be 'RECIPES' or 'SHOPPING'\n\n---\n\n```def create_category(name)```\n\nCreate a new category\n\n---\n\n```def toggle_item_crossed_off(list_id, item_id, cross_off=False)```\n\nToggle a list item's crossed off property based on `cross_off`\n\n---\n\n```def add_item_to_list(list_id, value, category=\"uncategorized\", auto_category=False, note=None)```\n\nAdds a new item to a given list/category. Use `auto_category` instead of `category` to let\nOur Groceries apply the default category for this item.\n\n---\n\n```async def add_items_to_list(self, list_id, items)```\n\nAdds several items to a given list. Use `items` to pass a sequence of items, each being just a value, or a tuple\n(value, category, note).\n\n---\n\n```def remove_item_from_list(list_id, item_id)```\n\nRemoves an item from a given list\n\n---\n\n```def get_master_list()```\n\nGets the master list\n\n---\n\n```def get_category_list()```\n\nGets the category list\n\n---\n\n```def delete_list(list_id)```\n\nDeletes a list\n\n---\n\n```def delete_all_crossed_off_from_list(list_id)```\n\nDeletes all crossed off items from a list\n\n---\n\n```def add_item_to_master_list(value, category_id)```\n\nAdds an item to the master list\n\n---\n\n```def change_item_on_list(list_id, item_id, category_id, value)```\n\nChanges an item on a list\n\n---\n\n## Exceptions\n\nthrows `InvalidLoginException` if can't login.\n\n\n## Development\n\nprerequisites\n```\npython3 -m pip install --user --upgrade setuptools wheel\npython3 -m pip install --user --upgrade twine\n\nincrement version in `setup.py`\ndelete build folder\n\npython3 setup.py sdist bdist_wheel\npython3 -m twine upload dist/*\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Our Groceries Unofficial Python Package",
    "version": "1.5.4",
    "project_urls": {
        "Homepage": "https://github.com/ljmerza/py-our-groceries"
    },
    "split_keywords": [
        "unoffical",
        "our",
        "groceries",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "361b33a4f581734943852b72ef34d3001510644952eb0a56f3a0709315d4af9c",
                "md5": "aec6c4c541cc499e98325df50ef98323",
                "sha256": "fc125c13ad0a4cb56d3d5ce34bcba557c1c565cbe8ae86d3d9dd61523c3d3d43"
            },
            "downloads": -1,
            "filename": "ourgroceries-1.5.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aec6c4c541cc499e98325df50ef98323",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 5938,
            "upload_time": "2023-09-19T14:56:29",
            "upload_time_iso_8601": "2023-09-19T14:56:29.962708Z",
            "url": "https://files.pythonhosted.org/packages/36/1b/33a4f581734943852b72ef34d3001510644952eb0a56f3a0709315d4af9c/ourgroceries-1.5.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59f58c6d796fc487245a118113ffad24e843a383e96882bf1f8fad06e93e4b91",
                "md5": "cf3ebf0bd18f0380050d5d19fda6316d",
                "sha256": "37977ba07dc790054d8a3f8ec272e93192096d77654aec59a624990fdb7c9eeb"
            },
            "downloads": -1,
            "filename": "ourgroceries-1.5.4.tar.gz",
            "has_sig": false,
            "md5_digest": "cf3ebf0bd18f0380050d5d19fda6316d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 5572,
            "upload_time": "2023-09-19T14:56:31",
            "upload_time_iso_8601": "2023-09-19T14:56:31.053212Z",
            "url": "https://files.pythonhosted.org/packages/59/f5/8c6d796fc487245a118113ffad24e843a383e96882bf1f8fad06e93e4b91/ourgroceries-1.5.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-19 14:56:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ljmerza",
    "github_project": "py-our-groceries",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ourgroceries"
}
        
Elapsed time: 0.15310s