VTdevelops/bond-text-extraction
0
1from __future__ import annotations2 3from dataclasses import dataclass, fields4 5 6@dataclass7class BondRecord:8 """Structured information about a single bond."""9 10 # General information11 status: str = ""12 effective_from: str = ""13 14 # Identification15 isin: str = ""16 valor: str = ""17 18 # Product details19 denomination: str = ""20 issue_size: str = ""21 legal_venue: str = ""22 security_ranking: str = ""23 issue_price_rate: str = ""24 jurisdiction_country: str = ""25 security_category: str = ""26 collateralization: str = ""27 28 # Terms29 callable_putable: str = ""30 prolongable: str = ""31 amortizable: str = ""32 increasable: str = ""33 34 # Product dates35 issue_date: str = ""36 payment_date: str = ""37 redemption_date: str = ""38 39 # Coupon payment40 coupon_frequency: str = ""41 annual_rate: str = ""42 income_begin: str = ""43 first_payment_date: str = ""44 day_count_method: str = ""45 earning_specification: str = ""46 47 # Legacy summary fields48 interest_rate: str = ""49 rating: str = ""50 51 def as_dict(self) -> dict[str, str]:52 """Return a JSON-serialisable representation."""53 return {field_.name: getattr(self, field_.name) for field_ in fields(self)}54 