Signet Python SDK
Python SDK for Signet — OAuth 2.0 authentication and token management.
Installation
pip install go-signet
With framework support:
pip install go-signet[fastapi]
pip install go-signet[flask]
pip install go-signet[django]
Quick Start
from signet import authenticate
client, token = authenticate(
"https://auth.example.com",
"my-client-id",
scopes=["profile", "email"],
)
print(f"Access token: {token.access_token}")
Async Usage
from signet import async_authenticate
client, token = await async_authenticate(
"https://auth.example.com",
"my-client-id",
scopes=["profile", "email"],
)
Client Credentials (M2M)
from signet.discovery.client import DiscoveryClient
from signet.oauth import OAuthClient
from signet.clientcreds import TokenSource, BearerAuth
import httpx
disco = DiscoveryClient("https://auth.example.com")
meta = disco.fetch()
client = OAuthClient("my-service", meta.to_endpoints(), client_secret="secret")
ts = TokenSource(client, scopes=["api"])
# Auto-attaches Bearer token to every request
with httpx.Client(auth=BearerAuth(ts)) as http:
resp = http.get("https://api.example.com/data")
Middleware
FastAPI
from fastapi import FastAPI, Depends
from signet.middleware.fastapi import BearerAuth
from signet.middleware.models import TokenInfo
app = FastAPI()
auth = BearerAuth(oauth_client)
@app.get("/protected")
async def protected(info: TokenInfo = Depends(auth)):
return {"user": info.user_id}
Flask
from flask import Flask
from signet.middleware.flask import bearer_auth, get_token_info
app = Flask(__name__)
@app.route("/protected")
@bearer_auth(oauth_client)
def protected():
info = get_token_info()
return {"user": info.user_id}
Examples
Ready-to-run examples are in the examples/ directory:
| File | Description |
|---|---|
01_user_login.py |
Interactive user login — auto-selects browser or device code flow |
02_client_credentials.py |
M2M service authentication with auto-cached tokens |
03_fastapi_server.py |
FastAPI server with Bearer token validation and scope enforcement |
04_async_login.py |
Async user login via device code flow |
Set the required environment variables, then run with uv:
export SIGNET_URL="https://auth.example.com"
export CLIENT_ID="my-app"
uv run python examples/01_user_login.py
Development
make install # uv sync --all-extras
make test
make lint
make typecheck
License
MIT
Metadata
Release files for go-signet 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| go_signet-1.0.0.tar.gz | 96.4 kB | With provenance | Details for go_signet-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| go_signet-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for go_signet-1.0.0-py3-none-any.whl |
Total release size: 130.8 kB
Release files / go_signet-1.0.0.tar.gz
| Download URL | go_signet-1.0.0.tar.gz |
|---|---|
| Size | 96.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6900e8933ce29ae75bb625b50f5cef6f98caa02b65c3150e851973f3beb336fb
|
|
BLAKE2b-256 checksum How to use checksums |
c22eb5175bb66bd57aa1c440d328186eb3f7ab53c9a15005fad6d584d9f85a90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 4, 2026.
Transparency logRelease files / go_signet-1.0.0-py3-none-any.whl
| Download URL | go_signet-1.0.0-py3-none-any.whl |
|---|---|
| Size | 34.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0b1973151df70967ae29dfb30b4a1ae912652e58363bba026a650ddc3bb748a
|
|
BLAKE2b-256 checksum How to use checksums |
d42a6a5b97c66522cd6656932b01b63948e9c4d18dfb9a88a14504b22d0d1b0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 4, 2026.
Transparency logSecurity for go-signet 1.0.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.
Attestation for go_signet-1.0.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 Jul 4, 2026.
Transparency logA 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.