Skip to main content

RulHub Python SDK

Trade finance compliance API — validate documents against 5,400+ ICC rules with AI-powered semantic matching.

Install

pip install rulhub

Quick Start

from rulhub import RulHub

client = RulHub(api_key="ak_your_key_here")

# Validate a letter of credit
result = client.validate(
    rules="ucp600",
    document_type="lc",
    document={
        "beneficiary_name": "ABC Trading Co",
        "amount": 50000,
        "currency": "USD",
        "goods_description": "1000 MT Thai White Rice 5% Broken",
        "expiry_date": "2026-06-30",
    }
)

print(f"Score: {result['score']:.0%}")
print(f"Compliant: {result['compliant']}")

for d in result["discrepancies"]:
    print(f"  [{d['severity']}] {d['finding']}")
    if d.get("recommendation"):
        print(f"    Fix: {d['recommendation']}")

Validate Multiple Documents

result = client.validate_set(documents=[
    {"type": "lc", "fields": {"amount": 50000, "currency": "USD"}},
    {"type": "invoice", "fields": {"total_amount": 49500, "currency": "USD"}},
])

for d in result["cross_document_discrepancies"]:
    print(f"  {d['finding']} ({', '.join(d['documents_involved'])})")

Sanctions Screening

result = client.screen_sanctions(entity="Acme Corp", country="IR")
print(f"Clear: {result['clear']}, Risk: {result['risk_level']}")

All Methods

Method Description
validate() Single document validation
validate_set() Multi-document cross-doc validation
screen_sanctions() OFAC/EU/UN/UK sanctions screening
screen_entity() UBO/PEP/shell company risk
screen_export_controls() EAR/ITAR/EU dual-use
screen_tbml() FATF money laundering indicators
screen_route() Route sanctions + transport
search_rules() Keyword search across all rules
lookup_rules() Structured rule retrieval
get_requirements() Document field requirements
get_bank_profiles() Bank behavior data
get_country_requirements() Country compliance rules
get_fta_origin() FTA eligibility rules
get_commodities() Commodity compliance

Sign Up

Free plan: 50 validations/month. No credit card.

curl -X POST https://api.rulhub.com/v1/signup \
  -H "Content-Type: application/json" \
  -d '{"email":"you@co.com","password":"secure123","company_name":"Your Co"}'

API Docs: https://api.rulhub.com/swagger | Website: https://rulhub.com | By: Enso Intelligence Labs, Inc.

Metadata

Release files for rulhub 0.1.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 rulhub 0.1.0
File Size Uploaded
rulhub-0.1.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rulhub 0.1.0
File Interpreter ABI Platform
rulhub-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / rulhub-0.1.0.tar.gz

Download URL rulhub-0.1.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8222c0fa0c871007d8029f1e45f108eb426a9cdf857d71d379f35dcee8c3d705
BLAKE2b-256 checksum
How to use checksums
7c883912ad57d62a2d65c7ceb350b6fd19b2249b78245e5808e76ca93d01185e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.5 cpython/3.13.2 HTTPX/0.28.1

Release files / rulhub-0.1.0-py3-none-any.whl

Download URL rulhub-0.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
149b62339cc1ac931abb1bc294b3506630bdb7eaf07ede6e630a8dc66e70661f
BLAKE2b-256 checksum
How to use checksums
ce01d5b341531bda92831e1762650c216285ebc79d4f7e53d819d16fe5ae8b45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.5 cpython/3.13.2 HTTPX/0.28.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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