Skip to main content

Async Python bindings for the Rust-based Lattix SDK core

Project description

Lattix Python SDK

Async Python bindings for the Rust-based Lattix SDK core.

The public Lattix docs at https://lattix.io/docs intentionally stay focused on platform concepts and tenant/operator guidance. Per-language SDK reference material is distributed with each SDK package, so this README is part of the supported Python reference surface.

Overview

This package targets the lattix-platform-api SDK control-plane contract and exposes async methods for the metadata-only zero-trust flows:

  • capabilities()
  • whoami()
  • bootstrap()
  • protection_plan(...)
  • policy_resolve(...)
  • key_access_plan(...)
  • artifact_register(...)
  • evidence(...)

Python stays thin: the Rust core owns HTTP, auth header shaping, and platform contract behavior.

What ships in this repo

  • lattixsdk.client.LattixClient — async wrapper over the native Rust binding
  • lattixsdk.binding.RustBinding — low-level ctypes bridge to the Rust SDK core
  • lattixsdk.models — Pydantic models mirroring the /v1/sdk/* control-plane contract
  • examples/example.ipynb — notebook example using the current bootstrap flow

Installation

Official wheel install

Supported wheels bundle the matching native sdk-rust shared library for the target platform, so a normal wheel install is enough:

pip install lattix-sdk-python

The import package remains lattixsdk.

Source and editable installs

Source installs remain supported for local development and constrained environments, but they require a separately built matching sdk-rust native library.

Build sdk-rust first:

cd ../sdk-rust
cargo build --release

Then either:

  • set LATTIX_SDK_RUST_LIB to the compiled library path; or
  • stage the native library into this package before building a wheel with python tools/stage_native_library.py.

The canonical C ABI lives in sdk-rust/include/lattix_sdk.h; this package intentionally does not maintain a second handwritten header.

Quickstart

import asyncio
from lattixsdk import LattixClient


async def main() -> None:
    async with LattixClient(
        base_url="https://api.lattix.io",
        bearer_token="replace-me",
        tenant_id="tenant-a",
        user_id="user-a",
    ) as client:
        bootstrap = await client.bootstrap()
        print(bootstrap.enforcement_model)


asyncio.run(main())

Design notes

  • The SDK is aligned to the embedded-enforcement model: applications protect data locally and only send metadata to the platform.
  • The async API is implemented by running the native Rust calls in an executor, so callers can integrate it cleanly into async Python services.
  • Pydantic models live under lattixsdk.models and mirror the platform-api SDK contract.

Testing

Unit tests use a fake binding, so they run without the native library:

pip install -e .[test]
pytest

Native smoke tests are included as well. They auto-skip if the Rust library has not been built yet, and they run a real Rust-backed client against a local in-process HTTP server when the native artifact is present.

Local quality gate

Run the local quality gate before committing when you want automated fixes, security scans, tests, package builds, wheel-install smoke coverage, and cleanup in one step:

./precommit.sh

On Windows:

./precommit.ps1

The gate applies automated fixes first, then runs linting, SAST, secret scanning, tests, package builds, and an installed-wheel smoke test in a temporary virtual environment.

To wire the same checks into local Git commits and pushes:

./install-hooks.sh

or:

./install-hooks.ps1

The installed pre-commit hook runs a faster version of the gate; the installed pre-push hook runs the full gate.

Release process

Maintainer release notes live in RELEASING.md. The publish workflow supports a TestPyPI rehearsal path through trusted publishing before the first real PyPI publish.

License

Distributed under the proprietary Lattix SDK License in LICENSE.

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

lattix_sdk_python-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distributions

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

lattix_sdk_python-0.1.0-py3-none-win_amd64.whl (1.3 MB view details)

Uploaded Python 3Windows x86-64

lattix_sdk_python-0.1.0-py3-none-manylinux_2_39_x86_64.whl (1.6 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

lattix_sdk_python-0.1.0-py3-none-macosx_11_0_universal2.whl (1.4 MB view details)

Uploaded Python 3macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file lattix_sdk_python-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for lattix_sdk_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2cca37944c3f86809835f5ddc71304835c0c711aa273bb23917c47579224b2e4
MD5 934aeba0201bf88a1f03c653d93aa248
BLAKE2b-256 88ab5fc831b1a7b5a3d082b5ed43541918b11ca345c24599e48ab0bf8af73ea2

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattix_sdk_python-0.1.0.tar.gz:

Publisher: pypi.yml on LATTIX-IO/sdk-python

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

File details

Details for the file lattix_sdk_python-0.1.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for lattix_sdk_python-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 56f6a0340e15bcd38c5902fd5bde3c3fe72fa82b96f9bcc2626f8d3a1ed6f458
MD5 27900d8d713091349b4588ab4c8931e9
BLAKE2b-256 4bd120070411975eddfe5abc2ced6d75539365b7e82ff5d462b33c98c2a78944

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattix_sdk_python-0.1.0-py3-none-win_amd64.whl:

Publisher: pypi.yml on LATTIX-IO/sdk-python

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

File details

Details for the file lattix_sdk_python-0.1.0-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for lattix_sdk_python-0.1.0-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 fc91fea179b3e2ae152fbd979323ebe1d0d0c1b4537c6b1f7f8856451dc88d9c
MD5 cc6bd343d73eb9b440549f7ec26a448e
BLAKE2b-256 6cbc1705880d4e66916c5019099b43af8f69d8990b3c472d656e813b700fd55a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattix_sdk_python-0.1.0-py3-none-manylinux_2_39_x86_64.whl:

Publisher: pypi.yml on LATTIX-IO/sdk-python

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

File details

Details for the file lattix_sdk_python-0.1.0-py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for lattix_sdk_python-0.1.0-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 847c66b06a100d1a9283f367feb7ebe53786f0bede98174d750d6628b1641935
MD5 2f3a777af5974e29d9d27f0a0efdb2c4
BLAKE2b-256 b80d0cf43fc822221fd640f09fc5b6392b58271bcc4f369f91c05ffd7a98b7ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattix_sdk_python-0.1.0-py3-none-macosx_11_0_universal2.whl:

Publisher: pypi.yml on LATTIX-IO/sdk-python

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