Sequence Method Engine — core validators, regression diff_report, and ingestion-pipeline base classes. Consumed by Scriptura SaaS and any other SME wrapper.
Project description
sme-core
Sequence Method Engine — core validators, regression diff_report, and ingestion-pipeline base classes.
sme-core is the Python runtime library for the Sequence Method Engine (SME). It packages canonical JSON schemas, schema validation, the §7.2.6 regression diff_report, and the abstract ingestion pipeline base used by P1 (PubMed), P2 (FDA), P3 (DEA), P4 (503A bulks), and future wrapper-defined pipelines.
Companion package: @scripturahealth/sme-schemas ships the same schemas as TypeScript types for the Scriptura SaaS frontend.
Install
pip install sme-core
Requires Python ≥ 3.10.
Usage
Validate a document
from sme_core import SchemaValidator
v = SchemaValidator()
errors = v.validate(my_compound_dict, schema_name="compound")
if errors:
for e in errors:
print(".".join(str(p) for p in e.absolute_path), "→", e.message)
Regression diff_report
from sme_core import generate_diff_report
report = generate_diff_report(
baseline_protocol_json=old,
new_protocol_json=new,
baseline_id="2025-12-14-sabrina-v2.3",
baseline_generated_at="2025-12-14T18:32:00Z",
)
print(report.drift_verdict) # no_clinical_drift | clinical_drift_detected
print(report.requires_eric_approval_before_ship)
Build an ingestion pipeline
from sme_core import IngestionPipeline, RegulatoryRecord, ReviewQueueItem
class PubMedPipeline(IngestionPipeline):
name = "p1_pubmed"
def fetch(self, since):
# call PubMed E-utilities, return raw items
...
def transform(self, raw_items):
records = [...] # list[RegulatoryRecord]
review_items = [...] # list[ReviewQueueItem]
return records, review_items
p = PubMedPipeline(
cursor_loader=lambda: db.get_cursor("p1_pubmed"),
cursor_saver=lambda v: db.set_cursor("p1_pubmed", v),
record_sink=db.append_regulatory_records,
review_queue_sink=webhook_to_wrapper,
)
result = p.run()
CLI tools
sme-validate path/to/doc.json --schema compound
sme-diff-report baseline.json new.json
sme-diff-report exits 1 when clinical drift is detected — designed for CI gating.
Versioning
The package version tracks the SME schema_version. Tagging the repo v1.1.0 publishes both sme-core==1.1.0 and @scripturahealth/sme-schemas@1.1.0.
License
UNLICENSED — internal Scriptura Health distribution.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sme_core-1.4.1.tar.gz.
File metadata
- Download URL: sme_core-1.4.1.tar.gz
- Upload date:
- Size: 40.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c8e4963177e24f29d44a6b431bce580767739e347a83115c759016caa0034c4
|
|
| MD5 |
ece9546384403e91e9a07785a3b6bbfb
|
|
| BLAKE2b-256 |
20ef86e974365ac351b988af97f733b422de2908081ee61636e597dcd6f73b0a
|
Provenance
The following attestation bundles were made for sme_core-1.4.1.tar.gz:
Publisher:
ci.yml on Scripturahealth/sequence-method-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sme_core-1.4.1.tar.gz -
Subject digest:
2c8e4963177e24f29d44a6b431bce580767739e347a83115c759016caa0034c4 - Sigstore transparency entry: 1820418097
- Sigstore integration time:
-
Permalink:
Scripturahealth/sequence-method-engine@63f1b8284dada416dd223144dfd9e7be81b6cfdc -
Branch / Tag:
refs/tags/v1.4.1 - Owner: https://github.com/Scripturahealth
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@63f1b8284dada416dd223144dfd9e7be81b6cfdc -
Trigger Event:
push
-
Statement type:
File details
Details for the file sme_core-1.4.1-py3-none-any.whl.
File metadata
- Download URL: sme_core-1.4.1-py3-none-any.whl
- Upload date:
- Size: 45.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2da7afba682f08a060a9b56ba8b7e38e81f7110f7303d7d6a1ea239ffbf2395d
|
|
| MD5 |
d709b752dd3d5b5a95c025b9a4788d77
|
|
| BLAKE2b-256 |
6f8e4bbea932ded0bfc688a94dcf347a633e607899fd7ed4cdc31b43abe59238
|
Provenance
The following attestation bundles were made for sme_core-1.4.1-py3-none-any.whl:
Publisher:
ci.yml on Scripturahealth/sequence-method-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sme_core-1.4.1-py3-none-any.whl -
Subject digest:
2da7afba682f08a060a9b56ba8b7e38e81f7110f7303d7d6a1ea239ffbf2395d - Sigstore transparency entry: 1820418135
- Sigstore integration time:
-
Permalink:
Scripturahealth/sequence-method-engine@63f1b8284dada416dd223144dfd9e7be81b6cfdc -
Branch / Tag:
refs/tags/v1.4.1 - Owner: https://github.com/Scripturahealth
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@63f1b8284dada416dd223144dfd9e7be81b6cfdc -
Trigger Event:
push
-
Statement type: