Skip to main content

stare

Python library and CLI for the CERN ATLAS Glance/Fence API.

Actions Status Documentation Status PyPI version

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
stare analysis search -q 'shortTitle = "Phase Closed"'

# 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 confnote get ATLAS-CONF-2024-001
stare pubnote get ATL-PHYS-PUB-2024-001

# Plots
stare plot search --query 'referenceCode = PLOT-MUON-2018-08'
stare plot get PLOT-MUON-2018-08

# List metadata
stare leadinggroups search
stare subgroups search

# 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
result = g.analyses.search(query="referenceCode = ANA-HION-2018-01")
print(f"Found {result.number_of_results} analyses")
for analysis in result.results:
    print(analysis.reference_code, analysis.short_title)

# Search papers
paper_result = g.papers.search(query="referenceCode = HDBS-2018-33")
print(f"Found {paper_result.number_of_results} papers")
for paper in paper_result.results:
    print(paper.reference_code, paper.short_title)

# Fetch individual records (search-based under the hood)
analysis = g.analyses.get("ANA-HION-2018-01")
paper = g.papers.get("HDBS-2018-33")
conf_note = g.confnotes.get("ATLAS-CONF-2024-001")
pub_note = g.pubnotes.get("ATL-PHYS-PUB-2024-001")
plot = g.plots.get("PLOT-MUON-2018-08")
leadinggroups = g.leadinggroups.search(query="name = SUSY")

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stare-0.5.0.tar.gz (237.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stare-0.5.0-py3-none-any.whl (84.3 kB view details)

Uploaded Python 3

File details

Details for the file stare-0.5.0.tar.gz.

File metadata

  • Download URL: stare-0.5.0.tar.gz
  • Upload date:
  • Size: 237.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for stare-0.5.0.tar.gz
Algorithm Hash digest
SHA256 532cc5329fe1ec3785c1323585026285ff740f43188cc6a3fbb1b0600ec6d0c5
MD5 ae21f920f7e40a2dc5160fe09459c182
BLAKE2b-256 7e99fa69206b1872f1e7aa0148cc4a7263e56286ed8b7935dfd0890453ad797c

See more details on using hashes here.

Provenance

The following attestation bundles were made for stare-0.5.0.tar.gz:

Publisher: cd.yml on kratsg/stare

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stare-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: stare-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 84.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for stare-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12819a638a2ba0564c1c045b09b0946b2d165b93327ed30464a1dadb185045e6
MD5 6def953a214e7708502dda7ba3a438e6
BLAKE2b-256 e60d6ff3132d44f2e42d44c435b108eb36151adff0491016cc064c9ad84737b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for stare-0.5.0-py3-none-any.whl:

Publisher: cd.yml on kratsg/stare

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page