DataFrame Analytics
Load the full registry into a pandas DataFrame and run analytics.
Requires the analytics extra:
pip install anchorregistry[analytics]
These examples run against Sepolia testnet (
network="sepolia"). To run against Base mainnet: replaceconfigure(network="sepolia")withconfigure(network="base"). All function calls, record structures, and output shapes are identical across networks.
[1]:
# Cell 1 — setup
from anchorregistry import configure, get_all, to_dataframe, BASE_SEPOLIA_RPC, V1A_BASE_SEPOLIA
import pandas as pd
configure(
network="base-sepolia",
contract_address=V1A_BASE_SEPOLIA,
rpc_url=BASE_SEPOLIA_RPC, # swap for Infura / Alchemy URL for faster scans
)
[2]:
# Cell 2 — load full registry into DataFrame
df = to_dataframe(get_all())
print(f"Shape: {df.shape}")
df.dtypes
Shape: (5, 28)
[2]:
ar_id str
registered bool
artifact_type_index int64
artifact_type_name str
tx str
block int64
registrant str
manifest_hash str
parent_ar_id str
descriptor str
title str
author str
tree_id str
token_commitment str
research_doi str
research_institution str
research_co_authors str
research_url str
data_data_version str
data_format str
data_row_count str
data_schema_url str
data_url str
code_git_hash str
code_license str
code_language str
code_version str
code_url str
dtype: object
[3]:
# Cell 3 — filter by artifact type
# Type-specific data fields are flattened as {type_name}_{field_name}
# e.g. RESEARCH fields -> research_doi, research_institution, research_co_authors, research_url
research_df = df[df.artifact_type_name == "RESEARCH"]
cols = ["ar_id", "title", "research_doi", "research_institution", "research_url"]
research_df[[c for c in cols if c in research_df.columns]]
[3]:
| ar_id | title | research_doi | research_institution | research_url | |
|---|---|---|---|---|---|
| 0 | AR-2026-dPXazj6 | test sepolia anchor | https://anchorregistry.com/ |
[4]:
# Cell 4 — filter by registrant
registrant_df = df[df.registrant == "0xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c44"]
registrant_df[["ar_id", "artifact_type_name", "title"]]
[4]:
| ar_id | artifact_type_name | title | |
|---|---|---|---|
| 0 | AR-2026-dPXazj6 | RESEARCH | test sepolia anchor |
| 1 | AR-2026-86pNXz1 | DATA | test sepolia data anchor |
| 2 | AR-2026-yPZBgoP | CODE | test show/hide toggle |
| 3 | AR-2026-A5kgam5 | CODE | test hide/show toggle |
| 4 | AR-2026-L5RMQQ6 | CODE | test show/hide toggle |
[5]:
# Cell 5 — group by artifact type
df.groupby("artifact_type_name").size().sort_values(ascending=False)
[5]:
artifact_type_name
CODE 3
DATA 1
RESEARCH 1
dtype: int64
[6]:
# Cell 6 — tree analysis
df.groupby("tree_id").size().sort_values(ascending=False)
[6]:
tree_id
0x06d9d299e3cea4b6e4d5f332ffb1a50f191ad942ed594b1bd734873fd2e42496 1
0x3cdfef20d8c9dc273fdd8d74245833b99cc6d87a1fbd40f6cd5293dcd59beaed 1
0xaed54c1022c6f3ac608de2a26c49859f451b268d378b5e6045643f18e6afc651 1
0xb7b004b53c169d317554f22176971e3e20b0f81612f1ea54ee60ec285ea66ff8 1
0xf07140ce4deaf3b5dac859091a079f82e9656f173593feda7895d940b8fa5d13 1
dtype: int64