Skip to content

Commit

Permalink
Fix the statement width display
Browse files Browse the repository at this point in the history
  • Loading branch information
dgunning committed Nov 8, 2024
1 parent 88873eb commit bd7e801
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
18 changes: 17 additions & 1 deletion edgar/financials.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,18 +576,34 @@ def _stitch_statements(self, statement_getter):

return stitched_statement

@cached_property
def balance_sheet(self, standard: bool = True) -> Optional[Statement]:
return self.get_balance_sheet(standard=standard)

@lru_cache(maxsize=1)
def get_balance_sheet(self, standard: bool = True) -> Optional[Statement]:
return self._stitch_statements(lambda f: f.get_balance_sheet(standard=standard))

@cached_property
def income(self, standard: bool = True) -> Optional[Statement]:
return self.get_income_statement(standard=standard)

@lru_cache(maxsize=1)
def get_income_statement(self, standard: bool = True) -> Optional[Statement]:
return self._stitch_statements(lambda f: f.get_income_statement(standard=standard))

@cached_property
def cashflow(self, standard: bool = True) -> Optional[Statement]:
return self.get_cash_flow_statement(standard=standard)

@lru_cache(maxsize=1)
def get_cash_flow_statement(self, standard: bool = True) -> Optional[Statement]:
return self._stitch_statements(lambda f: f.get_cash_flow_statement(standard=standard))

@cached_property
def comprehensive_income(self, standard: bool = True) -> Optional[Statement]:
return self.get_statement_of_comprehensive_income(standard=standard)

@lru_cache(maxsize=1)
def get_statement_of_comprehensive_income(self, standard: bool = True) -> Optional[Statement]:
return self._stitch_statements(lambda f: f.get_statement_of_comprehensive_income(standard=standard))
Expand Down Expand Up @@ -616,4 +632,4 @@ def __rich__(self):
return panel

def __repr__(self):
return repr_rich(self.__rich__(), width=240)
return repr_rich(self.__rich__())
2 changes: 1 addition & 1 deletion edgar/xbrl/xbrldata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ def __rich__(self):
)

def __repr__(self):
return repr_rich(self.__rich__(), width=120)
return repr_rich(self.__rich__(), width=240)

def __str__(self):
return f"{self.display_name}"
Expand Down
2 changes: 0 additions & 2 deletions tests/test_xbrl_financials.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ async def test_get_shareholder_equity_statement_for_10K(apple_xbrl):
assert statement
print(statement)
print(statement.data)
#shareholders_equity = statement.get_concept(concept='us-gaap_StockholdersEquity')
#assert shareholders_equity.value == {'2023': '62146000000'}


def test_get_statement_definition_line_item_root(apple_xbrl):
Expand Down

0 comments on commit bd7e801

Please sign in to comment.