Skip to main content

sharp-sparc

Hosted statistical capability for identifying a compact predictive feature core in high-dimensional biological data.

sharp-sparc is the thin, official Python client for SPARC. It provides reproducible statistical discovery and decision boundaries for high-dimensional biological datasets ($P \gg N$).


3-Command CLI Quickstart

SPARC provides a fast, privacy-preserving command-line workflow:

pip install sharp-sparc
sharp-sparc login
sharp-sparc discover data.csv --target response --top-k 5
  • Authentication: sharp-sparc login uses Device Authorization first, with loopback PKCE fallback. The token is kept securely in your operating-system credential vault.
  • Privacy Gate: sharp-sparc discover runs aggregate preflight inspection locally, automatically excludes non-feature identifier columns (e.g. samples, patient_id), displays a summary, and requires interactive confirmation before any data is transmitted (or pass --approve-upload for automated scripts).

Python SDK Quickstart

You can also use the Python SDK directly without putting credentials in code:

from sharp_sparc import SPARC

# 1. Initialize client; it automatically uses the OS vault OAuth session
sparc = SPARC()

# 2. Discover predictive core signals from tabular data or files
result = sparc.discover_file(
    path="colon_alon1999.csv",
    target_column="response",
    top_k=10,
    approve_upload=True,
)

# 3. Inspect discovered core signals
for rank, signal in enumerate(result.core_signals, start=1):
    print(f"#{rank}: {signal.name} (relevance={signal.predictive_relevance:.4f})")

Service-key fallback

Use SPARC_API_KEY or SPARC(api_key="...") only for CI, servers, or a client that cannot complete OAuth. Treat it as a secret: keep it in a secret manager or the operating-system environment, never in source control or shared configuration.


Privacy Boundary and Local Preflight

SPARC enforces a strict privacy boundary:

  1. Local Metadata Inspection: Your dataset's dimensions, non-finite cell counts, and SHA256 digest are computed locally on your machine. Raw cell values and feature names never leave your environment during preflight.
  2. Explicit Caller Approval: Raw data uploads only after explicit caller approval using a server-issued signed URL (approve_upload=True). All remote uploads enforce TLS (https://) transport.

Granular REST Lifecycle

For production pipelines and workflow orchestrators, sharp-sparc exposes the full granular lifecycle:

from sharp_sparc import SPARC, inspect_dataset

client = SPARC()

# 1. Check account quota
account = client.get_account_status()
print(f"Tier: {account.tier}, Runs Remaining: {account.runs_remaining}")

# 2. Inspect aggregate metadata locally
metadata = inspect_dataset("data.csv", target_index=10)

# 3. Validate against tier limits (zero raw data sent)
preflight = client.preflight(metadata=metadata)

# 4. Stream upload with signed authorization
upload = client.upload_dataset(
    file_path_or_data="data.csv",
    preflight_token=preflight.upload_token,
    metadata=metadata,
)

# 5. Submit analysis with idempotency protection
receipt = client.submit_analysis(
    dataset_ref=upload.dataset_ref,
    target_column="target",
    top_k=10,
    idempotency_key="pipeline-run-2026-08-batch-1",
)

# 6. Poll status
status = client.poll_analysis(receipt.job_id)

# 7. Export standalone Python and C++ decision trees (Pro tier)
coretree = client.export_coretree(receipt.job_id)
print(coretree.python_source)

Async Client (AsyncSPARC)

import asyncio
from sharp_sparc import AsyncSPARC

async def main():
    async with AsyncSPARC() as client:
        account = await client.get_account_status()
        print(f"Account Tier: {account.tier}")

asyncio.run(main())

Canonical API Route Map

Operation Canonical REST Endpoint
Account Status GET /v1/account
Preflight Validation POST /v1/preflight
Upload Authorization POST /v1/datasets/uploads
Direct Data Upload PUT /v1/datasets/uploads/{dataset_id}
Upload Completion POST /v1/datasets/uploads/{dataset_id}/complete
Submit Analysis POST /v1/analyses (supports Idempotency-Key)
Poll Job Status GET /v1/analyses/{job_id}
Job Results GET /v1/analyses/{job_id}/result
Cancel Job POST /v1/analyses/{job_id}/cancel
Export CoreTree Code GET /v1/analyses/{job_id}/coretree

Hosted MCP Interface & Activation

SPARC is also available natively as a hosted Model Context Protocol (MCP) service over Streamable HTTP:

  • Endpoint: https://mcp.sharpmachine.ai/mcp
  • Preview Activation: Sign in at https://mcp.sharpmachine.ai/activate to activate a Preview account. OAuth-capable clients reconnect without a copied key; service keys are an explicit fallback for non-oauth clients.

Enforced Pricing & Usage Contract

  • Preview Tier (Free): 3 private analyses per UTC day; up to 616,100 matrix elements per analysis.
  • SPARC Pro Tier ($20/month): 20 private analyses per billing period; up to 2,000,000 matrix elements per analysis.
  • Zero Metering on Non-Compute Calls: Discovery, account status, preflight validations, and cached demo retrievals are always free. Only completed private analyses decrement quota.

Download files

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

Source Distribution

sharp_sparc-1.0.2.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

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

sharp_sparc-1.0.2-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file sharp_sparc-1.0.2.tar.gz.

File metadata

  • Download URL: sharp_sparc-1.0.2.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.0

File hashes

Hashes for sharp_sparc-1.0.2.tar.gz
Algorithm Hash digest
SHA256 aeb4055c97d64b707aea91e7e50bf3cf07fc881b5e70f59186c2f3caa2650b28
MD5 978342f59ee2ef47fe0339e42c0ed285
BLAKE2b-256 3b029b33343357c07a2376ed2eb815258ef3fbba1a5cd96c824fb61f8164b002

See more details on using hashes here.

File details

Details for the file sharp_sparc-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: sharp_sparc-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.0

File hashes

Hashes for sharp_sparc-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1812dc5c2b3348fd18da29afb5a55cf3f501db23c1c08949370a3a7650ec0158
MD5 43523ef31b118d9872b61cb07a3567e4
BLAKE2b-256 07754e18b5de225124d4b9121dcba99ba7de8c4b05f2917051fc61fe72478139

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.3

2 files

This release

1.0.2 This release

2 files

1.0.1

2 files

0.1.0

2 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