https://github.com/unaisaralegui/redcapy
Library for accessing RedCap API from Python.
https://github.com/unaisaralegui/redcapy
python redcap redcap-api
Last synced: 5 months ago
JSON representation
Library for accessing RedCap API from Python.
- Host: GitHub
- URL: https://github.com/unaisaralegui/redcapy
- Owner: unaisaralegui
- License: mit
- Created: 2021-04-27T06:20:57.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-04-27T07:27:00.000Z (about 5 years ago)
- Last Synced: 2025-09-20T12:24:01.484Z (8 months ago)
- Topics: python, redcap, redcap-api
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redcapy
Library for accessing RedCap API from Python
## Installation
Install the package with pip directly with:
```console
pip install redcapy
```
## Implemented functionalities
### Get data from API
By now the implemented functionalities are for obtaining data from the REDCAP server, no API calls related with saving new data data or deleting data has been implemented. Available API calls are:
```python
import redcapy
import datetime
redcap_handler = redcapy.request.APIHandler(api_url=api_url, token=token)
metadata = redcap_handler.get_metadata()
redcap_version = redcap_handler.get_redcap_version()
users = redcap_handler.get_users()
arms = redcap_handler.get_arms()
events = redcap_handler.get_events()
field_names = redcap_handler.get_field_names()
file = redcap_handler.get_file(record=1)
form_event_mapping = redcap_handler.get_form_event_mapping()
instruments_pdf = redcap_handler.get_instruments_pdf(output_file="./instruments.pdf")
instruments = redcap_handler.get_instruments()
project = redcap_handler.get_project_info()
report = redcap_handler.get_reports(1)
participant_list = redcap_handler.get_participant_list(instrument=instruments[-1]['instrument_name'])
records = redcap_handler.get_records()
date_range_begin = datetime.datetime.strptime("2019-10-10", "%Y-%m-%d")
date_range_end = datetime.datetime.strptime("2019-12-10", "%Y-%m-%d")
records = redcap_handler.get_records(date_range_begin=date_range_begin, date_range_end=date_range_end)
```