Skip to content

Uplift to v2.0.0: full API coverage, subcommand CLI, modern packaging - #10

Merged
foospidy merged 1 commit into
masterfrom
honeydb-python-uplift-2
Jul 7, 2026
Merged

Uplift to v2.0.0: full API coverage, subcommand CLI, modern packaging#10
foospidy merged 1 commit into
masterfrom
honeydb-python-uplift-2

Conversation

@foospidy

@foospidy foospidy commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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.

  • Full API coverage — the client now implements the complete current HoneyDB API (~65 endpoints, up from ~15): bad-hosts, ip context, asn, cve, sensor-data, services, stats, monitors CRUD, nodes, payload-history, internet-scanner, ipinfo lists, netinfo, datacenter.
  • Robust HTTP — pooled requests.Session with 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.
  • Subcommand CLI — replaces the flat --flag interface 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.
  • Modern packagingsetup.py/setup.cfg (which declared Python 2.7) → pyproject.toml (PEP 621, hatchling), requires-python >=3.10, console-script entry point.
  • ruff-only tooling — retired black and pylint; CI runs ruff format --check, ruff check, and pytest on Python 3.10–3.13.
  • Docs — comprehensive README with an endpoint reference table and "Migrating from v1.x" notes; example.py rewritten.

Breaking changes

  • CLI is now subcommand-based (honeydb --bad-hostshoneydb bad-hosts; honeydb --netinfo-lookup 1.2.3.4honeydb netinfo lookup 1.2.3.4).
  • API-replaced methods dropped in favor of modern equivalents (ip_history/ip-context top-level → ip()/ip_history() under /ip/<ip>; stats_asn()asns()).
  • Failed requests raise typed exceptions instead of returning raw bodies.
  • from honeydb import Client is the new surface; from honeydb import api; api.Client(...) still works.

Testing

  • 46 mocked-HTTP tests (requests-mock, no API keys required) covering request construction, error mapping, and CLI dispatch.
  • Live smoke-tested against a real account across every endpoint family (bad-hosts, ip context, ipinfo, asn/asns, netinfo, datacenter, monitors, payload-history, internet-scanner) plus 401/404 error paths. Live testing caught and fixed two bugs now covered by regression tests: global flags not working after the subcommand, and empty/whitespace success bodies raising a spurious JSON error.
  • ruff format --check . and ruff check . are clean.

🤖 Generated with Claude Code

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>
@foospidy
foospidy merged commit fdd38d2 into master Jul 7, 2026
4 checks passed
@foospidy
foospidy deleted the honeydb-python-uplift-2 branch July 7, 2026 17:03
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