Aller au contenu

@univ-lehavre/atlas-researcher-profiles-cli

@univ-lehavre/atlas-researcher-profiles-cli

CLI de résolution et d’écriture de profils chercheurs via OpenAlex et REDCap.

For each researcher, the CLI:

  1. Searches OpenAlex by name (with and without middle name) and by ORCID
  2. Displays author profiles and a sample of works found
  3. Asks for confirmation before writing to REDCap
  4. Writes the deduplicated works list as JSON to the oa_references field

Prerequisites

VariableDescription
REDCAP_API_URLREDCap API URL (e.g. https://redcap.example.com/api/)
REDCAP_API_TOKENREDCap API token
OPENALEX_USER_AGENTOpenAlex user agent (e.g. mailto:contact@example.com)

Commands

from-csv <file>

Reads researchers from a CSV file, resolves their OpenAlex works, and writes results to REDCap.

CSV format — required columns: userid, last_name, middle_name, first_name, orcid

userid,last_name,middle_name,first_name,orcid
u001,Dupont,,Jean,0000-0001-2345-6789
u002,Martin,Louis,Pierre,
Fenêtre de terminal
REDCAP_API_URL=https://redcap.example.com/api/ \
REDCAP_API_TOKEN=XXXX \
OPENALEX_USER_AGENT="mailto:contact@example.com" \
atlas-researcher-profiles from-csv researchers.csv

from-crf

Fetches researchers directly from the REDCap instrument references_openalex, then resolves and writes their works back to the same instrument.

Fenêtre de terminal
REDCAP_API_URL=https://redcap.example.com/api/ \
REDCAP_API_TOKEN=XXXX \
OPENALEX_USER_AGENT="mailto:contact@example.com" \
atlas-researcher-profiles from-crf

REDCap instrument

The CLI reads from and writes to the references_openalex instrument.

FieldRole
record_id (= userid)Primary key
last_name, middle_name, first_nameUsed to build search queries
orcidUsed as a complementary search criterion
oa_referencesWritten by the CLI — JSON array of WorksResult[]

Library API

The package also exports its core services for programmatic use:

import {
parseCsv,
resolveAll,
fetchResearchers,
writeOaReferences,
} from "@univ-lehavre/atlas-researcher-profiles";
import type {
ResearcherRow,
OaReferencesRecord,
CrfConnectionConfig,
} from "@univ-lehavre/atlas-researcher-profiles";