公开证据整理
原能力
记录披露、数据与来源的实际可得时间和版本,保留缺失与修订。(细化版 p.16–17)
首选项目
EdgarTools(MIT)。 EdgarTools
匹配范围
公开披露读取和可增量采集的数据接口。
源码
EdgarTools · class Entity(
edgar/entity/core.py · 225–238 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
class Entity(SecFiler):
"""
Represents any entity that files with the SEC.
This is the base concrete implementation that can be used directly
or specialized for specific entity types.
"""
def __init__(self, cik_or_identifier: Union[str, int]):
# If it's a ticker, convert to CIK first
if isinstance(cik_or_identifier, str) and not cik_or_identifier.isdigit():
cik = find_cik(cik_or_identifier)
if cik is None:
raise CompanyNotFoundError(
dlt · class Incremental(
dlt/extract/incremental/__init__.py · 99–112 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
class Incremental(
ItemTransform[TDataItem, IncrementalCustomMetrics], BaseConfiguration, Generic[TCursorValue]
):
"""Adds incremental extraction for a resource by storing a cursor value in persistent state.
The cursor could for example be a timestamp for when the record was created and you can use this to load only
new records created since the last run of the pipeline.
To use this the resource function should have an argument either type annotated with `Incremental` or a default `Incremental` instance.
For example:
>>> @dlt.resource(primary_key='id')
>>> def some_data(created_at=dlt.sources.incremental('created_at', '2023-01-01T00:00:00Z'):
>>> yield from request_data(created_after=created_at.last_value)
实现与验收要点
时点、授权、实际取得时间和来源更正。