Skip to content

refract-org/refract-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

refract-py

Python SDK for Refract — the open claim-history layer for public knowledge.

pip install refract-py

Requires the Refract CLI:

npm install -g @refract-org/cli

Usage

from 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)

License

AGPL-3.0.

About

Python SDK for Refract — the open claim-history layer for public knowledge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages