@univ-lehavre/atlas-researcher-profiles-cli
v1.4.5
Published
Researcher profiles CLI: fetch OpenAlex works from CSV or REDCap and write to REDCap
Readme
@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:
- Searches OpenAlex by name (with and without middle name) and by ORCID
- Displays author profiles and a sample of works found
- Asks for confirmation before writing to REDCap
- Writes the deduplicated works list as JSON to the
oa_referencesfield
Prerequisites
| Variable | Description |
| --------------------- | ------------------------------------------------------- |
| REDCAP_API_URL | REDCap API URL (e.g. https://redcap.example.com/api/) |
| REDCAP_API_TOKEN | REDCap API token |
| OPENALEX_USER_AGENT | OpenAlex user agent (e.g. mailto:[email protected]) |
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,REDCAP_API_URL=https://redcap.example.com/api/ \
REDCAP_API_TOKEN=XXXX \
OPENALEX_USER_AGENT="mailto:[email protected]" \
atlas-researcher-profiles from-csv researchers.csvfrom-crf
Fetches researchers directly from the REDCap instrument references_openalex, then resolves and writes their works back to the same instrument.
REDCAP_API_URL=https://redcap.example.com/api/ \
REDCAP_API_TOKEN=XXXX \
OPENALEX_USER_AGENT="mailto:[email protected]" \
atlas-researcher-profiles from-crfREDCap instrument
The CLI reads from and writes to the references_openalex instrument.
| Field | Role |
| ---------------------------------------- | ------------------------------------------------------ |
| record_id (= userid) | Primary key |
| last_name, middle_name, first_name | Used to build search queries |
| orcid | Used as a complementary search criterion |
| oa_references | Written 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";