Skip to content

Add dividendType field to Cashtransaction#1

Open
zepaz wants to merge 18 commits into
pjmcdermott:masterfrom
zepaz:master
Open

Add dividendType field to Cashtransaction#1
zepaz wants to merge 18 commits into
pjmcdermott:masterfrom
zepaz:master

Conversation

@zepaz

@zepaz zepaz commented Apr 21, 2026

Copy link
Copy Markdown

added type and test

robcohen and others added 4 commits April 25, 2026 13:32
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>
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
zepaz added 14 commits May 18, 2026 00:16
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants