Data sources
client.data_sources queries /v4/datasources and returns DataSource records: journals, repositories, aggregators, and CRIS systems that feed the Graph. It supports the shared operations (get, exists, search, iterate, collect, first, count, batch_get) plus the aggregation helper facets.
from bibliofabric.openaire import OpenAireClient, DataSourcesFilters
client = OpenAireClient()
Later blocks reuse this client. In your own scripts, open it with
async with OpenAireClient() as client: so that the HTTP session closes.
page = await client.data_sources.search(query="zenodo", page_size=3)
print(page.total, "matches")
for source in page.results:
print(" ", source.id, "|", source.officialName, "|", source.type.value)
16 matches
openaire____::5b0f14bf4ac4978a3dcb4fe4bd4036fc | Aladdin Aliyev | aggregator::pubsrepository::unknown Publication Repository Aggregator
opendoar____::d91d1b4d82419de8a614abce9cc0e6d4 | Dspace at IIT Bombay | pubsrepository::unknown Publication Repository
fairsharing_::8d2355364e9a2ba1f82f975414937b43 | InfraNode | datarepository::unknown Data Repository
Filter fields live in DataSourcesFilters (type, subject, jurisdiction, compatibility_name, eosc_datasource_type, country, and more). The type and jurisdiction filters return zero rows even for values copied from live records, while country and plain queries work (see upstream quirks); prefer a query until that changes.
Get one data source
source = await client.data_sources.get("opendoar____::d91d1b4d82419de8a614abce9cc0e6d4")
print(source.official_name, "|", source.openaire_compatibility, "|", source.website_url)
Dspace at IIT Bombay | Not yet registered | https://doi.org/10.5281/zenodo.16886072
get() takes the internal id and reads the V3 by-id route with its :: colons unencoded. A missing id raises NotFoundError.
Counts
n = await client.data_sources.count()
print("data sources:", n)
nl = await client.data_sources.count({"country": "NL"})
print("NL data sources:", nl)
data sources: 160444
NL data sources: 1519