feat(sdk): add synchronous ValidKit client#1
Merged
jesse-validkit merged 1 commit intomainfrom Mar 31, 2026
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ValidKitclass wrappingAsyncValidKitvia a dedicated background event loop threadverify(),verify_batch(),get_batch_status(),get_batch_results(),cancel_batch()test_sync_client.py, all 77 tests passingContext
The docs site and landing page have shown
from validkit import ValidKit(sync) for months, but onlyAsyncValidKitexisted. This PR makes those examples actually work.Part of ValidKit/validkit#2256 — Python SDK docs truth.
Test plan
pytest tests/ -v— all 77 tests passpython -c "from validkit import ValidKit"— import smoke test