Skip to main content

outfigure

The Python client for the OutFigure API.

OutFigure keeps three things apart for a learning platform: what a learner did with help, what they did without it, and whether a change to the teaching moved the second. This package sends your learning events and outcomes to the API and reads back evidence, learner states and Outcome Receipts.

The hosted API is a sandbox for invited partners, with test data only. To ask about a pilot, write to hello@outfigure.in.

Install

pip install outfigure

Python 3.11 or later. The client uses the standard library only, so it brings no other packages with it. Use it on your server: an API key never belongs in a browser.

Send an event and read the evidence

import os
from datetime import datetime, timezone

from outfigure import OutFigure

client = OutFigure(
    api_key=os.environ["OUTFIGURE_API_KEY"],
    base_url="https://console.outfigure.in",
)

receipt = client.events.send(
    {
        "schema_version": "1.0",
        "event_id": "evt_demo_0001",
        "event_type": "response",
        "learner_id": "learner_demo_01",
        "occurred_at": datetime.now(timezone.utc).isoformat(),
        "source": "partner_backend",
        "session_id": "session_demo_01",
        "item_id": "question_012",
        "item_version": "1",
        "attempt_id": "attempt_demo_01",
        "attempt_number": 1,
        "response_kind": "binary",
        "correct": True,
        "assistance": "none",
        "hint_count": 0,
        "feedback_seen": False,
    },
    idempotency_key="demo-send-0001",
)

client.jobs.wait(receipt["job_ids"], timeout=15)
state = client.learners.state("learner_demo_01")

One response is thin evidence. A learner's state on a concept stays insufficient_evidence until it has at least five eligible attempts across two sessions, and missing data is never turned into a score.

Ask what the evidence supports doing next

# For each version in a fair test: release it, hold it back, have a person
# decide, or don't release it. Advice for your release process.
check = client.experiments.release_check("exp_contrast")
for version in check["versions"]:
    print(version["arm"], version["decision"])

# For one learner and one skill: check them first, use a tested version, or run
# an experiment. Needs the suggestions:read scope, and says "disabled" until an
# owner turns suggestions on for a sandbox project.
step = client.learners.next_step("learner_demo_01", "fractions.add")

Both are fixed, versioned rules (release-gate-v1, next-step-v1) that no study has yet validated, and each answer says so. Nothing is sent to a learner.

How it behaves

  • Fields use the API's own names (learner_id, item_version), and requests and responses are typed as TypedDicts in outfigure.types.
  • Network failures and 429, 502, 503 and 504 are retried at most three times, with the same body and idempotency key, honouring Retry-After. Other errors are raised as ApiError with the code, status and request ID.
  • No telemetry, no background work, no local copy of learner data.

The full reference, with every route and scope, is at outfigure.in/developers.

Licence

MIT. This covers the client only; the OutFigure service is not open source.

Metadata

Release files for outfigure 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for outfigure 0.4.0
File Size Uploaded Provenance Actions
outfigure-0.4.0.tar.gz 42.8 kB With provenance Details for outfigure-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for outfigure 0.4.0
File Interpreter ABI Platform Actions
outfigure-0.4.0-py3-none-any.whl Python 3 none any Details for outfigure-0.4.0-py3-none-any.whl

Total release size: 76.4 kB

Release files / outfigure-0.4.0.tar.gz

Download URL outfigure-0.4.0.tar.gz
Size 42.8 kB
Tags Source
SHA-256 checksum
How to use checksums
14075e95944c4e533d01b5f3ed6d71937fe790942df5441c91fc5c0d3c93355e
BLAKE2b-256 checksum
How to use checksums
29a489b9ee389774f05a0d0244154107c2ed88159af9d37b1a6da9379420d4a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Nov 30, 2026.

Transparency log

Release files / outfigure-0.4.0-py3-none-any.whl

Download URL outfigure-0.4.0-py3-none-any.whl
Size 33.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3efc144263b5e27497332e6574007721cd6e00419e9c77a9d24f031c53a1c6c0
BLAKE2b-256 checksum
How to use checksums
50a4053913c2113f5eb9f7eff1bb66f7d4e3f79c6684e5a70a3b8eff46595eec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Nov 30, 2026.

Transparency log

Security for outfigure 0.4.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for outfigure-0.4.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 Nov 30, 2026.

Transparency log

A 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.

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