Skip to main content

Compliance and monitoring services for Sardis - KYC, Sanctions, PEP, Risk Scoring, and Reporting

Project description

sardis-compliance

PyPI version Python 3.11+ License: MIT

Compliance and monitoring services for Sardis - KYC, Sanctions, PEP, Risk Scoring, and Reporting.

Overview

sardis-compliance provides comprehensive compliance infrastructure aligned with the U.S. GENIUS Act:

  • KYC Verification: Identity verification with Persona integration
  • Sanctions Screening: OFAC/SDN screening via Elliptic
  • PEP Screening: Politically Exposed Persons checks
  • Risk Scoring: Real-time transaction risk assessment
  • Adverse Media: News and media monitoring
  • Compliance Reporting: Automated report generation
  • Audit Trail: Immutable compliance audit logs

Installation

pip install sardis-compliance

Optional Dependencies

# PostgreSQL support
pip install sardis-compliance[postgres]

# S3 archive storage
pip install sardis-compliance[s3]

# Google Cloud Storage
pip install sardis-compliance[gcs]

# PDF report generation
pip install sardis-compliance[pdf]

# All optional dependencies
pip install sardis-compliance[all]

Quick Start

from sardis_compliance import (
    ComplianceEngine,
    create_kyc_service,
    create_sanctions_service,
    create_risk_scorer,
)

# Initialize services
kyc = create_kyc_service(provider="persona")
sanctions = create_sanctions_service(provider="elliptic")
risk_scorer = create_risk_scorer()

# Run compliance checks
engine = ComplianceEngine(
    kyc_service=kyc,
    sanctions_service=sanctions,
    risk_scorer=risk_scorer,
)

result = await engine.check_transaction(
    wallet_address="0x...",
    amount=10000_00,  # $10,000
    counterparty="0x...",
)

if result.approved:
    print("Transaction approved")
else:
    print(f"Blocked: {result.reason}")

Features

KYC Verification

from sardis_compliance import create_kyc_service, VerificationRequest

kyc = create_kyc_service(provider="persona")

# Create verification session
session = await kyc.create_session(
    request=VerificationRequest(
        user_id="user_123",
        email="user@example.com",
        verification_level="enhanced",
    )
)

# Check verification status
result = await kyc.check_status(session.inquiry_id)
print(f"Status: {result.status}")
print(f"Verified: {result.verified}")

Sanctions Screening

from sardis_compliance import create_sanctions_service

sanctions = create_sanctions_service(provider="elliptic")

# Screen a wallet address
result = await sanctions.screen_wallet(
    address="0x...",
    chain="ethereum",
)

if result.risk == "HIGH":
    print(f"High risk! Matched lists: {result.matched_lists}")

PEP Screening

from sardis_compliance import create_pep_service, PEPScreeningRequest

pep = create_pep_service(provider="complyadvantage")

result = await pep.screen(
    request=PEPScreeningRequest(
        full_name="John Smith",
        date_of_birth="1970-01-15",
        nationality="US",
    )
)

for match in result.matches:
    print(f"Match: {match.name} - {match.category}")

Risk Scoring

from sardis_compliance import create_risk_scorer

scorer = create_risk_scorer()

assessment = await scorer.assess_transaction(
    wallet_id="wal_123",
    amount=50000_00,
    counterparty="0x...",
    transaction_type="outbound",
)

print(f"Risk Level: {assessment.level}")
print(f"Risk Score: {assessment.score}")
print(f"Factors: {assessment.factors}")
print(f"Action: {assessment.recommended_action}")

Compliance Reporting

from sardis_compliance import create_report_service, ReportType

reports = create_report_service()

# Generate a compliance report
report = await reports.generate(
    report_type=ReportType.MONTHLY_SUMMARY,
    start_date=start,
    end_date=end,
    format="pdf",
)

await reports.save(report, path="/reports/monthly.pdf")

Audit Trail

from sardis_compliance import get_audit_store

audit = get_audit_store()

# Log a compliance decision
await audit.log(
    action="TRANSACTION_APPROVED",
    wallet_id="wal_123",
    decision="approved",
    risk_score=25,
    checks_performed=["kyc", "sanctions", "pep"],
)

# Query audit history
entries = await audit.query(
    wallet_id="wal_123",
    start_date=start,
    end_date=end,
)

Configuration

# KYC Provider (Persona)
SARDIS_PERSONA_API_KEY=your-api-key
SARDIS_PERSONA_TEMPLATE_ID=tmpl_xxx

# Sanctions Provider (Elliptic)
SARDIS_ELLIPTIC_API_KEY=your-api-key
SARDIS_ELLIPTIC_API_SECRET=your-secret

# PEP Provider (ComplyAdvantage)
SARDIS_COMPLYADVANTAGE_API_KEY=your-api-key

# Risk Scoring
SARDIS_RISK_HIGH_THRESHOLD=75
SARDIS_RISK_MEDIUM_THRESHOLD=50

Architecture

sardis-compliance/
├── checks.py         # Compliance engine
├── kyc.py            # KYC verification
├── sanctions.py      # Sanctions screening
├── pep.py            # PEP screening
├── risk_scoring.py   # Risk assessment
├── adverse_media.py  # Media monitoring
├── reports.py        # Report generation
├── dashboard.py      # Compliance dashboard
├── batch.py          # Batch processing
├── audit_rotation.py # Audit log management
└── retry.py          # Resilience utilities

Requirements

  • Python 3.11+
  • sardis-core >= 0.1.0
  • httpx >= 0.25.0

Documentation

Full documentation is available at docs.sardis.sh/compliance.

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please see our Contributing Guide for details.

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

sardis_compliance-1.1.0.tar.gz (133.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sardis_compliance-1.1.0-py3-none-any.whl (146.7 kB view details)

Uploaded Python 3

File details

Details for the file sardis_compliance-1.1.0.tar.gz.

File metadata

  • Download URL: sardis_compliance-1.1.0.tar.gz
  • Upload date:
  • Size: 133.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sardis_compliance-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3272458b924aec57d18505202e72cf509a26ca260d663d5b3b37d1ada1ea9f01
MD5 249f91e83b5e7d8ff61c355ecaa7ba51
BLAKE2b-256 f5ef252479238868d9896dc32f9e0430fcfa2f4d2090f27ebf7c9761432953d1

See more details on using hashes here.

File details

Details for the file sardis_compliance-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: sardis_compliance-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 146.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sardis_compliance-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b48436e973e853e91a01d726551deb13ef1eda333338bab31dead36d9733f2d
MD5 4971c5935ca96abe479c1f2380767191
BLAKE2b-256 e99633902edf9410e7b13e0bdbcf28830c103d39ac68664af3d7fb2f5c21a71a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page