Reusable Python SDK for Things Cloud sync — domain models, cloud client, sync engine, and task operations
Project description
Things SDK
Reusable Python SDK for Things Cloud sync.
Installation
pip install things-sdk
Quick Start
import asyncio
from things_sdk import (
ThingsClient,
TaskService,
configure_sync,
create_engine_and_session,
init_db,
pull_sync,
push_sync,
)
class MySyncConfig:
sync_retry_attempts = 3
sync_retry_base_seconds = 0.25
sync_circuit_breaker_failures = 3
sync_circuit_breaker_cooldown_seconds = 60.0
async def main():
# 1. Database setup
engine, session_factory = create_engine_and_session(
"sqlite+aiosqlite:///data/things.db"
)
await init_db(engine)
# 2. Configure sync engine
configure_sync(MySyncConfig())
# 3. Sync from Things Cloud
client = ThingsClient(email="you@example.com", password="your-password")
async with session_factory() as session:
result = await pull_sync(client, session)
print(f"Pulled: {result}")
await client.close()
# 4. Query tasks
svc = TaskService()
async with session_factory() as session:
tasks = await svc.list_tasks(session)
for t in tasks:
print(f" - {t['title']} ({t['status']})")
await engine.dispose()
asyncio.run(main())
What's included
| Module | Description |
|---|---|
ThingsClient |
Async HTTP client for Things Cloud |
pull_sync / push_sync |
Sync engine with retry + circuit breaker |
TaskService |
CRUD operations for tasks, areas, tags |
create_engine_and_session |
SQLAlchemy async engine factory |
| Domain models | Task, Area, Tag, ChecklistItem, SyncState |
CloudClientProtocol |
Protocol for custom client implementations |
SyncConfig |
Protocol for sync configuration |
EntityHandler |
Strategy pattern for extending sync to new entity types |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file things_sdk-0.2.0.tar.gz.
File metadata
- Download URL: things_sdk-0.2.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45ef4604b542e23367f28018f70be0dbc04ff66458864289818fcc6cdd61564e
|
|
| MD5 |
19c2bab0792f4c55894d3fb6b1caaa47
|
|
| BLAKE2b-256 |
a6c7cc690677bbe2e6b2dd4268172e097ffefb53af39cbcb953dfe052c846863
|
Provenance
The following attestation bundles were made for things_sdk-0.2.0.tar.gz:
Publisher:
release.yml on nkootstra/things
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
things_sdk-0.2.0.tar.gz -
Subject digest:
45ef4604b542e23367f28018f70be0dbc04ff66458864289818fcc6cdd61564e - Sigstore transparency entry: 1379558009
- Sigstore integration time:
-
Permalink:
nkootstra/things@72dea024eca253680daea61b7255d248d9bb6da7 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/nkootstra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@72dea024eca253680daea61b7255d248d9bb6da7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file things_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: things_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78e0c914318cac75af4ebfa834525ca87a70faf95bb6d97c7571862bcce78496
|
|
| MD5 |
def0b54b362aea0453e250d032469406
|
|
| BLAKE2b-256 |
fef5b62bb9fcaa385523e56a4f0db7f63fc6c49c1b7f23a54c6513b002e30c86
|
Provenance
The following attestation bundles were made for things_sdk-0.2.0-py3-none-any.whl:
Publisher:
release.yml on nkootstra/things
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
things_sdk-0.2.0-py3-none-any.whl -
Subject digest:
78e0c914318cac75af4ebfa834525ca87a70faf95bb6d97c7571862bcce78496 - Sigstore transparency entry: 1379558128
- Sigstore integration time:
-
Permalink:
nkootstra/things@72dea024eca253680daea61b7255d248d9bb6da7 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/nkootstra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@72dea024eca253680daea61b7255d248d9bb6da7 -
Trigger Event:
push
-
Statement type: