Skip to content

Releases: sshimek42/britecore_sdk

v2.2.0

Choose a tag to compare

@github-actions github-actions released this 24 Jul 14:35

Added

  • Optional native async HTTP transportAsyncBritecoreAPIClient now accepts
    async_transport="httpx" (default: "threaded"). When set to "httpx", requests
    are executed natively via httpx.AsyncClient instead of wrapping the sync client in
    asyncio.to_thread. An optional httpx_client kwarg allows injecting a pre-built
    client (e.g., for shared connection pools or testing). Install the new optional extra
    to enable: pip install britecore_sdk[async-http].

  • Optional pydantic-validated settings viewget_typed_settings(site_names=[...])
    is now exported from britecore_sdk.settings. It returns a strongly-typed pydantic
    model built from the live Dynaconf config, providing IDE autocompletion and runtime
    field validation without changing SDK initialization behavior. Requires:
    pip install britecore_sdk[typed-config].

  • New toml_compat wrapper (britecore_sdk.utils.toml_compat) — thin adapter that
    exposes a toml-like API (load / dump / loads / dumps) backed by stdlib
    tomllib for parsing and tomli-w for serialization. Internal SDK utilities now use
    this wrapper, removing the dependency on the untyped toml package.

  • New optional dependency extras in pyproject.toml:

    • britecore_sdk[async-http] — pulls in httpx for native async transport.
    • britecore_sdk[typed-config] — pulls in pydantic and pydantic-settings.
    • britecore_sdk[all] — now includes both new extras in addition to interactive.

Changed

  • Removed typing-extensions from core runtime dependencies — the project targets
    Python >=3.11, where TypedDict is part of stdlib typing. The only consumer
    (api/types.py) now imports from typing directly.

  • Replaced toml with tomli-w in core runtime dependencies. tomllib (stdlib
    since Python 3.11) handles parsing; tomli-w provides the write path.
    If tomli-w is unavailable at runtime the wrapper transparently falls back to toml
    (backward compatible, no hard breakage).

Migration notes

tomltomli-w (write path)

No action required for most consumers. The internal TOML I/O used by config utilities
is fully backward-compatible. If you import toml from check_site_configs.py or
_config_common directly, switch to:

from britecore_sdk.utils.toml_compat import toml

Async transport

Existing code that uses AsyncBritecoreAPIClient is unaffected; the default transport
remains "threaded". To opt into native async I/O:

from britecore_sdk.api import AsyncBritecoreAPIClient

client = AsyncBritecoreAPIClient(target_site="prod", async_transport="httpx")

Typed settings (opt-in)

from britecore_sdk.settings import get_typed_settings

typed = get_typed_settings(site_names=["prod", "staging"])
print(typed.sites["prod"].base_url)

v2.1.1

Choose a tag to compare

@sshimek42 sshimek42 released this 23 Jul 15:01

Changed

  • Completed the v2.1.x quote-wrapper quality pass in src/britecore_sdk/api/api_calls/v2/quotes.py by expanding remaining endpoint docstrings to include parameter intent, return behavior, and error semantics.
  • Added missing input validation to quote wrappers that accepted required identifiers without guardrails (associate_agentcy_to_quote, prefill_loss_history, prefill_violations, summary, turn_quote_into_application, and update_e_delivery_enabled).
  • Continued policy lifecycle quality-of-life improvements in src/britecore_sdk/api/api_calls/v2/policies.py for bind, cancel_policy, create_policy_from_britequote, evaluate_cancellation, and submit_quote.

Fixed

  • Corrected silent validation behavior in policy creation/retrieval paths by ensuring BritecoreError.MissingParameter is raised where required parameters are missing.

Documentation

  • Added completion records for the v2.1.x effort:
    • QUALITY_OF_LIFE_AUDIT_2026-07-23.md
    • V2.1.1_SESSION_STATUS_2026-07-23.md
    • V2.1.X_COMPLETION_2026-07-23.md

v2.0.5

Choose a tag to compare

@github-actions github-actions released this 21 Jul 17:41

Added

  • Added [project.urls] metadata in pyproject.toml (Homepage, Documentation, Repository, Issues, Changelog) for richer package index/project link display.
  • Added a "Project Links" section to docs/index.md and docs/project_overview.md.

Changed

  • Raised runtime minimums for dynaconf and typing-extensions in pyproject.toml.
  • Refreshed dev/docs dependency minimums in pyproject.toml while preserving Python 3.11 compatibility (sphinx>=9.0.4,<9.1).
  • Updated workflow action pins in release/publish workflows to current majors used in this repo (softprops/action-gh-release@v3, actions/download-artifact@v5).

