Skip to main content

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.

Looking for the HTTP service instead of the Python library? See the root README.md for things-api.

Changelog — For a detailed history of changes, see CHANGELOG.md.

When should I use this?

Use things-sdk when you want to build Python-native tooling on top of Things Cloud, such as:

  • CLI tools
  • automation scripts
  • background workers
  • MCP servers
  • custom internal integrations

If you want a ready-made HTTP/HTTPS service instead, use things-api from the repository root.

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

Examples

See the examples/sdk/ directory for runnable examples:

Example Description
list_tasks.py Sync from Things Cloud, then print all pending tasks
sync_once.py Run a single pull + push sync cycle
create_task.py Create a task locally and push it to Things Cloud

All examples use the public things_sdk API:

THINGS_EMAIL=you@example.com THINGS_PASSWORD=secret uv run examples/sdk/list_tasks.py

Smoke-tested release artifacts

Releases validate that the SDK is not just built, but actually installable and usable:

  • build wheel + sdist
  • install wheel into a clean virtualenv
  • import things_sdk
  • create a SQLAlchemy engine/session factory
  • after publish, install things-sdk==<version> from PyPI and repeat the basic checks

That means a published things-sdk release has already passed both a build-time smoke test and a post-publish verification in CI.

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

things_sdk-0.2.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

things_sdk-0.2.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file things_sdk-0.2.1.tar.gz.

File metadata

  • Download URL: things_sdk-0.2.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for things_sdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a3ee4ea405174d3e55ddcb2d0108bf902a56a613e40545f96e16d18583d024ca
MD5 6dc36f9728387c678ffc82b429df7858
BLAKE2b-256 44297fb244d121d3b6117d727eadd17df8793e3d9401933ccf2e3d9020b9c1d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for things_sdk-0.2.1.tar.gz:

Publisher: release.yml on nkootstra/things

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file things_sdk-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: things_sdk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for things_sdk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0dfba0a42f2716ebb895c6e2c1f00db9d98870ee7ad656b353501ae1289d325
MD5 a4567b805d2ea2844c33d665a362a625
BLAKE2b-256 2cb479d6c1d235975932edad8fd641ef339950efdfd8e31e0292fcab219d8121

See more details on using hashes here.

Provenance

The following attestation bundles were made for things_sdk-0.2.1-py3-none-any.whl:

Publisher: release.yml on nkootstra/things

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page