-
Notifications
You must be signed in to change notification settings - Fork 8
Feat: Add AsyncClient, search API, and Pro detection #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Chocapikk
wants to merge
10
commits into
LeakIX:main
from
Chocapikk:feat/add-endpoints-and-update-deps
Closed
Feat: Add AsyncClient, search API, and Pro detection #27
Chocapikk
wants to merge
10
commits into
LeakIX:main
from
Chocapikk:feat/add-endpoints-and-update-deps
+579
−7
Conversation
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
5c2a262 to
36040bb
Compare
cd8ad7e to
dacd9ca
Compare
- Add search(query, scope, page) for simple query string syntax - Add get_domain() endpoint for domain lookups - Bump version to 0.2.0
dacd9ca to
573a622
Compare
- Add bulk_export_stream() generator for memory-efficient streaming - Add bulk_service_stream() generator for memory-efficient streaming
- Add AsyncClient class using httpx for async operations - Support context manager (async with) - Add bulk_export_stream async generator - Add httpx dependency - Update README with async examples
AsyncClient now automatically retries on 429 responses with exponential backoff (1s, 2s, 4s). Max 3 retries before returning None.
- Add get_api_status(force=False) to both Client and AsyncClient - Add is_pro() convenience method to both clients - Cache API status per client instance (query Pro only once) - Detect Pro subscription by testing WpUserEnumHttp plugin
- Replace Pro detection hack (querying Pro-only plugins) with proper /api/user/info endpoint call - Returns accurate data: username, email, level, is_pro, quota, features - Still cached per client instance for efficiency
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
This PR enhances the LeakIX Python client with modern async support and improved developer experience.
New Features
get_api_status()andis_pro()methods using/api/user/infoendpoint (cached)bulk_export_stream()generatorAPI Examples
get_api_status() Response
Uses the new
/api/user/infoendpoint (requires frontend update):{ "authenticated": true, "username": "myuser", "email": "user@example.com", "level": "BountyHunter", "is_pro": true, "quota": {"total": 30000, "remaining": 29500, "used": 500}, "features": ["search", "host_lookup", "bulk_export", "pro_plugins"], "created": 1234567890 }Why AsyncClient?
Changes
leakix/async_client.pywith full async implementationsearch(),get_domain(),get_api_status(),is_pro()to both clientsbulk_export_stream()for memory-efficient streamingAsyncClientfrom package root