v2.0.4

Choose a tag to compare

@github-actions github-actions released this 21 Jul 17:05

Fixed

  • CI formatting parity: normalized tests/unit/test_config_wizard.py formatting and line endings so local pre-commit and GitHub Actions black --check agree across platforms.
  • Release documentation drift: aligned package version references and metadata dates in actively maintained root docs.

Changed

  • Bumped package version to 2.0.4 in pyproject.toml.

v2.0.3

Choose a tag to compare

@github-actions github-actions released this 20 Jul 19:06

Added

  • 85 new always-on tests replacing the fully-skipped test_workflows_integration.py
    template suite across 10 test classes:
    • TestPhoneValidatorProperties (15): format normalization, sentinel rejection ("0", "-"),
      all type-map entries (mobile→Cell, business→Work, office→Work, cellular→Cell),
      multi-entry list processing
    • TestEmailValidatorProperties (12): lowercase normalization, validate_email(), type-map
      entries (home→Personal, business→Work), InvalidEmailAddress guard, silent empty-entry skip
    • TestNameValidatorProperties (6): apostrophe lowercasing, suffix handling (IV, III, Jr)
    • TestBritecoreQuoteModel (6): to_dict() field completeness, auto-generated description,
      explicit description preservation, inspection date include/exclude, underwriting_questions reset
    • TestBritecoreContactModel (5): process_contact() name normalization, type defaulting,
      organization type, policy number, key completeness
    • TestPolicyWorkflows (3): retrieve_policy path routing, payload building, revision_state
    • TestContactWorkflows (6): new_contact path, address/phone/email type normalization,
      MissingParameter guards for empty name and empty address list
    • TestQuoteWorkflows (6): create_full_quote tuple return, path routing, empty/None payload
      guards, None response (None, None) tuple, explicit-client override
    • TestErrorHandlingWorkflows (8): exception status_code metadata, flat-alias identity,
      BritecoreError.Base hierarchy, request_id/error_code in __str__
    • TestMultiEnvironmentWorkflows (4): use_api_client context manager, init_api_client,
      get_api_client with autouse mock

Fixed

  • test_live_create_quote_round_trip: replaced unconditional pytest.skip() with a real
    create_full_quoteget_quote round-trip test, gated on the new
    BRITECORE_SANDBOX_POLICY_TYPE_ID env var; preserves skip behaviour when the variable is absent
  • test_interactive_menu_module_can_be_imported: removed catch-all try/except pytest.skip();
    the module uses a lazy proxy (_LazyAPIClient) that never requires config at import time
  • black ↔ ruff-format formatting cycle on test_endpoints.py: extracted long assertion
    message into a local variable so the statement fits on one line and both formatters agree
  • post_probe_report.json / post_probe_report.md: fixed missing end-of-file newline and
    mixed Windows/Unix line endings

v2.0.2

Choose a tag to compare

@github-actions github-actions released this 20 Jul 13:52

Fixed

  • Critical docstring gaps: added the missing module-level docstring to src/britecore_sdk/api/api_calls/v1/contacts.py.
  • Documentation quality improvements:
    • Expanded src/britecore_sdk/settings/config.py module docstring from 2 words to comprehensive layered-configuration documentation.
    • Corrected and expanded src/britecore_sdk/models/quote.py module docstring (it was incorrectly labeled as a policy model).
  • API reference generation: ensured all module-level docstrings are present and properly formatted for Sphinx autodoc and IDE tooltips.

Verified

  • All 560+ endpoint wrapper functions have comprehensive Google-style docstrings.
  • Zero autogenerated wrapper stubs remain without proper documentation.
  • 100% module-level docstring coverage across core modules.
  • No regressions: all 90 API module files compile successfully.
  • Local validation passed:
    • Ruff linting
    • Black formatting
    • Mypy type checks
    • Unit tests (593 passed)

Release Notes

This patch release focuses on documentation quality and release hygiene for the SDK.

v2.0.1

Choose a tag to compare

@github-actions github-actions released this 17 Jul 20:32

