Uplift to v2.0.0: full API coverage, subcommand CLI, modern packaging - #10
Merged
Conversation
Ground-up rewrite of the HoneyDB Python library and CLI. Client (honeydb/api/client.py): - Complete coverage of the current HoneyDB API (~65 endpoints): bad-hosts, ip context, asn, cve, sensor-data, services, stats, monitors CRUD, nodes, payload-history, internet-scanner, ipinfo lists, netinfo, datacenter. - Pooled requests.Session with automatic retries (429/5xx, backoff, Retry-After). - Typed exception hierarchy (HoneyDBError + auth/notfound/ratelimit). - Context-manager support, per-request timeout, per-segment URL encoding, full type hints, py.typed marker. - Empty/whitespace success bodies return None instead of raising. CLI (honeydb/cli.py): - Replaces flag-based invocation with a git-style subcommand tree (honeydb ip 8.8.8.8 --geo, honeydb monitors delete --id 1 2, ...). - Global flags (--pretty/--timeout/credentials) work before or after the subcommand (and nested subcommands) via a shared parent parser. Packaging & tooling: - Migrate setup.py/setup.cfg (declared Python 2.7) to pyproject.toml (PEP 621, hatchling), requires-python >=3.10, console-script entry point. - Retire black and pylint; ruff format + ruff check only. - CI matrix on Python 3.10-3.13, runs pytest. Tests: 46 mocked-HTTP tests (no API keys required) covering request construction, error mapping, and CLI dispatch. Docs: comprehensive README with endpoint reference and migration notes; example.py rewritten against the v2 API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Ground-up uplift of the HoneyDB Python library and CLI from v1.5.0 to v2.0.0. This is a major version with breaking changes.
requests.Sessionwith automatic retries (429/5xx, backoff,Retry-After), per-request timeout, and a typed exception hierarchy (HoneyDBError+ auth/notfound/ratelimit). Context-manager support, full type hints,py.typed.--flaginterface with a git-style tree (honeydb ip 8.8.8.8 --geo,honeydb monitors delete --id 1 2). Global flags work before or after the (nested) subcommand.setup.py/setup.cfg(which declared Python 2.7) →pyproject.toml(PEP 621, hatchling),requires-python >=3.10, console-script entry point.blackandpylint; CI runsruff format --check,ruff check, andpyteston Python 3.10–3.13.example.pyrewritten.Breaking changes
honeydb --bad-hosts→honeydb bad-hosts;honeydb --netinfo-lookup 1.2.3.4→honeydb netinfo lookup 1.2.3.4).ip_history/ip-contexttop-level →ip()/ip_history()under/ip/<ip>;stats_asn()→asns()).from honeydb import Clientis the new surface;from honeydb import api; api.Client(...)still works.Testing
ruff format --check .andruff check .are clean.🤖 Generated with Claude Code