tiled.client.sync.copy

tiled.client.sync.copy(source: BaseClient, dest: BaseClient, on_conflict: str = 'error')[source]

Copy data from one Tiled instance to another.

Parameters:
sourcetiled node
desttiled node
on_conflictstr, default ‘error’, other options ‘warn’, ‘skip’

Examples

Connect to two instances and copy data.

>>> from tiled.client import from_uri
>>> from tiled.client.sync import copy
>>> a = from_uri("http://localhost:8000", api_key="secret")
>>> b = from_uri("http://localhost:9000", api_key="secret")
>>> copy(a, b)

Copy select data.

>>> copy(a.items().head(), b)
>>> copy(a.search(...), b)

Copy and ignore duplicates.

>>> copy(a, b, on_conflict = 'skip')