Survey Scribe
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: The source tree declares version
0.1.0and contains the publicSurveyScribeAPI, conversion CLI, typed models, source and provider adapters, transactional artifacts, andQuestionnaireRouter. No approved PyPI release is currently available.
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.typedmarker 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
After publication is approved, install the base schema package 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.
- Documentation website
- DeepWiki project guide
- Extraction guide
- Completed questionnaires
- Skip patterns
- Palantir Foundry
- mAI Factory
- AI providers
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.
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| survey_scribe-0.1.0.tar.gz | 378.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| survey_scribe-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 562.7 kB
Release files / survey_scribe-0.1.0.tar.gz
| Download URL | survey_scribe-0.1.0.tar.gz |
|---|---|
| Size | 378.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de6e75da32fa225fee6f2229125e348e982e50d2bece4ed84e401b56d33f432c
|
|
BLAKE2b-256 checksum How to use checksums |
d03ea1a8b7fce961c4bfd9d6975e4e7ef0fa5f2c798fa4b62a152ba6827a393e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.11
|
Release files / survey_scribe-0.1.0-py3-none-any.whl
| Download URL | survey_scribe-0.1.0-py3-none-any.whl |
|---|---|
| Size | 184.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38818dbc01ee70a2eb571294127fcc522c211f342a36dfc83b2ceee464801e92
|
|
BLAKE2b-256 checksum How to use checksums |
2c3fcae3502799aff084fa0acb75dabbbb0bfa6421f7da935e99f7b38a21cc76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.11
|
Security for survey-scribe 0.1.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.
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.