Install & Compatibility
Where this runs
tested against v1.9.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.248s · 38.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.0s · import 0.220s · 38MB
36MB installed
● package 36MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SciToken
✓ from scitokens import SciToken
Enforcer
✓ from scitokens import Enforcer
Create and serialize an unprotected SciToken using an issuer and key ID.
import scitokens
import os
token = scitokens.SciToken(
issuer=os.environ.get('SCITOKENS_ISSUER', 'https://example.com/'),
key_id='rsa_key',
)
token.update_claims({'sub': 'user123', 'scope': 'read:/data'})
serialized = token.serialize(serialization_type='unprotected')
print(serialized)
scitokens-admin --version
Errors
Common errors & fixes
ImportError: cannot import name 'SciToken' from 'scitokens'
Older versions of scitokens placed SciToken under scitokens.scitokens; newer versions export directly from scitokens.
fixUse 'from scitokens import SciToken' with version >=1.0.0.
scitokens.exceptions.TokenValidationError: Token has expired
The token's expiration claim ('exp') is in the past or not properly set.
fixEnsure the token's 'exp' claim is set to a future time. For example: token.update_claims({'exp': int(time.time()) + 3600}). Upgrade
Version history
1.9.7latest on PyPI · released Mar 13, 2026
Audit
Dependencies
No dependency data recorded yet.