The official SDK for the OpenTrust Protocol, the open standard for auditable trust.
Project description
OpenTrust Protocol (OTP) Python SDK
🚀 CI/CD Active: Automated testing, linting, security audits, and PyPI publishing
The Open Standard for Auditable Trust
This is the official Python SDK for the OpenTrust Protocol (OTP). It enables developers to create, manipulate, and fuse Neutrosophic Judgments to build more transparent, robust, and auditable systems.
OTP transforms uncertainty from a "black box" into a measurable metric (T, I, F) with a complete audit trail (provenance_chain).
Features
- Neutrosophic Judgments: Represent evidence with Truth (T), Indeterminacy (I), and Falsity (F) components
- Fusion Operators: Multiple strategies for combining judgments (conflict-aware, optimistic, pessimistic)
- Audit Trail: Complete provenance tracking for every decision
- Python 3.8+: Modern Python support with type hints
- MIT Licensed: Open source and free to use
Official Website & Full Documentation: https://opentrustprotocol.com
Scientific Foundation: https://neutrosofia.com
Installation
pip install opentrustprotocol
Quick Start
Start using OTP in just a few lines of code:
from otp import NeutrosophicJudgment, fuse
# 1. Create Neutrosophic Judgments from your evidence
# Source 1: An AI model's confidence score
judgment_from_model = NeutrosophicJudgment(
T=0.85,
I=0.15,
F=0.0,
provenance_chain=[{
"source_id": "model-text-bison-v1.2",
"timestamp": "2025-09-20T20:30:00Z"
}]
)
# Source 2: A human expert's verdict
judgment_from_expert = NeutrosophicJudgment(
T=0.7,
I=0.1,
F=0.2,
provenance_chain=[{
"source_id": "expert-auditor-jane-doe",
"timestamp": "2025-09-20T20:32:15Z"
}]
)
# 2. Fuse the evidence to get an auditable conclusion
# We use the standard, conflict-aware operator.
# We give more weight to the human expert (60%) than the model (40%).
fused_judgment = fuse.conflict_aware_weighted_average(
judgments=[judgment_from_model, judgment_from_expert],
weights=[0.4, 0.6]
)
# 3. Analyze the result and its audit trail
print(f"Fused Judgment: {fused_judgment}")
# Fused Judgment: NeutrosophicJudgment(T=0.76, I=0.12, F=0.12)
# The provenance_chain now contains the full history
print("\nComplete Audit Trail:")
for entry in fused_judgment.provenance_chain:
print(f"- {entry}")
# - {'source_id': 'model-text-bison-v1.2', ...}
# - {'source_id': 'expert-auditor-jane-doe', ...}
# - {'operator_id': 'otp-cawa-v1.1', ...}
Use Cases
- Financial Risk Assessment: Evaluate investment opportunities with multiple data sources
- Identity Verification: Multi-factor authentication with confidence scoring
- AI Model Validation: Assess reliability of machine learning predictions
- Blockchain Auditing: Verify transaction legitimacy with multiple validators
- Reputation Systems: Build trust networks with auditable metrics
Fusion Operators
1. Conflict-Aware Weighted Average (Recommended)
result = fuse.conflict_aware_weighted_average(
judgments=[judgment1, judgment2, judgment3],
weights=[0.5, 0.3, 0.2]
)
Automatically adjusts weights based on internal conflicts in judgments.
2. Optimistic Fusion
result = fuse.optimistic_fusion(judgments)
Takes maximum T and minimum F - useful for opportunity analysis.
3. Pessimistic Fusion
result = fuse.pessimistic_fusion(judgments)
Takes minimum T and maximum F - useful for risk analysis.
What's Next?
- Visit the Technical Guide to learn about all available fusion operators
- Explore the Practical Guide for advanced examples of data mapping
- Contribute to the project on GitHub
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
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 opentrustprotocol-1.0.6.tar.gz.
File metadata
- Download URL: opentrustprotocol-1.0.6.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b19483feca731640b34cfdd1e3d48d654775982e0b8cf8f86699cf32d64d326d
|
|
| MD5 |
efa46e13d535a27d4dd2363fd0217771
|
|
| BLAKE2b-256 |
26f5d65a89ca022e6672e7ebbb7f59e4e877180adb009da2e42f51ca5d906569
|
File details
Details for the file opentrustprotocol-1.0.6-py3-none-any.whl.
File metadata
- Download URL: opentrustprotocol-1.0.6-py3-none-any.whl
- Upload date:
- Size: 26.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
547fe96f13decbe93c5ee9c47172b143b5a86ad2858437e7f27a238f7180f1c7
|
|
| MD5 |
0e93bb9191e44a97b5cd29240df184c6
|
|
| BLAKE2b-256 |
324f92b7e132669cd28118b742f3623ab758e179d33464be6568dffacf02a624
|