Skip to main content

Fauthy Python SDK

A Python SDK for interacting with the Fauthy API.

Installation

pip install fauthy-python-sdk

Usage

Basic Setup

from fauthy_sdk import FauthyClient

# Initialize the client
client = FauthyClient(
    client_id="your_client_id",
    client_secret="your_client_secret"
)

Management API

The SDK provides access to the Fauthy Management API v1 endpoints.

Get Management Info

response = client.get_management_info()
print(response.json())

List Users

# Basic listing
response = client.list_users()

# With pagination and search
response = client.list_users(
    page=1,
    query="john",
    per_page=20
)

# With custom claims filtering
custom_claims = {
    "company": "Test Corp",
    "department": "Engineering"
}
response = client.list_users(
    page=1,
    query="",
    per_page=10,
    custom_claims_filter=custom_claims
)

Create User

response = client.create_user(
    email="user@example.com",
    first_name="John",
    last_name="Doe",
    roles=["role_uuid_1", "role_uuid_2"],
    custom_claims={
        "company": "Test Corp",
        "department": "Engineering"
    },
    mark_as_verified=True
)

Get User

response = client.get_user("user_uuid")

Update User

response = client.update_user(
    user_id="user_uuid",
    first_name="Jane",
    last_name="Smith",
    email="jane@example.com"
)

Delete User

response = client.delete_user("user_uuid")

Set User Password

response = client.set_user_password(
    user_id="user_uuid",
    password="new_secure_password"
)

List Roles

# Basic listing
response = client.list_roles()

# With pagination
response = client.list_roles(
    page=1,
    n_per_page=50
)

Custom Claims Filtering

The SDK supports filtering users by custom claims using the custom_claims_filter parameter in the list_users method. This allows you to filter users based on their custom JWT claims.

Example

# Filter users by company and department
custom_claims = {
    "company": "Test Corp",
    "department": "Engineering"
}

response = client.list_users(
    page=1,
    per_page=20,
    custom_claims_filter=custom_claims
)

This will send a request with query parameters like:

  • claim_company=Test Corp
  • claim_department=Engineering

The API will return only users whose custom claims match these values.

Error Handling

The SDK raises requests.exceptions.RequestException for HTTP errors. You can handle these exceptions to manage API errors:

import requests

try:
    response = client.get_user("user_uuid")
    print(response.json())
except requests.exceptions.RequestException as e:
    print(f"API Error: {e}")

Response Format

All methods return a requests.Response object. You can access the JSON data using:

response = client.list_users()
data = response.json()
print(f"Total users: {data['total']}")
print(f"Users: {data['items']}")

Metadata

Release files for fauthy-python-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 fauthy-python-sdk 0.3.0
File Size Uploaded
fauthy_python_sdk-0.3.0.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fauthy-python-sdk 0.3.0
File Interpreter ABI Platform
fauthy_python_sdk-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / fauthy_python_sdk-0.3.0.tar.gz

Download URL fauthy_python_sdk-0.3.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cbcfac2b85d41183e6e1010a789067a0ac3afd739368388e6a4c964c29b4d44c
BLAKE2b-256 checksum
How to use checksums
c967aae88159936451bbbba5b28fae9aadd9cf46005c821e403ff361b1810cff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Dec 3, 2025.

Transparency log

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

Download URL fauthy_python_sdk-0.3.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e61f017697efc0d25f6fb54ea18cd27a5e8da6468a5a8276bda86022628396f5
BLAKE2b-256 checksum
How to use checksums
bbde1aacde7f391f5427adae694e8e153183f91c5fc5592ff8d5b51a4da965d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Dec 3, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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