Skip to main content

Survey Scribe

CI Python 3.11-3.13 License: MIT

Survey Scribe converts local survey questionnaires to the typed Survey Variable Information Schema (SVIS). It provides synchronous, asynchronous, and batch APIs, provider adapters, safe local source normalization, deterministic chunking, questionnaire routing graphs, secure configuration, and versioned artifacts.

Alpha status: Survey Scribe 0.1.x is alpha software, with published releases available on PyPI. The package contains the public SurveyScribe API, conversion CLI, typed models, source and provider adapters, transactional artifacts, and QuestionnaireRouter.

Features

  • Typed SVIS models with Pydantic validation and JSON serialization.
  • Stable top-level imports for schema consumers.
  • Numeric, categorical, text, date, and other variable classifications.
  • Missing-category, source-provenance, confidence, and review metadata.
  • Local PDF, DOCX, XLSX, CSV, HTML, Markdown, and text normalization.
  • Token-aware chunking with stable overlap and table provenance.
  • Credential-safe configuration and versioned artifact manifests.
  • Source-grounded directed routing multigraphs with separate evidence and audit history.
  • Native XLSForm relevance and repeat routing without a provider call.
  • Caller-defined structured pipelines for completed-form records.
  • A PEP 561 py.typed marker for editor and type-checker support.
  • An installed CLI for single and batch conversion, configuration checks, provider listing, and deterministic routing-schema export.

The standard client extracts questionnaire instrument metadata. It does not produce respondent microdata, classify skipped answers, execute routing, or expand repeat instances.

Installation

Install the base package from PyPI with:

pip install survey-scribe

For development from this repository, use the locked environment:

uv sync --locked --python 3.11

Optional dependency groups are available for provider and document adapters:

pip install "survey-scribe[openai]"
pip install "survey-scribe[anthropic]"
pip install "survey-scribe[pdf]"
pip install "survey-scribe[tabular]"

The base package includes the CLI. Install provider and source extras required by the selected conversion path.

Quick Start

from datetime import date

from survey_scribe.sources import SourceRegistry

conversion = SourceRegistry.default().convert_for_svis(
    "questionnaire.xlsx",
    extraction_date=date.today(),
)
if conversion.svis is None:
    raise RuntimeError("The workbook is not a supported XLSForm")

review_codes = tuple(item.code for item in conversion.document.diagnostics)
if conversion.native is not None:
    review_codes += tuple(item.code for item in conversion.native.diagnostics)
if review_codes:
    raise RuntimeError(f"Review XLSForm diagnostics before use: {review_codes}")

survey = conversion.svis

This native XLSForm path makes no provider call. PDF, DOCX, and other questionnaire instruments use SurveyScribe with a configured provider.

Inspect the installed command without loading optional providers:

survey-scribe --help
survey-scribe --version
survey-scribe providers
survey-scribe config check
survey-scribe convert questionnaire.pdf --output-dir output
survey-scribe batch questionnaire-a.pdf questionnaire-b.xlsx --output-dir output
survey-scribe schema export routing > questionnaire-routing-graph-v1.0.json

Set credentials with environment variables or use --prompt-api-key / --prompt-bearer-token. The CLI writes sidecars and manifests by default, refuses existing artifacts unless --overwrite is present, and supports --strict when partial output must produce a nonzero exit. See the CLI guide and migration guide.

Documentation

The public website includes end-to-end questionnaire extraction, completed-form contracts, skip-pattern examples, Palantir Foundry deployment, Microsoft Foundry, mAI Factory, AI provider setup, artifacts, security, privacy, and generated API references.

uv run mkdocs serve

The local site is available at http://127.0.0.1:8000/ while the server runs. Pushes to main build and deploy the strict static site to GitHub Pages through .github/workflows/deploy-docs.yml.

Development

uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest tests/unit tests/characterization tests/test_schema.py \
  --cov=survey_scribe --cov-branch --cov-report=term-missing
uv run mkdocs build --strict
uv build
uv run twine check --strict dist/*

See CONTRIBUTING.md for fixture controls and pull request requirements. Security reports follow SECURITY.md.

Versioning

Survey Scribe uses PEP 440 and Semantic Versioning. The current static version is declared once in pyproject.toml; the runtime survey_scribe.__version__ value is read from installed distribution metadata. Release changes are recorded in CHANGELOG.md.

Authors

License

Survey Scribe is licensed under the MIT License. Package publication is a separate operational decision and remains gated.

Metadata

Release files for survey-scribe 0.1.2

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

Source distribution (sdist)

Source distribution for survey-scribe 0.1.2
File Size Uploaded Provenance
survey_scribe-0.1.2.tar.gz 378.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for survey-scribe 0.1.2
File Interpreter ABI Platform
survey_scribe-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 563.3 kB

Release files / survey_scribe-0.1.2.tar.gz

Download URL survey_scribe-0.1.2.tar.gz
Size 378.7 kB
Tags Source
SHA-256 checksum
How to use checksums
611b64ac3b98972ec5775c5f627036333fa4387f1efd9e3775b98c453fe5d860
BLAKE2b-256 checksum
How to use checksums
90f84e26948aa0a445a259ee0a2fef98428f2ea25481a2793321ec92cd2baba2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.11

Release files / survey_scribe-0.1.2-py3-none-any.whl

Download URL survey_scribe-0.1.2-py3-none-any.whl
Size 184.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3991d3ddb06cc690a3dc4a593d30a2a796a389f2ebd5fff41fd672096251431a
BLAKE2b-256 checksum
How to use checksums
6c6cfd6ada1b7e708b99481fee777eb0e3e27afae8d22b6a9a99ae2632e8a7ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.11

Security for survey-scribe 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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