Python library and CLI for the CERN ATLAS Glance/Fence API
Project description
stare
Python library and CLI for the CERN ATLAS Glance/Fence API.
Installation
python -m pip install stare
Authentication
stare uses PKCE (no passwords stored). Run once to authenticate:
stare auth login
Your browser will open CERN SSO. After approval, tokens are stored locally and refreshed automatically.
CLI usage
# Search analyses — Rich table in terminal, JSON when piped
stare analysis search
stare analysis search --query 'referenceCode = ANA-HION-2018-01'
stare analysis search -q 'keywords contain Higgs' --limit 20
# Pipe to jq for field selection (JSON is auto-emitted)
stare analysis search | jq '.results[].referenceCode'
stare analysis search -q 'referenceCode contain HION' \
| jq -r '.results[] | select(.status == "Active") | .referenceCode'
# Search papers
stare paper search --query 'referenceCode = HDBS-2018-33'
# Get individual resources
stare analysis get ANA-HION-2018-01
stare paper get HDBS-2018-33
# CONF notes / PUB notes
stare conf-note ATLAS-CONF-2024-001
stare pub-note ATL-PHYS-PUB-2024-001
# List metadata
stare groups
stare subgroups
# Auth management
stare auth login
stare auth logout
stare auth status
# Cache management
stare cache info
stare cache clear --yes
Output is a Rich table when stdout is a terminal and JSON when piped or
redirected. Use --json / --no-json to override. Commands that expose
--no-cache bypass the 8-hour on-disk response cache for that invocation.
Library usage
from stare import Glance
g = Glance()
# Search analyses (currently live)
result = g.analyses.search(query="referenceCode = ANA-HION-2018-01")
print(f"Found {result.total_rows} analyses")
for analysis in result.results:
print(analysis.reference_code, analysis.short_title)
# Search papers (currently live)
paper_result = g.papers.search(query="referenceCode = HDBS-2018-33")
print(f"Found {paper_result.total_rows} papers")
for paper in paper_result.results:
print(paper.reference_code, paper.short_title)
# Individual resource lookups (available as API endpoints go live)
analysis = g.analyses.get("ANA-HION-2018-01")
paper = g.papers.get("HDBS-2018-33")
groups = g.groups.list()
Use as a context manager for explicit connection lifecycle:
with Glance() as g:
result = g.analyses.search(query="status = Active")
Inject a token directly (useful in CI/automated scripts):
g = Glance(token="your-access-token")
Configuration
Override defaults via environment variables:
| Variable | Default |
|---|---|
STARE_BASE_URL |
https://atlas-glance.cern.ch/atlas/analysis/api |
STARE_CLIENT_ID |
stare |
STARE_AUTH_URL |
CERN Keycloak auth endpoint |
STARE_TOKEN_URL |
CERN Keycloak token endpoint |
STARE_CALLBACK_PORT |
8182 (must match Keycloak registration) |
Development
git clone https://github.com/kratsg/stare
cd stare
pixi install
pixi run pre-commit-install
pixi run stare auth login
pixi run test
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stare-0.3.0rc0.tar.gz.
File metadata
- Download URL: stare-0.3.0rc0.tar.gz
- Upload date:
- Size: 146.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6ba8fd29c1d4dcb2434b06a02a057ee3584abdc40e614490e36d6d26f45ed44
|
|
| MD5 |
489a105fddeb3352fa0cd46c57122112
|
|
| BLAKE2b-256 |
67a88e314e24ce8781c703c38fabc3006e5e7dc6060261e73aca217b15278b05
|
Provenance
The following attestation bundles were made for stare-0.3.0rc0.tar.gz:
Publisher:
cd.yml on kratsg/stare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stare-0.3.0rc0.tar.gz -
Subject digest:
f6ba8fd29c1d4dcb2434b06a02a057ee3584abdc40e614490e36d6d26f45ed44 - Sigstore transparency entry: 1339984693
- Sigstore integration time:
-
Permalink:
kratsg/stare@4007164359aad8a74e6e4b95a69df3a17f98e2e4 -
Branch / Tag:
refs/tags/v0.3.0rc0 - Owner: https://github.com/kratsg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@4007164359aad8a74e6e4b95a69df3a17f98e2e4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file stare-0.3.0rc0-py3-none-any.whl.
File metadata
- Download URL: stare-0.3.0rc0-py3-none-any.whl
- Upload date:
- Size: 59.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9349e4f5e12022d72b8bcd07afa302d9db505999feaa0ea2d3cde21c6d8eae40
|
|
| MD5 |
adc99429de5f67a68a539cdce4ffb86a
|
|
| BLAKE2b-256 |
8cb607fe13e487d4cfbe6fcb5ae9a8d5384e282d94885e9b2c4f5281a1a47b0d
|
Provenance
The following attestation bundles were made for stare-0.3.0rc0-py3-none-any.whl:
Publisher:
cd.yml on kratsg/stare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stare-0.3.0rc0-py3-none-any.whl -
Subject digest:
9349e4f5e12022d72b8bcd07afa302d9db505999feaa0ea2d3cde21c6d8eae40 - Sigstore transparency entry: 1339984695
- Sigstore integration time:
-
Permalink:
kratsg/stare@4007164359aad8a74e6e4b95a69df3a17f98e2e4 -
Branch / Tag:
refs/tags/v0.3.0rc0 - Owner: https://github.com/kratsg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@4007164359aad8a74e6e4b95a69df3a17f98e2e4 -
Trigger Event:
release
-
Statement type: