Interactive Python SDK

Explore, test, and validate the S4 Ledger Python SDK. Hash, anchor, and verify defense records in your browser.

SDK Functions — click to load & run

hash_record()
SHA-256 hash
anchor_record()
Anchor to XRPL
verify_record()
Verify integrity
batch_anchor()
Multi-record batch
get_metrics()
Network stats
list_records()
All anchored
get_record_types()
Defense record catalog
ils_analysis()
ILS gap analysis
check_dmsms()
Obsolescence risk
calculate_readiness()
Ao/Ai MIL-STD
calculate_roi()
ROI projection
estimate_lifecycle_cost()
Total ownership cost
analyze_supply_chain_risk()
AI risk scoring
predict_maintenance()
AI failure prediction
calculate_compliance()
MIL-STD / FAR
generate_audit_report()
One-click audit
get_action_items()
Task queue
search_documents()
Standards library
store_in_vault()
Encrypted vault
analyze_submission()
Submissions Hub
scan_sbom()
SBOM Scanner

Code Editor

Python
Calls live API at /api/*
Output
Select an SDK function above to load code, then click "Run" to execute...

How It Works

Click any function box above to load & auto-run
Select a record type — classification auto-detected
Edit code freely, then Run
Anchored records appear on Metrics & Transactions
21 SDK functions • 54+ Navy record types • All branches
How S4 Ledger SDK Works — Technical Details

What's real: Every API call in this playground hits the live S4 Ledger REST API. Hashes are computed server-side via SHA-256. Anchor operations create real XRPL transactions on mainnet. The SDK code shown here is identical to what runs when installed via pip install s4-ledger-sdk.

What's demo: The $SLS token fee (0.01 per anchor) is live on mainnet. Each anchor costs 0.01 SLS, paid from the operational wallet to the treasury.

How S4 Ledger saves money here: Building custom integrations between logistics systems and blockchain typically costs $200K–$500K and takes 6–12 months. The S4 SDK provides a 3-line integration that works in minutes — reducing integration costs by 95%+ and enabling small contractors to adopt blockchain verification without dedicated engineering teams.

Production mode: Install via pip, configure with your API key, and integrate directly into existing Python workflows — CI/CD pipelines, ERP plugins, maintenance management systems, or batch processing scripts. The SDK handles all XRPL wallet management, transaction construction, and retry logic automatically.

Install the SDK

pip install s4-ledger-sdk

Requires Python 3.8+ and xrpl-py

SDK Quick Reference

Core Anchoring & Verification 6
hash_record()SHA-256 hash of record
anchor_record()Anchor hash to XRPL
verify_record()Verify against anchored hash
batch_anchor()Anchor multiple records
list_records()List all anchored records
get_record_types()Browse defense record types
ILS Analysis Tools 4
check_dmsms()Obsolescence risk analysis
calculate_readiness()Ao/Ai per MIL-STD-1390D
calculate_compliance()MIL-STD / FAR scoring
get_action_items()Task queue with severity
AI & Risk Intelligence 2
analyze_supply_chain_risk()AI risk scoring (35+ platforms)
predict_maintenance()AI predictive maintenance
Finance & Lifecycle 2
calculate_roi()S4 Ledger ROI projection
estimate_lifecycle_cost()Total ownership cost (DoD 5000.73)
Documents & Reporting 5
generate_audit_report()One-click audit reports (6 types)
analyze_submission()Submissions hub engine
scan_sbom()SBOM scanner & risk scan
search_documents()Defense standards library
store_in_vault()Encrypted audit vault storage

Live API Endpoints

Core Anchoring & Verification 5
/api/hashPOST — compute SHA-256
/api/anchorPOST — anchor record
/api/metricsGET — dashboard data
/api/transactionsGET — recent activity
/api/record-typesGET — all defense types
ILS Analysis Tools 4
/api/dmsmsPOST — obsolescence check
/api/readinessPOST — readiness calc
/api/compliancePOST — compliance scoring
/api/action-itemsGET — action item queue
AI & Risk Intelligence 2
/api/supply-chain-riskPOST — AI risk analysis
/api/predictive-maintenancePOST — failure prediction
Finance & Lifecycle 2
/api/roiPOST — ROI analysis
/api/lifecyclePOST — lifecycle cost
Documents & Reporting 5
/api/audit-reportsPOST — audit report gen
/api/iliePOST — submissions hub
/api/sbomPOST — SBOM scan & risk
/api/doc-libraryGET — standards lookup
/api/audit-vaultPOST — vault storage