---
title: Python SDK
description: Install and use the official Sudomimus Python packages.
editUrl: true
head: []
template: doc
sidebar:
  order: 3
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

import { CardGrid, LinkCard } from "@astrojs/starlight/components";
import SdkCapabilityTable from "../../../../components/SdkCapabilityTable.astro";

The Python SDK is a `uv` workspace with one package per public API surface. The packages require Python 3.11 or later.

## Packages

<SdkCapabilityTable language="python" locale="en-us" />

Until a package is marked **Published** above, consume it from a checked-out SDK repository rather than assuming it is available from PyPI.

## Connect and Session

```python
from sudomimus_connect import ConnectClient, ConnectClientAuthWithKey
from sudomimus_session import SessionClient

connect = ConnectClient(client_auth=ConnectClientAuthWithKey(
    application_anchor="your-app-anchor",
    private_key_pem=private_key_pem,
))
session = SessionClient()
```

Connect starts and redeems the browser inquiry. Session owns refresh, introspection, logout, and revoke-all after a flow issues tokens. Keep the client-auth private key and refresh tokens on the server.

For Django applications, prefer the [Django framework SDK](/en-us/frameworks/django/), which owns the callback and token-rotation plumbing.

## Device and Native

Use `sudomimus-device` for public clients that cannot hold a client secret. Use `sudomimus-native` to exchange Steam tickets, AccessKeys, or signed public-key assertions. Both return ordinary Sudomimus tokens that continue through `sudomimus-session`.

## Source

<CardGrid>
<LinkCard title="Python packages" description="Source, tests, and package README files." href="https://github.com/sudomimus/sudomimus/tree/master/sdks/python/packages" />
<LinkCard title="Python examples" description="Runnable Connect and Session examples." href="https://github.com/sudomimus/sudomimus/tree/master/examples/python" />
</CardGrid>