bring-api


Namebring-api JSON
Version 0.8.1 PyPI version JSON
download
home_pagehttps://github.com/miaucl/bring.api
SummaryUnofficial package to access Bring! shopping lists API.
upload_time2024-07-26 12:58:18
maintainerNone
docs_urlNone
authorCyrill Raccaud
requires_python>=3.11
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Bring! Shopping Lists API

[![PyPI version](https://badge.fury.io/py/bring-api.svg)](https://badge.fury.io/py/bring-api)

An unofficial python package to access the Bring! shopping lists API.

## Credits

> This implementation of the api is derived from the generic python implementation by [eliasball](https://github.com/eliasball/python-bring-api), which uses the legacy version of the api. This fork has been synced last time on 2024-02-11 and diverges from that point on using the non-legacy version. The implementation of [eliasball](https://github.com/eliasball/python-bring-api) is a **minimal** python port of the [node-bring-api](https://github.com/foxriver76/node-bring-api) by [foxriver76](https://github.com/foxriver76). All credit goes to him for making this awesome API possible!

## Disclaimer

The developers of this module are in no way endorsed by or affiliated with Bring! Labs AG, or any associated subsidiaries, logos or trademarks.

## Installation

`pip install bring-api`

## Documentation

See below for usage examples. See [Exceptions](#exceptions) for API-specific exceptions and mitigation strategies for common exceptions.

## Usage Example

The API is based on the async HTTP library `aiohttp`.

```python
import aiohttp
import asyncio
import logging
import sys

from bring_api import Bring

logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)

async def main():
  async with aiohttp.ClientSession() as session:
    # Create Bring instance with email and password
    bring = Bring(session, "MAIL", "PASSWORD")
    # Login
    await bring.login()

    # Get information about all available shopping lists
    lists = (await bring.load_lists())["lists"]

    # Save an item with specifications to a certain shopping list
    await bring.save_item(lists[0]['listUuid'], 'Milk', 'low fat')

    # Save another item
    await bring.save_item(lists[0]['listUuid'], 'Carrots')

    # Get all the items of a list
    items = await bring.get_list(lists[0]['listUuid'])
    print(items)

    # Check off an item
    await bring.complete_item(lists[0]['listUuid'], 'Carrots')

    # Remove an item from a list
    await bring.remove_item(lists[0]['listUuid'], 'Milk')

asyncio.run(main())
```

## Manipulating lists with `batch_update_list`

This method uses the newer API endpoint for adding, completing and removing items from a list, which is also used in the Bring App. The items can be identified by their uuid and therefore some things are possible that are not possible with the legacy endpoints like:
- Add/complete/remove multiple items at once
- Adding multiple items with the same Name but different specifications
- You can work with a unique identifier for an item even before adding it to a list, just use uuid4 to generate a random uuid!

Usage examples:

### Add an item 
When adding an item, the `itemId` is required, `spec` and `uuid` are optional. If you need a unique identifier before adding an item, you can just generate a uuid4.

```python
item = {
  "itemId": "Cilantro",
  "spec": "fresh",
  "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
}
await bring.batch_update_list(
  lists[0]['listUuid'],
  item,
  BringItemOperation.ADD)
```
### Updating an items specification

When updating an item, use ADD operation again. The `itemId` is required and the item `spec` will be added/updated on the existing item on the list. For better matching an existing item (if there is more than one item with the same `itemId`), you can use it's unique identifier `uuid`.

```python
item = {
  "itemId": "Cilantro",
  "spec": "dried",
  "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
}
await bring.batch_update_list(
  lists[0]['listUuid'],
  item,
  BringItemOperation.ADD)
```

### Multiple items

```python
# multiple items can be passed as list of items
items = [{
  "itemId": "Cilantro",
  "spec": "fresh",
  "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
},
{
  "itemId": "Parsley",
  "spec": "dried",
  "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
}]
await bring.batch_update_list(
  lists[0]['listUuid'],
  items,
  BringItemOperation.ADD)
```

### Add multiple items with the same name but different specifications.

When adding items with the same name the parameter `uuid` is required, otherwise the previous item will be matched by `itemId` and it's specification will be overwritten

```python
items = [
  {
    "itemId": "Cilantro",
    "spec": "100g, dried",
    "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
  },
    {
    "itemId": "Cilantro",
    "spec": "fresh",
    "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
  }
]
await bring.batch_update_list(
  lists[0]['listUuid'],
  items,
  BringItemOperation.ADD)
```

### Removing or completing an item

When removing or completing an item you must submit `itemId` and `uuid`, `spec` is optional. Only the `uuid` will not work. Leaving out the `uuid` and submitting `itemId` and `spec` will also work. When submitting only `itemId` the Bring API will match the oldest item.

```python
await bring.batch_update_list(
  lists[0]['listUuid'],
  {"itemId": "Cilantro", "uuid" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"},
  BringItemOperation.REMOVE)

await bring.batch_update_list(
  lists[0]['listUuid'],
  {"itemId": "Cilantro", "uuid" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"},
  BringItemOperation.COMPLETE)  
```

### Renaming an item (not recommended)

An item that is already on the list can be renamed by sending it's `uuid` with a changed `itemId`. But it is highly advised against it because the Bring App will behave weirdly as it does not refresh an items name, not even when force reloading (going to the top of the list and pulling down). Users have to close the list by going to the overview or closing the app and only then when the list is completely refreshed the change of the name will show up.

```python
# Add an item
item = {
  "itemId": "Cilantro",
  "uuid" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
}
await bring.batch_update_list(
  lists[0]['listUuid'],
  item,
  BringItemOperation.ADD)

# Rename the item, and submit it again with the same uuid
item["itemId"] = "Coriander"
await bring.batch_update_list(
  lists[0]['listUuid'],
  item,
  BringItemOperation.ADD)  
```



## Exceptions

In case something goes wrong during a request, several exceptions can be thrown.
They will either be BringRequestException, BringParseException, or BringAuthException, depending on the context. All inherit from BringException.

### Another asyncio event loop is 
With the async calls, you might encounter an error that another asyncio event loop is already running on the same thread. This is expected behavior according to the asyncio.run() [documentation](https://docs.python.org/3/library/asyncio-runner.html#asyncio.run). You cannot use more than one aiohttp session per thread, reuse the existing one!

### Exception ignored: RuntimeError: Event loop is closed

Due to a known issue in some versions of aiohttp when using Windows, you might encounter a similar error to this:

```python
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000000>
Traceback (most recent call last):
  File "C:\...\py38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\...\py38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\...\py38\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\...\py38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
```

You can fix this according to [this](https://stackoverflow.com/questions/68123296/asyncio-throws-runtime-error-with-exception-ignored) stackoverflow answer by adding the following line of code before executing the library:

```python
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
```

## Dev

Setup the dev environment using VSCode, is is highly recommended.

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements_dev.txt
```

Install [pre-commit](https://pre-commit.com)

```bash
pre-commit install

# Run the commit hooks manually
pre-commit run --all-files

# Run tests locally (using a .env file is supported and recommended)
export EMAIL=...
export PASSWORD=...
export LIST=...
python test.py
```

Following VSCode integrations may be helpful:

* [ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)
* [mypy](https://marketplace.visualstudio.com/items?itemName=matangover.mypy)

# CHANGELOG

# 0.8.1

* Reload locales after setting list language to ensure all required article translations are available

# 0.8.0

* **New API method:** `set_list_article_language` sets the article language for a specified shopping list.

# 0.7.3

* Change `name` and `photoPath` in type definitions for `BringSyncCurrentUserResponse` and `BringAuthResponse` to optional parameters
* Add py.typed file so that type checkers can use type annotations

# 0.7.2

* fix bug in debug log message.

# 0.7.1

* Fix get_list method not returning uuid and status from JSON response
* Log to debug instead of error where exceptions are already raised.
* Add raw server response to debug log messages.
* Update docstrings

# 0.7.0

* **New API method:** `retrieve_new_access_token` retrieves a new access token and updates authorization headers. Time till expiration of the access token is stored in the property `expires_in` . ([tr4nt0r](https://github.com/tr4nt0r))
* All API methods that require authentication now raise `BringAuthException` for 401 Unauthorized status ([tr4nt0r](https://github.com/tr4nt0r))

## 0.6.0

* **Pytest unit testing:** added pytest with full code coverage ([tr4nt0r](https://github.com/tr4nt0r))
* **Github workflow for pytest:** added workflow for running pytests with Python 3.11 & 3.12 on Ubuntu, Windows and macOS ([tr4nt0r](https://github.com/tr4nt0r))
* Update Python requirement to >=3.11
* Change from implicit to explicit string conversion of `BringItemOperation` in JSON request payload ([tr4nt0r](https://github.com/tr4nt0r))
* Change Type of `BringItemOperation` to `StrEnum` ([tr4nt0r](https://github.com/tr4nt0r))
* `BringItem::operation` now also accepts string literals `TO_PURCHASE`, `TO_RECENTLY` & `REMOVE` ([tr4nt0r](https://github.com/tr4nt0r))
* fix wrong variable name in `BringSyncCurrentUserResponse` class and add additional variables from JSON response ([tr4nt0r](https://github.com/tr4nt0r))
* Improve exceptions for `save/update/remove/complete_item` and `batch_update_list` methods ([tr4nt0r](https://github.com/tr4nt0r))
* Fix bug in `get_all_item_details` method ([tr4nt0r](https://github.com/tr4nt0r))
* Parsing error when parsing unauthorized response now raises `BringParseException` ([tr4nt0r](https://github.com/tr4nt0r))
* Cleanup legacy code ([tr4nt0r](https://github.com/tr4nt0r))

## 0.5.7

* **map user language to locales**: Bring sometimes stores non-standard locales in the user settings. In case the Bring API returns an invalid/unsupported locale, the user language is now mapped to a supported locale. 

## 0.5.6

* fix incorrect filtering of locales against supported locales list

## 0.5.5

* Fix KeyError when listArticleLanguage is not set.
  
## 0.5.4

* Load article translations from file in executor instead of event loop.

## 0.5.3

* Improve mypy type checking.
  
## 0.5.2

* Fixed build script to add locales explicitly.

## 0.5.1

* Add article translation tables to package. Translation tables are now loaded from file as data from web app is outdated.

## 0.5.0

* **New API method:** `batch_update_list`. Uses the same API endpoint as the mobile app to add, complete and remove items from shopping lists and has support for uuid as unique identifier for list items.  
* `save_item`, `update_item`, `complete_item` and `remove_item` are now wrapper methods for `batch_update_list` and have the additional parameter item_uuid.


## 0.4.1

* instead of downloading all translation tables, required locales are determined from the user list settings and the user locale. ([tr4nt0r](https://github.com/tr4nt0r))
* variable `userlistsettings` renamed to snake_cae `user_list_settings`. ([tr4nt0r](https://github.com/tr4nt0r))

## 0.4.0

* **Localization support:** catalog items are now automatically translated based on the shopping lists language if configured, otherwise the users default language is used ([tr4nt0r](https://github.com/tr4nt0r))
* **New API method:** `get_user_account`. Retrieves information about the current user like email, name and language ([tr4nt0r](https://github.com/tr4nt0r))
* **New API method:** `get_all_user_settings`. Retrieves user settings like default list and individual list settings for section order and language ([tr4nt0r](https://github.com/tr4nt0r))

## 0.3.1

* Unpin requirements and remove subdependencies ([tr4nt0r](https://github.com/tr4nt0r))

## 0.3.0

* Refactor for PEP8 compliance and code clean-up (breaking change) ([tr4nt0r](https://github.com/tr4nt0r))

## 0.2.0

* Add new method does_user_exist ([tr4nt0r](https://github.com/tr4nt0r))
* Fixes for test workflow

## 0.1.4

Add test workflow.

## 0.1.3

Add mypy for type-checking.

## 0.1.2

Add ruff as formatter and linter.

## 0.1.1

Change name of package to `bring-api`.

## 0.1.0

Test publish workflow for pypi, no code related changes.

## 0.0.1

Initial commit based on `3.0.0` from [eliasball](https://github.com/eliasball/python-bring-api).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/miaucl/bring.api",
    "name": "bring-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "Cyrill Raccaud",
    "author_email": "cyrill.raccaud+pypi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/08/72/edc1adb0977b2b1a50407163b7f93fa86926fa695a795ee2455685d08414/bring_api-0.8.1.tar.gz",
    "platform": null,
    "description": "# Bring! Shopping Lists API\n\n[![PyPI version](https://badge.fury.io/py/bring-api.svg)](https://badge.fury.io/py/bring-api)\n\nAn unofficial python package to access the Bring! shopping lists API.\n\n## Credits\n\n> This implementation of the api is derived from the generic python implementation by [eliasball](https://github.com/eliasball/python-bring-api), which uses the legacy version of the api. This fork has been synced last time on 2024-02-11 and diverges from that point on using the non-legacy version. The implementation of [eliasball](https://github.com/eliasball/python-bring-api) is a **minimal** python port of the [node-bring-api](https://github.com/foxriver76/node-bring-api) by [foxriver76](https://github.com/foxriver76). All credit goes to him for making this awesome API possible!\n\n## Disclaimer\n\nThe developers of this module are in no way endorsed by or affiliated with Bring! Labs AG, or any associated subsidiaries, logos or trademarks.\n\n## Installation\n\n`pip install bring-api`\n\n## Documentation\n\nSee below for usage examples. See [Exceptions](#exceptions) for API-specific exceptions and mitigation strategies for common exceptions.\n\n## Usage Example\n\nThe API is based on the async HTTP library `aiohttp`.\n\n```python\nimport aiohttp\nimport asyncio\nimport logging\nimport sys\n\nfrom bring_api import Bring\n\nlogging.basicConfig(stream=sys.stdout, level=logging.DEBUG)\n\nasync def main():\n  async with aiohttp.ClientSession() as session:\n    # Create Bring instance with email and password\n    bring = Bring(session, \"MAIL\", \"PASSWORD\")\n    # Login\n    await bring.login()\n\n    # Get information about all available shopping lists\n    lists = (await bring.load_lists())[\"lists\"]\n\n    # Save an item with specifications to a certain shopping list\n    await bring.save_item(lists[0]['listUuid'], 'Milk', 'low fat')\n\n    # Save another item\n    await bring.save_item(lists[0]['listUuid'], 'Carrots')\n\n    # Get all the items of a list\n    items = await bring.get_list(lists[0]['listUuid'])\n    print(items)\n\n    # Check off an item\n    await bring.complete_item(lists[0]['listUuid'], 'Carrots')\n\n    # Remove an item from a list\n    await bring.remove_item(lists[0]['listUuid'], 'Milk')\n\nasyncio.run(main())\n```\n\n## Manipulating lists with `batch_update_list`\n\nThis method uses the newer API endpoint for adding, completing and removing items from a list, which is also used in the Bring App. The items can be identified by their uuid and therefore some things are possible that are not possible with the legacy endpoints like:\n- Add/complete/remove multiple items at once\n- Adding multiple items with the same Name but different specifications\n- You can work with a unique identifier for an item even before adding it to a list, just use uuid4 to generate a random uuid!\n\nUsage examples:\n\n### Add an item \nWhen adding an item, the `itemId` is required, `spec` and `uuid` are optional. If you need a unique identifier before adding an item, you can just generate a uuid4.\n\n```python\nitem = {\n  \"itemId\": \"Cilantro\",\n  \"spec\": \"fresh\",\n  \"uuid\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"\n}\nawait bring.batch_update_list(\n  lists[0]['listUuid'],\n  item,\n  BringItemOperation.ADD)\n```\n### Updating an items specification\n\nWhen updating an item, use ADD operation again. The `itemId` is required and the item `spec` will be added/updated on the existing item on the list. For better matching an existing item (if there is more than one item with the same `itemId`), you can use it's unique identifier `uuid`.\n\n```python\nitem = {\n  \"itemId\": \"Cilantro\",\n  \"spec\": \"dried\",\n  \"uuid\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"\n}\nawait bring.batch_update_list(\n  lists[0]['listUuid'],\n  item,\n  BringItemOperation.ADD)\n```\n\n### Multiple items\n\n```python\n# multiple items can be passed as list of items\nitems = [{\n  \"itemId\": \"Cilantro\",\n  \"spec\": \"fresh\",\n  \"uuid\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"\n},\n{\n  \"itemId\": \"Parsley\",\n  \"spec\": \"dried\",\n  \"uuid\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"\n}]\nawait bring.batch_update_list(\n  lists[0]['listUuid'],\n  items,\n  BringItemOperation.ADD)\n```\n\n### Add multiple items with the same name but different specifications.\n\nWhen adding items with the same name the parameter `uuid` is required, otherwise the previous item will be matched by `itemId` and it's specification will be overwritten\n\n```python\nitems = [\n  {\n    \"itemId\": \"Cilantro\",\n    \"spec\": \"100g, dried\",\n    \"uuid\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"\n  },\n    {\n    \"itemId\": \"Cilantro\",\n    \"spec\": \"fresh\",\n    \"uuid\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"\n  }\n]\nawait bring.batch_update_list(\n  lists[0]['listUuid'],\n  items,\n  BringItemOperation.ADD)\n```\n\n### Removing or completing an item\n\nWhen removing or completing an item you must submit `itemId` and `uuid`, `spec` is optional. Only the `uuid` will not work. Leaving out the `uuid` and submitting `itemId` and `spec` will also work. When submitting only `itemId` the Bring API will match the oldest item.\n\n```python\nawait bring.batch_update_list(\n  lists[0]['listUuid'],\n  {\"itemId\": \"Cilantro\", \"uuid\" : \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"},\n  BringItemOperation.REMOVE)\n\nawait bring.batch_update_list(\n  lists[0]['listUuid'],\n  {\"itemId\": \"Cilantro\", \"uuid\" : \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"},\n  BringItemOperation.COMPLETE)  \n```\n\n### Renaming an item (not recommended)\n\nAn item that is already on the list can be renamed by sending it's `uuid` with a changed `itemId`. But it is highly advised against it because the Bring App will behave weirdly as it does not refresh an items name, not even when force reloading (going to the top of the list and pulling down). Users have to close the list by going to the overview or closing the app and only then when the list is completely refreshed the change of the name will show up.\n\n```python\n# Add an item\nitem = {\n  \"itemId\": \"Cilantro\",\n  \"uuid\" : \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"\n}\nawait bring.batch_update_list(\n  lists[0]['listUuid'],\n  item,\n  BringItemOperation.ADD)\n\n# Rename the item, and submit it again with the same uuid\nitem[\"itemId\"] = \"Coriander\"\nawait bring.batch_update_list(\n  lists[0]['listUuid'],\n  item,\n  BringItemOperation.ADD)  \n```\n\n\n\n## Exceptions\n\nIn case something goes wrong during a request, several exceptions can be thrown.\nThey will either be BringRequestException, BringParseException, or BringAuthException, depending on the context. All inherit from BringException.\n\n### Another asyncio event loop is \nWith the async calls, you might encounter an error that another asyncio event loop is already running on the same thread. This is expected behavior according to the asyncio.run() [documentation](https://docs.python.org/3/library/asyncio-runner.html#asyncio.run). You cannot use more than one aiohttp session per thread, reuse the existing one!\n\n### Exception ignored: RuntimeError: Event loop is closed\n\nDue to a known issue in some versions of aiohttp when using Windows, you might encounter a similar error to this:\n\n```python\nException ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000000>\nTraceback (most recent call last):\n  File \"C:\\...\\py38\\lib\\asyncio\\proactor_events.py\", line 116, in __del__\n    self.close()\n  File \"C:\\...\\py38\\lib\\asyncio\\proactor_events.py\", line 108, in close\n    self._loop.call_soon(self._call_connection_lost, None)\n  File \"C:\\...\\py38\\lib\\asyncio\\base_events.py\", line 719, in call_soon\n    self._check_closed()\n  File \"C:\\...\\py38\\lib\\asyncio\\base_events.py\", line 508, in _check_closed\n    raise RuntimeError('Event loop is closed')\nRuntimeError: Event loop is closed\n```\n\nYou can fix this according to [this](https://stackoverflow.com/questions/68123296/asyncio-throws-runtime-error-with-exception-ignored) stackoverflow answer by adding the following line of code before executing the library:\n\n```python\nasyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())\n```\n\n## Dev\n\nSetup the dev environment using VSCode, is is highly recommended.\n\n```bash\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements_dev.txt\n```\n\nInstall [pre-commit](https://pre-commit.com)\n\n```bash\npre-commit install\n\n# Run the commit hooks manually\npre-commit run --all-files\n\n# Run tests locally (using a .env file is supported and recommended)\nexport EMAIL=...\nexport PASSWORD=...\nexport LIST=...\npython test.py\n```\n\nFollowing VSCode integrations may be helpful:\n\n* [ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)\n* [mypy](https://marketplace.visualstudio.com/items?itemName=matangover.mypy)\n\n# CHANGELOG\n\n# 0.8.1\n\n* Reload locales after setting list language to ensure all required article translations are available\n\n# 0.8.0\n\n* **New API method:** `set_list_article_language` sets the article language for a specified shopping list.\n\n# 0.7.3\n\n* Change `name` and `photoPath` in type definitions for `BringSyncCurrentUserResponse` and `BringAuthResponse` to optional parameters\n* Add py.typed file so that type checkers can use type annotations\n\n# 0.7.2\n\n* fix bug in debug log message.\n\n# 0.7.1\n\n* Fix get_list method not returning uuid and status from JSON response\n* Log to debug instead of error where exceptions are already raised.\n* Add raw server response to debug log messages.\n* Update docstrings\n\n# 0.7.0\n\n* **New API method:** `retrieve_new_access_token` retrieves a new access token and updates authorization headers. Time till expiration of the access token is stored in the property `expires_in` . ([tr4nt0r](https://github.com/tr4nt0r))\n* All API methods that require authentication now raise `BringAuthException` for 401 Unauthorized status ([tr4nt0r](https://github.com/tr4nt0r))\n\n## 0.6.0\n\n* **Pytest unit testing:** added pytest with full code coverage ([tr4nt0r](https://github.com/tr4nt0r))\n* **Github workflow for pytest:** added workflow for running pytests with Python 3.11 & 3.12 on Ubuntu, Windows and macOS ([tr4nt0r](https://github.com/tr4nt0r))\n* Update Python requirement to >=3.11\n* Change from implicit to explicit string conversion of `BringItemOperation` in JSON request payload ([tr4nt0r](https://github.com/tr4nt0r))\n* Change Type of `BringItemOperation` to `StrEnum` ([tr4nt0r](https://github.com/tr4nt0r))\n* `BringItem::operation` now also accepts string literals `TO_PURCHASE`, `TO_RECENTLY` & `REMOVE` ([tr4nt0r](https://github.com/tr4nt0r))\n* fix wrong variable name in `BringSyncCurrentUserResponse` class and add additional variables from JSON response ([tr4nt0r](https://github.com/tr4nt0r))\n* Improve exceptions for `save/update/remove/complete_item` and `batch_update_list` methods ([tr4nt0r](https://github.com/tr4nt0r))\n* Fix bug in `get_all_item_details` method ([tr4nt0r](https://github.com/tr4nt0r))\n* Parsing error when parsing unauthorized response now raises `BringParseException` ([tr4nt0r](https://github.com/tr4nt0r))\n* Cleanup legacy code ([tr4nt0r](https://github.com/tr4nt0r))\n\n## 0.5.7\n\n* **map user language to locales**: Bring sometimes stores non-standard locales in the user settings. In case the Bring API returns an invalid/unsupported locale, the user language is now mapped to a supported locale. \n\n## 0.5.6\n\n* fix incorrect filtering of locales against supported locales list\n\n## 0.5.5\n\n* Fix KeyError when listArticleLanguage is not set.\n  \n## 0.5.4\n\n* Load article translations from file in executor instead of event loop.\n\n## 0.5.3\n\n* Improve mypy type checking.\n  \n## 0.5.2\n\n* Fixed build script to add locales explicitly.\n\n## 0.5.1\n\n* Add article translation tables to package. Translation tables are now loaded from file as data from web app is outdated.\n\n## 0.5.0\n\n* **New API method:** `batch_update_list`. Uses the same API endpoint as the mobile app to add, complete and remove items from shopping lists and has support for uuid as unique identifier for list items.  \n* `save_item`, `update_item`, `complete_item` and `remove_item` are now wrapper methods for `batch_update_list` and have the additional parameter item_uuid.\n\n\n## 0.4.1\n\n* instead of downloading all translation tables, required locales are determined from the user list settings and the user locale. ([tr4nt0r](https://github.com/tr4nt0r))\n* variable `userlistsettings` renamed to snake_cae `user_list_settings`. ([tr4nt0r](https://github.com/tr4nt0r))\n\n## 0.4.0\n\n* **Localization support:** catalog items are now automatically translated based on the shopping lists language if configured, otherwise the users default language is used ([tr4nt0r](https://github.com/tr4nt0r))\n* **New API method:** `get_user_account`. Retrieves information about the current user like email, name and language ([tr4nt0r](https://github.com/tr4nt0r))\n* **New API method:** `get_all_user_settings`. Retrieves user settings like default list and individual list settings for section order and language ([tr4nt0r](https://github.com/tr4nt0r))\n\n## 0.3.1\n\n* Unpin requirements and remove subdependencies ([tr4nt0r](https://github.com/tr4nt0r))\n\n## 0.3.0\n\n* Refactor for PEP8 compliance and code clean-up (breaking change) ([tr4nt0r](https://github.com/tr4nt0r))\n\n## 0.2.0\n\n* Add new method does_user_exist ([tr4nt0r](https://github.com/tr4nt0r))\n* Fixes for test workflow\n\n## 0.1.4\n\nAdd test workflow.\n\n## 0.1.3\n\nAdd mypy for type-checking.\n\n## 0.1.2\n\nAdd ruff as formatter and linter.\n\n## 0.1.1\n\nChange name of package to `bring-api`.\n\n## 0.1.0\n\nTest publish workflow for pypi, no code related changes.\n\n## 0.0.1\n\nInitial commit based on `3.0.0` from [eliasball](https://github.com/eliasball/python-bring-api).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Unofficial package to access Bring! shopping lists API.",
    "version": "0.8.1",
    "project_urls": {
        "Homepage": "https://github.com/miaucl/bring.api"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71e33b5c171a54807e8230334e21655cbe606394abbfc0ffbd0efab740349e4f",
                "md5": "b78136b701ef4d8c03f4d77fbcd98860",
                "sha256": "de3ee12b557781c72b294e451c9b8ad59096fbea8e6a84c7fee2ce1f420b3447"
            },
            "downloads": -1,
            "filename": "bring_api-0.8.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b78136b701ef4d8c03f4d77fbcd98860",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 105908,
            "upload_time": "2024-07-26T12:58:16",
            "upload_time_iso_8601": "2024-07-26T12:58:16.378191Z",
            "url": "https://files.pythonhosted.org/packages/71/e3/3b5c171a54807e8230334e21655cbe606394abbfc0ffbd0efab740349e4f/bring_api-0.8.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0872edc1adb0977b2b1a50407163b7f93fa86926fa695a795ee2455685d08414",
                "md5": "8265dffec63c9d5ab88fdd0f076dddb9",
                "sha256": "5fa102b3c58cfa25caf39f66883f90a46250e2c6047193b831b44633b092d638"
            },
            "downloads": -1,
            "filename": "bring_api-0.8.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8265dffec63c9d5ab88fdd0f076dddb9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 73602,
            "upload_time": "2024-07-26T12:58:18",
            "upload_time_iso_8601": "2024-07-26T12:58:18.017932Z",
            "url": "https://files.pythonhosted.org/packages/08/72/edc1adb0977b2b1a50407163b7f93fa86926fa695a795ee2455685d08414/bring_api-0.8.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-26 12:58:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "miaucl",
    "github_project": "bring.api",
    "github_not_found": true,
    "lcname": "bring-api"
}
        
Elapsed time: 0.37523s