Releases: IamMuuo/gava-connect-plus
Release list
gava-connect-plus v0.4.1
Discoverability metadata
- Adds discoverability metadata to project for better ranking on pypi and google searches.
What's Changed
Full Changelog: v0.4.0...v0.4.1
gava-connect-plus v0.4.0
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
What's New
- Added the Fetch Taxpayer Obligations endpoint (
TaxPayer_Tax_Obligations_Fetcher) — resolves a KRA PIN's registered tax obligations viagava.obligation.fetch(pin)(async and sync), following the same pattern as the existing PIN/Station/Invoice modules - New isolated
obligationcredential scope (KRA_OBLIGATION_KEY/KRA_OBLIGATION_SECRET) - New
InvalidObligationPINErrorfor KRA response code20001
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
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_pincustomer_nameexemption_certificate_notrader_system_invoice_numberrelevant_invoice_daterelevant_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 useDecimaltype for precision. - Added
model_config = ConfigDict(json_encoders={Decimal: str})toInvoiceDetailsmodel to serializeDecimalobjects as strings, preventing floating-point precision loss. - Updated client-side serialization to use
model_dump_json(indent=4)instead ofjson.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
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 withpatterns - 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