Skip to content

feat(sdk): add synchronous ValidKit client#1

Merged
jesse-validkit merged 1 commit intomainfrom
feat/sync-client-2256
Mar 31, 2026
Merged

feat(sdk): add synchronous ValidKit client#1
jesse-validkit merged 1 commit intomainfrom
feat/sync-client-2256

Conversation

@jesse-validkit
Copy link
Copy Markdown
Contributor

Summary

  • Adds sync ValidKit class wrapping AsyncValidKit via a dedicated background event loop thread
  • Methods: verify(), verify_batch(), get_batch_status(), get_batch_results(), cancel_batch()
  • Works inside Jupyter notebooks and Django views (tested with nested event loop)
  • Bumps version to 1.2.0
  • 16 new tests in test_sync_client.py, all 77 tests passing

Context

The docs site and landing page have shown from validkit import ValidKit (sync) for months, but only AsyncValidKit existed. This PR makes those examples actually work.

Part of ValidKit/validkit#2256 — Python SDK docs truth.

Test plan

  • pytest tests/ -v — all 77 tests pass
  • python -c "from validkit import ValidKit" — import smoke test
  • Verify nested event loop test passes (Jupyter compat)

Add a sync wrapper around AsyncValidKit using a dedicated background
event loop thread. This makes `from validkit import ValidKit` work —
matching the landing page examples that have shown sync usage for
months.

Methods: verify(), verify_batch(), get_batch_status(),
get_batch_results(), cancel_batch(). Context manager support.

Works inside Jupyter notebooks and Django views where an event loop
is already running (tested in TestNestedEventLoop).

Closes ValidKit/validkit#2256
@jesse-validkit jesse-validkit merged commit 73cdfae into main Mar 31, 2026
@jesse-validkit jesse-validkit deleted the feat/sync-client-2256 branch March 31, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant