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.3.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.3.0
File Size Uploaded Provenance
viio_sync_api_sdk-0.3.0.tar.gz 32.2 kB With provenance Details

Built distribution (wheel)

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

Total release size: 78.9 kB

Release files / viio_sync_api_sdk-0.3.0.tar.gz

Download URL viio_sync_api_sdk-0.3.0.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e25c7615e41a7c5eeed9a61d58ae852cff51e226e548db0b54c9c893c6cb469d
BLAKE2b-256 checksum
How to use checksums
7422a80d472a03f8f2dc1fd44d2f9ae89a5d132e5a7e65667c5b6139ec571015
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 8, 2026.

Transparency log

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

Download URL viio_sync_api_sdk-0.3.0-py3-none-any.whl
Size 46.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f4562f28e1beffb14386a4c6a7e78ad24233564e97b96f89b4190f6ca4b01ec
BLAKE2b-256 checksum
How to use checksums
9cac83611f17a705791e6f47d8bff05a14b148b0aedbf70814c4829aced0cbc8
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 8, 2026.

Transparency log

Security for viio-sync-api-sdk 0.3.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.3.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 8, 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