Python SDK for Refract — the open claim-history layer for public knowledge.
pip install refract-pyRequires the Refract CLI:
npm install -g @refract-org/clifrom refract import Refract
r = Refract()
# Analyze a page, get typed objects
events = r.analyze("Bitcoin", depth="brief")
for event in events:
print(event.event_type, event.timestamp)
# Export as pandas DataFrame
df = r.analyze("Bitcoin", as_frame=True)
print(df.groupby("event_type").size())
# Export flattened CSV-compatible rows
df = r.export("Bitcoin", format="ndjson", flatten=True, as_frame=True)AGPL-3.0.