github Labelbase/python-bip329 1.0.0

20 hours ago

python-bip329 Version 1.0.0 Release Notes

New Features

Complete BIP-329 Accounting Fields Support

  • Added all optional fields from BIP-329 specification: height, time, fee, value, rate, keypath, fmv, heights
  • Field validation enforced by entry type (e.g., spendable only valid for output entries)
  • ISO-8601 timestamp validation for time fields
  • ISO-4217 currency code validation for rate and fmv fields

Enhanced Parsing Options

  • allow_boolsy parameter enables liberal boolean parsing ("true", "1", "yes", "false", "0", "no")
  • replace_non_utf8 option for handling invalid UTF-8 characters
  • truncate_labels option to automatically truncate long labels to 255 characters

Robust Validation

  • Lenient parser logs warnings for invalid fields but continues processing
  • Strict writer validates all fields and rejects invalid entries with clear error messages
  • Label length validation with configurable truncation
  • UTF-8 encoding validation with replacement character support

Changes

  • Constructor signatures updated (backwards compatible) with new validation parameters
  • Invalid optional fields are now removed during parsing instead of causing potential failures
  • Enhanced error messages may differ from previous versions

Improvements

  • Comprehensive test suite with 50+ test cases covering edge cases
  • Better error handling for malformed JSON and missing files
  • Field validation now type-specific and follows BIP-329 specification exactly
  • Improved logging with detailed validation warnings

Bug Fixes

  • Fixed handling of empty labels and optional fields
  • "label" was a mandatory field
  • Resolved issues with backup file creation in encrypted writer
  • Corrected field validation inconsistencies between parser and writer

Migration Guide

Update constructor calls to include new optional parameters:

# Before
parser = BIP329_Parser('file.jsonl')

# After (with new options)
parser = BIP329_Parser('file.jsonl', allow_boolsy=True, replace_non_utf8=False)

Full Changelog: Compare on GitHub with previous version for detailed commit history.

Don't miss a new python-bip329 release

NewReleases is sending notifications on new releases.