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.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 wraith-sas-lineage 0.4.0
File Size Uploaded Provenance Actions
wraith_sas_lineage-0.4.0.tar.gz 163.2 kB Without provenance Details for wraith_sas_lineage-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 218.9 kB

Release files / wraith_sas_lineage-0.4.0.tar.gz

Download URL wraith_sas_lineage-0.4.0.tar.gz
Size 163.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6ab4aa060342fbc635f1741b118ea4af1de490d18f8f9edc7e82e4d27948cde8
BLAKE2b-256 checksum
How to use checksums
fe4bae4c98543b911a4a8e8f9f9e5dd667dd70d73128036b4fb4d42ec40f47d7
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.4.0-py3-none-any.whl

Download URL wraith_sas_lineage-0.4.0-py3-none-any.whl
Size 55.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a0faa4558ff2d9f1339cb8e65e23766e8a813e94007c13bc976445b2b5fb03d
BLAKE2b-256 checksum
How to use checksums
3e26cd950e68b24f76196f3f5f0486e1952dd2e2a5ef8bf5c3057f03c774efe4
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.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.

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