Metadata-Version: 2.4
Name: nextcloud-deck-client
Version: 1.0.1
Summary: Nextcloud Deck API client for Python — sync and async
License: LGPL-3.0-or-later
License-File: COPYING
License-File: COPYING.LESSER
Keywords: nextcloud,deck,kanban,api,client
Author: Ola Thoresen
Author-email: github@olen.net
Requires-Python: >=3.11
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: httpx (>=0.27)
Requires-Dist: python-dateutil (>=2.8)
Requires-Dist: requests (>=2.31)
Project-URL: Issues, https://github.com/Olen/nextcloud-deck-client/issues
Project-URL: Repository, https://github.com/Olen/nextcloud-deck-client
Description-Content-Type: text/markdown

# nextcloud-deck-client

A Python client for the [Nextcloud Deck](https://apps.nextcloud.com/apps/deck)
API, with both synchronous and asynchronous clients.

## Install

```bash
pip install nextcloud-deck-client
```

## Use

```python
from ncdeck import DeckClient

deck = DeckClient("https://cloud.example.com", "username", "app-password", board_id=1)

for stack in deck.get_stacks():
    print(stack.title)
    for card in stack.cards:
        print("   ", card.title)
```

Async:

```python
from ncdeck import AsyncDeckClient

deck = AsyncDeckClient("https://cloud.example.com", "username", "app-password")
boards = await deck.get_boards()
```

## What it covers

Boards, stacks, cards, labels, comments and attachments. Cards can be created,
updated, moved, archived and deleted. The activity feed is exposed so callers
can determine when a card was moved. `DeckClient` (sync) and `AsyncDeckClient`
(async) expose the same methods with the same arguments — pick whichever
matches your program and the two are interchangeable.

Two Deck quirks are handled for you:

- `move_card()` uses the documented update route addressed at the *target*
  stack, rather than the `/cards/{id}/reorder` endpoint, working around
  [Deck issue #6830](https://github.com/nextcloud/deck/issues/6830). The
  `/reorder` route makes Deck renumber every card in the target stack and
  stamp `lastModified` on all of them; `move_card()` avoids that, so
  `lastModified` stays a reliable signal for every other card in the stack.
- The activity endpoint answers HTTP 304 with an empty body when there is no
  data; `get_deck_activity()` returns an empty list rather than failing.

## 1.0.0 — breaking changes

- `board_id` moved to the last, optional parameter on every method of both
  `DeckClient` and `AsyncDeckClient`.
- `move_card()` now takes a `Card` instead of raw stack/card ids, and requires
  `.source` to be populated (fetch the card via `get_stacks()` first) — it
  raises `ValueError` otherwise. It no longer renumbers sibling cards, so
  several cards in the target stack may end up sharing `order: 0`.
- `fetch_stacks()` was removed in favour of `get_stacks()`.

## Authentication

Use a Nextcloud [app password](https://docs.nextcloud.com/server/latest/user_manual/en/session_management.html#managing-devices),
not your account password.

## Related tools

[nextcloud-deck-cli](https://github.com/Olen/nextcloud-deck-cli) is a set of
command-line tools for Nextcloud Deck built on top of this library.

## Licence

LGPL-3.0-or-later. See `COPYING.LESSER`.

