Skip to content

Releases: IamMuuo/gava-connect-plus

gava-connect-plus v0.4.1

Choose a tag to compare

@IamMuuo IamMuuo released this 19 Jul 07:18
Immutable release. Only release title and notes can be modified.
d2eba77

Discoverability metadata

  • Adds discoverability metadata to project for better ranking on pypi and google searches.

What's Changed

  • Chore/pypi discoverability metadata by @IamMuuo in #7

Full Changelog: v0.4.0...v0.4.1

gava-connect-plus v0.4.0

Choose a tag to compare

@IamMuuo IamMuuo released this 16 Jul 06:13
Immutable release. Only release title and notes can be modified.

What's New

  • Added Automated NIL Return Filing (iTax_NIL_Return) — file a NIL return for a taxpayer with an active obligation but no taxable income in the period, straight from Python:
  from gavaconnect import GavaConnectSync
  from gavaconnect.exceptions import NilReturnValidationError

  credentials = {
      "consumer_key": "your_nil_return_app_consumer_key",
      "consumer_secret": "your_nil_return_app_consumer_secret",
  }

  with GavaConnectSync(environment="sandbox", nil_return=credentials) as gava:
      try:
          result = gava.nil_return.file(
              pin="A521040203F",
              obligation_code="1",  # Income Tax - Individual Resident
              month="12",
              year="2016",
          )
          print(f"Filed successfully. Acknowledgment No: {result.ack_number}")

      except NilReturnValidationError as e:
          print(f"KRA rejected the filing: {e}")

Prefer async? Swap GavaConnectSync for GavaConnect and await gava.nil_return.file(...) inside an async with block — same call signature either way.

  • New isolated nil_return credential scope: export KRA_NIL_RETURN_KEY /
    KRA_NIL_RETURN_SECRET, or pass them via the nil_return={...} config dict.

What's Changed

Full Changelog: v0.3.0...v0.4.0

gava-connect-plus v0.3.0

Choose a tag to compare

@IamMuuo IamMuuo released this 16 Jul 05:50
Immutable release. Only release title and notes can be modified.

What's New

  • Added the Fetch Taxpayer Obligations endpoint (TaxPayer_Tax_Obligations_Fetcher) — resolves a KRA PIN's registered tax obligations via gava.obligation.fetch(pin) (async and sync), following the same pattern as the existing PIN/Station/Invoice modules
  • New isolated obligation credential scope (KRA_OBLIGATION_KEY / KRA_OBLIGATION_SECRET)
  • New InvalidObligationPINError for KRA response code 20001

Docs

  • README roadmap table now includes a "Required Env Vars" column
  • Environment setup guide now documents all five implemented scopes (Station and PIN Lookup credentials were previously undocumented)

What's Changed

Full Changelog: v0.2.1...v0.3.0

gava-connect-plus v0.2.1

Choose a tag to compare

@IamMuuo IamMuuo released this 03 Jul 11:06
552c0d5

Release Notes - v0.2.1

Overview

Bug fix release addressing Pydantic validation errors and JSON serialization issues in the KRA invoice checker library.

Fixes

1. Nullable Field Validation Error

Issue: Pydantic validation was failing with Input should be a valid string error when the KRA API returned null values for optional fields.

Fix: Updated InvoiceDetails model to make the following fields Optional[str]:

  • customer_pin
  • customer_name
  • exemption_certificate_no
  • trader_system_invoice_number
  • relevant_invoice_date
  • relevant_invoice_number

These fields now correctly accept null values per KRA API documentation.

2. Decimal Serialization Error

Issue: JSON serialization was failing with Object of type Decimal is not JSON serializable when calling json.dumps() on invoice records containing monetary values.

Fix:

  • Configured monetary fields (total_invoice_amount, total_taxable_amount, total_tax_amount, total_discount_amount) to use Decimal type for precision.
  • Added model_config = ConfigDict(json_encoders={Decimal: str}) to InvoiceDetails model to serialize Decimal objects as strings, preventing floating-point precision loss.
  • Updated client-side serialization to use model_dump_json(indent=4) instead of json.dumps(record.model_dump()) to respect Pydantic's JSON encoder configuration.

Migration Guide

If you're serializing invoice responses, update your code:

Before:

json.dumps(record.model_dump(), indent=4)

After

record.model_dump_json(indent=4)

Tested With

  • Pydantic v2
  • httpx (with 20s timeout)
  • KRA API Sandbox

gava-connect-plus 0.2.0

Choose a tag to compare

@IamMuuo IamMuuo released this 25 Jun 22:06
0b56e27

gava-connect-plus 0.2.0

Async Lifecycle Improvements

This release improves async resource management and modernizes SDK usage patterns.

Added

  • Async context manager support for GavaConnect

    • __aenter__ / __aexit__ implemented
    • Enables async with GavaConnect(...)
    • Automatic cleanup of underlying httpx.AsyncClient

Documentation

  • Updated README to use async with patterns
  • Removed legacy synchronous context examples
  • Clarified async/await usage across SDK methods

Improvements

  • Safer client lifecycle handling
  • Cleaner async-first developer experience
  • Better alignment between implementation and documentation

Migration

Before:

gava = GavaConnect(...)
try:
    ...
finally:
    await gava.aclose()

After:

async with GavaConnect(...) as gava:
    ...

Notes

  • Non-breaking change
  • Recommended upgrade for all async users
  • No changes to public API surface beyond lifecycle handling