Skip to main content

socialhome-client

Async HTTP + WebSocket client for Social Home, published to PyPI as socialhome-client and consumed by the Home Assistant integration.

Never imports from social_home (core). Safe to install inside Home Assistant Core, which runs on Python 3.13.

Install

pip install socialhome-client

Use

The client groups methods under feature resources — e.g. c.me.get(), c.shopping.add(...), c.bot.create(...) — rather than a flat surface.

import asyncio

from socialhome_client import SocialHomeClient, SocialHomeWsManager


async def main() -> None:
    async with SocialHomeClient("http://homeassistant.local:8099", token="…") as sh:
        me = await sh.me.get()
        print(me.display_name)

        await sh.shopping.add("milk")
        events = await sh.calendar.list_events("cal-1", "2026-05-01", "2026-06-01")
        print(f"{len(events)} events this month")

        ws = SocialHomeWsManager(sh)
        await ws.connect()
        ws.register(
            ["post_created"],
            lambda frame: asyncio.sleep(0, print(frame)),
        )


asyncio.run(main())

Bots

Home Assistant automations can post into a space feed through the bot-bridge. Each bot has its own Bearer token (shown once on create) and posts render with the bot's icon + name instead of a generic "Home Assistant" avatar.

# Admin turns on bot posting for the space, then registers a household bot.
await sh.space.update(space_id, bot_enabled=True)
bot = await sh.bot.create(
    space_id, scope="space", slug="doorbell",
    name="Doorbell", icon="🔔",
)

# Persist bot.token somewhere safe — the backend will not show it again.
await sh.bot.post(
    space_id, bot.token,
    title="Ring", message="Front door",
)

Develop

pip install -e .[dev]
pre-commit install
pytest

Documentation

  • docs/principles.md — design principles (standalone of core, async everywhere, typed responses).
  • docs/architecture.md — HTTP client + feature resources, WebSocket manager, models, exceptions.
  • docs/testing.md — test strategy, 85 % coverage gate, aioresponses + fake-WS patterns.
  • CLAUDE.md, AGENTS.md — guidance for AI assistants working in this repo.

License

Mozilla Public License 2.0.

Release files for socialhome-client 2026.5.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for socialhome-client 2026.5.11
File Size Uploaded
socialhome_client-2026.5.11.tar.gz 37.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for socialhome-client 2026.5.11
File Interpreter ABI Platform
socialhome_client-2026.5.11-py3-none-any.whl Python 3 none any Details

Total release size: 61.4 kB

Release files / socialhome_client-2026.5.11.tar.gz

Download URL socialhome_client-2026.5.11.tar.gz
Size 37.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b2851d043f44cda1fb183be32f05e317ba82c3b81ed3a8ff3aa7a441d4e06948
BLAKE2b-256 checksum
How to use checksums
075b074c5cd56ca5ce937feae3046a14d67384e7ebfe2f68e0afdf1c04177b0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 11, 2026.

Transparency log

Release files / socialhome_client-2026.5.11-py3-none-any.whl

Download URL socialhome_client-2026.5.11-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
febb29904dacd29e20971d8acc65974594fbc0d917268e435bde740038fe8dca
BLAKE2b-256 checksum
How to use checksums
6e17bd4a982898d3cb8be3715b6d64855ae4553e9ec02f63f7c105a4e318bf31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.5.11 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page