Add dividendType field to Cashtransaction#1
Open
zepaz wants to merge 18 commits into
Open
Conversation
Bug fixes: - __version__.py: __description__ was a tuple due to a stray comma, shipping broken metadata to PyPI - Types.py: FlexStatement.__repr__ was silently broken under PEP 563 (self.__annotations__ values are strings, so the .__origin__ check always failed). Also fixed a missing comma in FlexQueryResponse.__repr__ - Types.py: removed duplicate `currency` field in EquitySummaryByReportDateInBase (caught by mypy) - parser.py: deleted unreachable code after raise in prep_datetime; removed two stale `# type: ignore` comments; fixed annotation Class: Type[Types.FlexElement] - client.py: lazy-import requests so `import ibflex` works without the optional `web` extra installed - client.py: handle timezones beyond EST/EDT (CST/CDT/MST/MDT/PST/PDT/ UTC/GMT plus graceful fallback) instead of KeyError Tooling: - pyproject.toml: PEP 621 metadata with dynamic version, web/dev extras, consolidated tool config (pytest, coverage, mypy, ruff). Removed setup.py and setup.cfg - Replaced abandoned nose with pytest + pytest-cov; coverage now gated at 85% (currently 97%) - Replaced flake8/black with ruff; CI lint job uses astral-sh/ruff-action. Auto-fixed 54 trivia (unused imports, sort imports, super(), etc.) - CI split into ruff/mypy/pytest jobs; pytest matrix now covers Python 3.9-3.13 - Added flake.nix providing dev shells for py312/py313, a buildable package output, and shellHook usage hints - Added .github/workflows/nix.yml running `nix flake check`, dev-shell pytest+mypy, and `nix build` - Updated Makefile and removed broken release-process docstring; publishing now flows through publish.yml on GitHub Release Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fix latent bugs and modernize tooling
Combines the substantive ibflex/* and tests/* changes from PRs #1-5 into a single branch on top of the cleanup work in PR robcohen#6. Includes (union of all PRs): - New StockGrantActivity dataclass with test coverage (PR #1, #2, robcohen#4, robcohen#5) - Many new fields across Trade, Lot, SymbolSummary, AssetSummary, Order, OptionEAE, Transfer, CorporateAction, CashTransaction, SecurityInfo, TransactionTax, EquitySummaryByReportDateInBase, CashReportCurrency: figi, issuerCountryCode, costBasis, realizedPL, dividendType, settleDate, positionInstructionID/SetID, levelOfDetail, subCategory, orderId, cgtWithholdingAccruals*, liteSurchargeAccruals*, otherIncomeMTD/YTD, etc. - initialInvestment: Decimal -> bool (PR #2/robcohen#4 type correction) - New enum values: LIQUIDATION_FORCED ('LF'), ADR, LIT, OTC - Yes/No bool prep accepted in addition to Y/N - 'MULTI' date/datetime returns None instead of raising - Opt-in unknown-attribute tolerance: enable_unknown_attribute_tolerance() / disable_unknown_attribute_tolerance() - Comprehensive parser tests for tolerance and new field shapes Excluded (already on master or branding-conflicting): - README.rst vroonhof.vendored notice - ibflex/__version__.py URL/version branding - setup.py / setup.cfg (replaced by pyproject.toml) - nose -> pytest, flake8/black -> ruff, CI workflow rewrite - ibflex/client.py AKE FIX URL hardcode (already removed on master) Adjustments during integration: - Restored master's sorted __all__ in Types.py - Restored master's fixed FlexQueryResponse and FlexStatement __repr__ methods (PR squashes regressed them) - Restored Class: Type[Types.FlexElement] annotation in parse_element_attr - Removed stale `# type: ignore` comments - Dropped duplicate `currency` field in EquitySummaryByReportDateInBase - Dropped ~10 duplicate fields in SymbolSummary - Added missing PR robcohen#4-only fields to TransactionTax (subCategory, figi, issuerCountryCode, settleDate, orderId, etc.) - Removed `# coding: utf-8` declarations and other ruff-flagged lint trivia Co-Authored-By: pjmcdermott <10463288+pjmcdermott@users.noreply.github.com> Co-Authored-By: vroonhof <38109466+vroonhof@users.noreply.github.com> Co-Authored-By: zepaz <56244702+zepaz@users.noreply.github.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Integrate all open PRs onto cleaned-up master
…ansactionTaxes container - add subCategory plus newer IB attributes on TransactionTaxDetail (figi, issuerCountryCode, settleDate, orderId, serialNumber, deliveryType, commodityType, fineness, weight) - type FlexStatement.TransactionTaxes as Tuple[Union[TransactionTax, TransactionTaxDetail], ...] instead of bare Tuple - add regression test for parsing TransactionTaxDetail with subCategory/figi/issuerCountryCode
…ansactionTaxes container - add subCategory plus newer IB attributes on TransactionTaxDetail (figi, issuerCountryCode, settleDate, orderId, serialNumber, deliveryType, commodityType, fineness, weight) - type FlexStatement.TransactionTaxes as Tuple[Union[TransactionTax, TransactionTaxDetail], ...] instead of bare Tuple - add regression test for parsing TransactionTaxDetail with subCategory/figi/issuerCountryCode
# Conflicts: # tests/test_types.py
# Conflicts: # .pre-commit-config.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
added type and test