Python SDK for the Behavioral Signals API: voice behavior analysis and audio/video deepfake detection, plus an optional MCP server. Setup, code style and pull request steps are in CONTRIBUTING.md.
src/behavioralsignals/client.py:Client, which holds thebehavioralanddeepfakesclients.src/behavioralsignals/behavioral.py,deepfakes.py: the two APIs.base.py: HTTP requests, errors, the wait loop behindwait_for_result, and the gRPC channel.src/behavioralsignals/models.py: pydantic models of requests and responses.configuration.py: API URLs and timeouts.src/behavioralsignals/mcp_server.py: the MCP server (behavioralsignals-mcp).src/behavioralsignals/generated/: gRPC code generated fromprotos/api.proto.examples/: batch and streaming scripts.tests/: pytest tests.
uv sync -p 3.10 --extra dev # see CONTRIBUTING.md
uv run pytest
uv run ruff check
uv run ruff format
uv run mypy srcCI runs ruff check, ruff format --check, mypy src and pytest on Python 3.10 to 3.13. It
also runs the tests with the lowest versions allowed in pyproject.toml, and needs 90% coverage.
- Support Python 3.10: no newer syntax or modules.
- If you change
pyproject.toml, runuv lockand commituv.lock; CI fails otherwise. BehavioralandDeepfakesrepeat the audio methods; change both.- Don't edit
generated/by hand; regenerate it (see CONTRIBUTING.md). - Tests never call the API and need no credentials. Fake HTTP as
tests/test_client.pydoes. mcpis an optional extra: never importmcp_serverfrom__init__.py.mcp_server.pymust never print to stdout; stdout carries the MCP protocol.- When a public method or MCP tool changes, update the README method table,
examples/, and the MCP tools and README MCP section if they use it. - Never commit credentials.