Skip to main content

RulHub SDK — Trade finance compliance API client

Project description

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.

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

rulhub-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

rulhub-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file rulhub-0.1.0.tar.gz.

File metadata

  • Download URL: rulhub-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.13.2 HTTPX/0.28.1

File hashes

Hashes for rulhub-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8222c0fa0c871007d8029f1e45f108eb426a9cdf857d71d379f35dcee8c3d705
MD5 8b2401b3958aedebcceaf29937953076
BLAKE2b-256 7c883912ad57d62a2d65c7ceb350b6fd19b2249b78245e5808e76ca93d01185e

See more details on using hashes here.

File details

Details for the file rulhub-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rulhub-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.13.2 HTTPX/0.28.1

File hashes

Hashes for rulhub-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 149b62339cc1ac931abb1bc294b3506630bdb7eaf07ede6e630a8dc66e70661f
MD5 40984f6bf382a6d0bbec38db01757639
BLAKE2b-256 ce01d5b341531bda92831e1762650c216285ebc79d4f7e53d819d16fe5ae8b45

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