Added

  • POST probe utility (src/britecore_sdk/utils/probe_post_requirements.py): CLI tool that
    sends empty payloads to every undocumented POST endpoint in the OpenAPI spec and infers
    required field names from server validation-error responses. Supports --dry-run,
    --use-spec-empty-properties, --print-selected-paths, --export-selected-paths, and
    --log-level flags. Outputs structured JSON and Markdown reports.
  • Probe regression test generator (generate_probe_regression_tests.py): Script that reads
    post_probe_report.json and produces tests/unit/test_probe_endpoint_regression.py — 209
    parametrized tests that verify every probe-confirmed wrapper routes to the correct API path.
    Re-run after future probe runs to keep the suite current.
  • Probe endpoint regression tests (tests/unit/test_probe_endpoint_regression.py): 209
    generated path-routing tests covering all genuine_success and informative_error probe
    results. No live API required; runs fully mocked in ~1 second.

Changed

  • 136 autogenerated wrapper stubs updated with probe-discovered required parameters.
    Functions that previously accepted only **kwargs now expose named parameters for their
    required fields (e.g. return_premium_id, claim_contact, quote_id). All new parameters
    default to None and are filtered from the payload before sending, preserving backward
    compatibility.
  • claim_exposures.get_accounting_loss_details, get_accounting_overview,
    get_accounting_recoveries_data: added api_key parameter to match OpenAPI spec.
  • test_autogenerated_wrapper_request_keys_match_spec: updated to accept probe-discovered and
    manually-curated fields as valid additions to spec-defined keys (spec is intentionally
    incomplete for many endpoints).
  • test_claims_wrapper_requests: configure multiple_parameter_verification.return_value so
    the get_claim parametrized case passes under the autouse mock_api_client fixture.

Fixed

  • probe_post_requirements.py: replaced adjacent %s%s logging format tokens that matched
    the legacy SCLogging token regex, resolving test_no_legacy_logging_tokens_in_source_tree.

v2.0.0 — Production Release

Choose a tag to compare

@sshimek42 sshimek42 released this 17 Jul 14:36

What's new in 2.0.0

This is the full production release of the BriteCore SDK, completing the 6-phase v2.0.0 roadmap.

Phase highlights

Phase 1 — Client Lifecycle Redesign

  • Explicit client= parameter on all endpoint wrappers

esolve_client() / �resolve_client() helpers
Phase 2 — Typed Response Models

  • �ritecore_sdk.api.responses: ResponseEnvelope, QuoteResponse, PolicyResponse, ContactResponse, ListResponse, BatchOperationResponse
  • .from_api() factory pattern; full IDE autocomplete; raw data via .raw_data
    Phase 3 — Standardized Error Model
  • All exceptions include status_code, error_code,
    equest_id, detail,
    aw_payload, sanitized_body
  • ValidationError.validation_errors for field-level details
  • Backwards compatible
    Phase 4 — Transport Middleware System
  • �ritecore_sdk.api.middleware: RequestIdMiddleware, LoggingMiddleware, HeaderInjectionMiddleware, TimeoutMiddleware
  • �dd_middleware() /
    emove_middleware() on the client
    Phase 5 — Pagination Iterators
  • iter_quotes(), iter_policies(), iter_contacts() and async equivalents
  • Automatic page management, lazy-loading, sync and async
    Phase 6 — Legacy Cleanup
  • �ritecore_sdk.api._compat migration helpers
  • Comprehensive docs/migrations/V2.0.0-COMPLETE-MIGRATION.md

Bug fixes

  • �ritecore_sdk.api.iterators: fixed SyntaxError: yield from inside async function that prevented module import on 3.11+

Upgrading from 1.5.x

See docs/migrations/V2.0.0-COMPLETE-MIGRATION.md for the full migration guide.

v1.5.4

Choose a tag to compare

@sshimek42 sshimek42 released this 17 Jul 14:07

Changed

  • Fixed .github/workflows/docs.yml validation by moving the Read the Docs hook secret to job-level env.
  • Tightened packaging dependency metadata:
    • typing_extensions>=4.15.0,<5.0.0
    • toml>=0.10.2,<0.11.0
    • Kept setuptools>=83.0.0 in dev extras so CI audits run against a non-vulnerable build toolchain.
  • Aligned docs packaging requirements with pyproject.toml:
    • docs/requirements.txt now matches the docs extra Sphinx constraint.

v1.5.3

Choose a tag to compare

@github-actions github-actions released this 17 Jul 13:45

Changed

  • Packaging metadata now marks the project as stable in pyproject.toml:
    • Development Status :: 4 - Beta -> Development Status :: 5 - Production/Stable
  • Updated docs to reflect current exception diagnostics and security behavior:
    • API.md now documents exception request_id and sanitized_body fields.
    • docs/OBSERVABILITY.md now includes exception-based request correlation examples.
    • SECURITY.md now clarifies redacted exception request context via sanitized_body.