This repository contains a collection of Python scripts designed to facilitate the integration of Research Organization Registry (ROR) IDs with a Pure instance. These scripts are useful for extracting data from a Pure instance, querying the ROR API for matching organizations, and updating the external organizations in Pure with ROR IDs.
- getror-rorapi.py: Queries the ROR API with external organization names from a Pure instance to find potential matching ROR IDs.
- getror-docker.py: Similar to
getror-rorapi.py
but designed to work with a local ROR API instance, run via Docker. Info here - csv-to-ror_docker.py: Reads a CSV file containing organization names and UUIDs, queries a local ROR API Docker instance for matches, and generates an output CSV with ROR IDs.
- writeror2pure.py: Takes the output CSV from the ROR querying scripts and updates the Pure instance with ROR IDs.
- merge_ex_orgs_by_rorid.py: Merge external organizations in Pure based on a CSV file containing Pure UUID, Workflow step and ROR ID
- Python 3.x
- Requests library
- CSV and OS standard libraries (included with Python)
- API key for Pure with read/write rights to the /external-organizations/* endpoint
- Docker (if relevant)
- Run in a staging/test envriroment before moving to production!
- Check the results in the csv file, and filter out wrong IDs before writing data back to Pure
- Clone this repository to your local machine.
- Ensure you have Python 3.x installed.
- Install the required Python packages by running
pip install requests
.
When running the scripts, you need to input variables such as API keys, base URLs and csv file locations.
To query the ROR API for organization matches, run:
python getror-rorapi.py
Or, if you're using a local ROR API Docker instance:
python getror-docker.py
To generate a CSV with organization names, UUIDs, and their corresponding ROR IDs:
python csv-to-ror_docker.py
To update your Pure instance with ROR IDs from a generated CSV file:
python writeror2pure.py
To merge external organizations in Pure based on a CSV file containing Pure UUID, Workflow step and ROR ID.:
python merge_ex_orgs_by_rorid.py
Contributions to this repository are welcome. Please fork the repository and submit a pull request with your changes.