Metadata-Version: 2.4
Name: identifyorg
Version: 0.3.0
Summary: IdentifyOrg server-side SDK — identity verification, prepaid billing, and realtime call/chat token issuance.
License: MIT
Keywords: identifyorg,kyc,bvn,nin,identity-verification,livekit
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28

# identifyorg (Python server SDK)

```bash
pip install identifyorg
```

```python
import os
from identifyorg import IdentifyOrgClient, IdentifyOrgApiError

identifyorg = IdentifyOrgClient(api_key=os.environ["IDENTIFYORG_SECRET_KEY"])

# Identity verification
result = identifyorg.verify_bvn("22212345678", first_name="Ada", last_name="Okafor",
                              idempotency_key="order-123")

topup = identifyorg.topup(amount=5000)
print(topup["checkout_url"])

# Mint a realtime token for YOUR user, then hand it to the browser/mobile
# client (IdentifyOrg JS/React Native/Flutter/Kotlin SDK) — never send your
# secret key to a client.
call = identifyorg.streaming_token("video", identity=user.id, display_name=user.name)
return {"token": call["token"], "url": call["url"], "room_name": call["room_name"]}

chat = identifyorg.chat_token(visitor_id=visitor.id, visitor_name=visitor.name)

# Website Audit — first standard-tier audit free per account, then billed.
# "deep" runs in the background: returns immediately with status="pending",
# poll get_audit() until it's "ready"/"failed".
audit = identifyorg.run_audit("https://example.com", tier="standard")
audit = identifyorg.get_audit(audit["id"])
print(audit["score"], audit["grade"], audit["findings"])
open("report.pdf", "wb").write(identifyorg.get_audit_pdf(audit["id"]))

# AI media detection — self-hosted, no third-party AI-detection API.
# Image/text: first scan free per account, then billed. Video: always billed.
scan = identifyorg.scan_image("photo.jpg")
scan = identifyorg.scan_text("... at least ~800 characters ...")
scan = identifyorg.scan_video("clip.mp4", frames=12)
print(scan["verdict"], scan["signals"])
```

Errors raise `IdentifyOrgApiError` with `.status` and `.code` attributes.

## Django / Flask example: minting a call token endpoint

```python
@app.post("/api/call-token")
def call_token():
    return identifyorg.streaming_token("video", identity=current_user.id, display_name=current_user.name)
```

Your frontend calls this endpoint (never IdentifyOrg directly with a secret
key), then passes the returned `token`/`url` straight into the IdentifyOrg JS
SDK's `joinCall()`.


## What's new in 0.2.0

```python
# Phone verification (OTP by SMS): send a code, then check what the user typed.
started = client.phone_verify_start("08031234567", reference="signup-42")
result = client.phone_verify_check(started["id"], "418209")   # {"verified": True, ...}

# File and image tools return the converted file as bytes.
open("out.docx", "wb").write(client.pdf_to_docx("report.pdf"))
open("merged.pdf", "wb").write(client.pdf_merge(["a.pdf", "b.pdf"]))
open("cutout.png", "wb").write(client.remove_background("photo.jpg"))
open("icons.zip", "wb").write(client.app_icons("logo.png"))
text = client.ocr("scan.pdf")                                  # parsed JSON

# SMS, bills, webhooks, account
client.send_sms("08031234567", "Your order has shipped")
client.create_webhook("https://example.com/hooks/identifyorg", events=["verification.completed"])
client.account_overview(days=30)

# Anything not wrapped yet:
client.request("GET", "/v1/tools/access")
```

`topup()`, `payments()` and the dashboard-only actions (API keys, domain verification,
support tickets) were removed from this SDK: they need a signed-in session, not an API key,
so they always returned 401.

## Address verification and bill prices

```python
check = client.verify_address("12 Adeola Odeku Street, Victoria Island, Lagos", full_name="Ada Obi")
print(check["confirm_url"])  # send this to the person
result = client.get_address_verification(check["id"])

plans = client.bill_data_plans("mtn", duration="monthly")
price = client.bill_quote("airtime", 500, network="mtn")
```
