Skip to main content

A Lightweight Python Client for REDCap

Project description

redcaplite

pytest

redcaplite is a Python package for interacting with the REDCap API. This package provides methods to interact with different API endpoints in a straightforward way.

Installation

To install the package, clone the repository and install it using pip:

pip install redcaplite

Usage

Importing the Package

To use the redcaplite package, import it in your Python script:

import redcaplite

Creating an Instance

Create an instance of the RedcapClient class by providing the API URL and token:

r = redcaplite.RedcapClient('https://redcap.vumc.org/api/', 'your_token')

Methods

API Name Export Import Delete
Arms get_arms() import_arms() delete_arms()
DAGs get_dags() import_dags() delete_dags()
User DAG Mapping get_user_dag_mappings() import_user_dag_mappings()
Events get_events() import_events() delete_events()
Field Names get_field_names()
File get_file() import_file() delete_file()
File Repository (File) export_file_repository() import_file_repository() delete_file_repository()
File Repository (Folder) list_file_repository() create_folder_file_repository()
Instrument get_instruments()
Instrument (PDF) export_pdf()
Form Event Mapping get_form_event_mappings() import_form_event_mappings()
Log get_logs()
Metadata get_metadata() import_metadata()
Project get_project()
get_project_xml()
import_project_settings()
Project (super user) create_project()
Record export_records()
generate_next_record_name()
import_records()
rename_records()
delete_records()
Repeating Forms Events get_repeating_forms_events() import_repeating_forms_events()
Report get_report()
Version get_version()
Survey get_survey_link()
get_survey_queue_link()
get_survey_return_code()
get_participant_list()
Users get_users() import_users() delete_users()
User Role get_user_roles() import_user_roles() delete_user_roles()
User Role Mapping get_user_role_mappings() import_user_role_mappings()

Example

Here’s a complete example of how to use the redcaplite package:

import redcaplite

# Create an instance of RedcapClient
r = redcaplite.RedcapClient('https://redcap.vumc.org/api/', 'your_token')

# Get arms
arms = r.get_arms()
print("Arms:", arms)

# Delete specific arms
r.delete_arms(arms=[3])
print("Arm 3 deleted successfully.")

Contributing

If you would like to contribute to the project, please fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redcaplite-1.1.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redcaplite-1.1.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file redcaplite-1.1.0.tar.gz.

File metadata

  • Download URL: redcaplite-1.1.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for redcaplite-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d94d04fb3647cc991dd63f5e60770863350ccc486422647fceeba35be649b6dd
MD5 3e83f66eaa7046105df34138c6f65e7b
BLAKE2b-256 7e0e9bc317b1f8e56c5b7aef1d6b09f465ff0313ae9d76c7066a0e260bb6f392

See more details on using hashes here.

File details

Details for the file redcaplite-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: redcaplite-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for redcaplite-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 277e8d71f19d904fd2084a7eaebc229c1c1d32e1ac985741236ae4f6c00282e4
MD5 332ca86d3061e28656d5acbb86905999
BLAKE2b-256 456b7eba9a1437975668f201484c9af251b69e5fbb1ecfced363068f6923e353

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page