Skip to main content

Documentation License Python

👻 wraith-sas-lineage

SAS Lineage Extraction for the Ghost Stack

wraith-sas-lineage extracts data lineage from SAS DI Studio code and verbose execution logs, maps it to Open Data Contract Standard (ODCS) contracts, and serves a local lineage explorer. One JSON artefact connects all three tools.

Designed for large SAS estates running on Unix. Output feeds wraith-modelgen to auto-generate dbt on BigQuery.


Three tools. One seam.

.sas + .log files
      │
      ▼
  sas-parse  ──►  provenance.json
                       │
                       ▼
                   sas-map  ──►  lineage.db  +  ODCS contracts  +  gaps report
                                     │
                                     ▼
                                  sas-ui  ──►  localhost:5000
Command Input Output
sas-parse .sas files + verbose logs provenance.json
sas-map provenance.json lineage.db, ODCS YAML contracts, mapping_gaps.json, lineage_diff.json
sas-ui lineage.db Local lineage explorer

Install

uv tool install wraith-sas-lineage

Or for development:

git clone https://git.thomaspeoples.com/thomaspeoples/wraith-sas-lineage.git
cd wraith-sas-lineage
uv run poe setup

Quick start

# Parse SAS code + logs
sas-parse \
  --code-dir /path/to/sas/code \
  --log-dir  /path/to/verbose/logs \
  --estate   acme-sales \
  --output   provenance.json

# Map to DB + ODCS contracts
sas-map \
  --provenance provenance.json \
  --db         lineage.db \
  --contracts-dir contracts/ \
  --gaps       mapping_gaps.json

# Browse lineage
sas-ui --db lineage.db
# → http://localhost:5000/flags      all extraction flags
# → http://localhost:5000/provenance upstream chain for a column
# → http://localhost:5000/lineage    downstream to all MARTs

Design principles

Flag-never-drop. Unresolved macros, remote execution blocks, and hand-written code surface as Flag objects with reason, context, and snippet. Nothing is silently discarded.

Log-first macro resolution. SYMBOLGEN/MLOGIC log lines resolve &macro_var references before falling back to the code literal. Accurate lineage for DI Studio estates requires verbose logs.

Single seam. provenance.json is the only interface between tools. Each tool is independently runnable and testable.

Content-hashed stable IDs. Table, column, job, and lineage chain IDs are SHA-256[:12] of their canonical string. Same estate, same run, same IDs.


Layer vocabulary

SAS layer Schema value
RAW RAW
ODS ODS
STG STG
MART MART

Developer quality gate

uv run poe test       # pytest (interactive)
uv run poe test-ci    # pytest + coverage ≥ 80%
uv run poe lint       # ruff check
uv run poe format     # ruff format
uv run poe docs-serve # mkdocs at localhost:8000

All commits go through commitizen:

uv run cz commit

Part of the Ghost Stack. Sovereign. Self-hosted. No nonsense.

Metadata

Release files for wraith-sas-lineage 0.5.1

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

Source distribution (sdist)

Source distribution for wraith-sas-lineage 0.5.1
File Size Uploaded Provenance Actions
wraith_sas_lineage-0.5.1.tar.gz 167.4 kB Without provenance Details for wraith_sas_lineage-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wraith-sas-lineage 0.5.1
File Interpreter ABI Platform Actions
wraith_sas_lineage-0.5.1-py3-none-any.whl Python 3 none any Details for wraith_sas_lineage-0.5.1-py3-none-any.whl

Total release size: 223.0 kB

Release files / wraith_sas_lineage-0.5.1.tar.gz

Download URL wraith_sas_lineage-0.5.1.tar.gz
Size 167.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2b176ce9ca86bc4732931745b5f188e8fccaf261d0c330b7e1126583e86444a4
BLAKE2b-256 checksum
How to use checksums
597b1062559baa528491c40409cc90711cf7b531ae2d06a6cd05bc3de037daa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / wraith_sas_lineage-0.5.1-py3-none-any.whl

Download URL wraith_sas_lineage-0.5.1-py3-none-any.whl
Size 55.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ff2a4d74318e3483742a638ca7e4dd7f8e45fd98195b3b4c85f170aa14699e5
BLAKE2b-256 checksum
How to use checksums
57d94e3806e1cec38d29280853919baf14203af0728a7da0d7e38bd94e6bd762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for wraith-sas-lineage 0.5.1

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.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files No provenance

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