财报规范化与来源保留
原能力
规范化三张财务报表,保留报表原值、倍率转换、会计期间和完整来源。(合同附件 R7 8.2)
首选项目
EdgarTools(MIT)。 EdgarTools
匹配范围
XBRL 读取和报表版面可提取三张表。
源码
EdgarTools · def xbrl(
edgar/_filings.py · 1874–1887 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def xbrl(self) -> Optional[XBRL]:
"""
Get the XBRL document for the filing, parsed and as a FilingXbrl object
:return: The parsed XBRL, or `None` when the filing carries no XBRL
attachments — a property of the filing, not a failure to read it,
and one this keeps answering quietly in 6.0 (docs/upgrade/6.0.md).
"""
# The `except XBRLFilingWithNoXbrlData` that used to sit here was dead:
# nothing in the library raised that error, and `from_filing` signals
# the no-XBRL case by returning None. Removed rather than left as
# decoration, so this function's None has one visible source.
try:
return XBRL.from_filing(self)
EdgarTools · def income_statement(
edgar/financials.py · 249–262 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def income_statement(self, *, view: ViewType = None):
"""
Get the income statement.
Args:
view: StatementView controlling dimensional data display.
STANDARD: Face presentation matching SEC Viewer (display default)
DETAILED: All dimensional data included (to_dataframe default)
SUMMARY: Non-dimensional totals only
Returns:
A Statement object for the income statement, or None if not available
"""
if self.xb is None:
Docling · def convert(
docling/document_converter.py · 696–709 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def convert(
self,
source: Union[Path, str, DocumentStream, HttpSource], # TODO review naming
headers: Optional[dict[str, str]] = None,
raises_on_error: bool = True,
max_num_pages: int = sys.maxsize,
max_file_size: int = sys.maxsize,
page_range: PageRange = DEFAULT_PAGE_RANGE,
progress_callback: Optional[ProgressCallback] = None,
) -> ConversionResult:
"""Convert one document fetched from a file path, URL, or DocumentStream.
A generic ZIP archive can contain multiple documents. Use ``convert_all``
for such archives. This method raises ``ConversionError`` instead of
- # SPDX-License-Identifier: MIT
实现与验收要点
跨会计准则的财报规范化、倍率和来源级证据链。