Skip to main content

Viio Sync API SDK for Python

viio-sync-api-sdk contains the generated viio.sync.v1 protobuf contract and an AsyncIO client for authentication and explicit sync-batch lifecycle management.

Install

python -m pip install viio-sync-api-sdk

Python 3.11 and later are supported without an artificial upper minor-version cap. CI validates the minimum version and the latest stable Python release, so the upper tested version advances automatically.

Send a batch

from viio_sync_api import SyncApiAuthentication, SyncApiClient, SyncApiClientOptions
from viio_sync_api.v1 import Account, AccountRecords, GenericAccountDetails, SyncRecordsRequest


async def sync_accounts() -> None:
    options = SyncApiClientOptions(
        endpoint="https://sync.example.com",
        authentication=SyncApiAuthentication.api_key("your-api-key"),
    )

    async with SyncApiClient(options) as client:
        batch = await client.start_batch("installation-id")
        try:
            await batch.write(
                SyncRecordsRequest(
                    accounts=AccountRecords(
                        records=[
                            Account(
                                generic=GenericAccountDetails(
                                    id="account-1",
                                    email="person@example.com",
                                )
                            )
                        ]
                    )
                )
            )
            await batch.complete()
        except BaseException:
            await batch.abort()
            raise

Each write accepts exactly one typed records wrapper. A present empty wrapper represents an intentional empty snapshot:

await batch.write(SyncRecordsRequest(accounts=AccountRecords()))

SyncApiBatchAlreadyInProgressError distinguishes an existing sync. Protocol failures raise SyncApiProtocolError. Native grpc.aio.AioRpcError, cancellation, and timeout errors remain available for retry decisions.

The authenticated generated stub is available as client.grpc_client. Calls through it bypass batch validation.

max_receive_message_size caps individual responses received by this client, while max_send_message_size caps individual requests it sends. The receive limit defaults to 16 MiB to match the .NET SDK; setting either value to None leaves that direction at gRPC's default.

AWS Lambda

The Viio developer portal provides a complete Lambda handler and AWS SAM template. The handler acquires an application token from Microsoft Entra ID, pages through Microsoft Graph users, maps each user to MicrosoftEmployeeDetails, writes a complete employee snapshot, and completes or aborts the Sync API batch. The template configures Amazon EventBridge Scheduler to invoke it every night with cron(0 2 * * ? *).

Grant the Entra application the Microsoft Graph User.Read.All application permission and supply these Lambda environment variables from your secret-management system:

  • MICROSOFT_TENANT_ID
  • MICROSOFT_CLIENT_ID
  • MICROSOFT_CLIENT_SECRET
  • VIIO_SYNC_API_ENDPOINT
  • VIIO_SYNC_API_KEY
  • VIIO_DIRECT_INTEGRATION_INSTALLATION_ID

The example creates and closes the client inside each invocation's event loop. This avoids retaining a gRPC AsyncIO channel across event loops when Lambda reuses a warm execution environment.

grpcio contains native code. When creating a Lambda ZIP or layer on another operating system, ask pip for the matching Linux wheel:

# x86_64
python -m pip install \
  --platform manylinux2014_x86_64 \
  --implementation cp \
  --python-version 3.11 \
  --only-binary=:all: \
  --target package \
  viio-sync-api-sdk

# arm64
python -m pip install \
  --platform manylinux2014_aarch64 \
  --implementation cp \
  --python-version 3.11 \
  --only-binary=:all: \
  --target package \
  viio-sync-api-sdk

Replace 3.11 with the Python version of the target Lambda runtime. The same package can be installed normally in AWS Lambda Python container images. Full API documentation is available at https://developers.viio.io/sync-api.

Authentication and transport security

External integrations use API keys. Viio-managed callers can supply an asynchronous bearer-token provider.

Sync API endpoints must use HTTPS. HTTP is accepted only for loopback endpoints during development. SDK exception messages and representations do not include keys or bearer tokens.

License

MIT

Metadata

Release files for viio-sync-api-sdk 0.4.0

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

Source distribution (sdist)

Source distribution for viio-sync-api-sdk 0.4.0
File Size Uploaded Provenance
viio_sync_api_sdk-0.4.0.tar.gz 35.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for viio-sync-api-sdk 0.4.0
File Interpreter ABI Platform
viio_sync_api_sdk-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 87.7 kB

Release files / viio_sync_api_sdk-0.4.0.tar.gz

Download URL viio_sync_api_sdk-0.4.0.tar.gz
Size 35.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7757f54ce977d23ec0be793b9e69b5dbe072835f81ec263d1444efcda640a81c
BLAKE2b-256 checksum
How to use checksums
de773028281e3b47eadd5f97f36ba3a2b2ec001057fb471cb5f8d52250dcf703
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 21, 2026.

Transparency log

Release files / viio_sync_api_sdk-0.4.0-py3-none-any.whl

Download URL viio_sync_api_sdk-0.4.0-py3-none-any.whl
Size 51.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
608ccedad544a7e9cf80768153b593eb526cbe27b0a3fcd25c997501f22c320f
BLAKE2b-256 checksum
How to use checksums
3b16e87144ffa000d7639b24244ba8522973afbcdee45364188d342f03fb08b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 21, 2026.

Transparency log

Security for viio-sync-api-sdk 0.4.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for viio_sync_api_sdk-0.4.0.tar.gz

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 Sep 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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