Skip to main content

A Lightweight Python Client for REDCap

Project description

redcaplite

pytest PyPI - Version PyPI - Downloads

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_record()
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.1.tar.gz (17.4 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.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: redcaplite-1.1.1.tar.gz
  • Upload date:
  • Size: 17.4 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.1.tar.gz
Algorithm Hash digest
SHA256 8a3e4a8f9c68fd452abbf8cd793729c501b3d551d6a3662533bdc44aad6bccee
MD5 f8bc32ccae8cfca6fb954ab0e3ef89ea
BLAKE2b-256 00bc5a0f9aa9738d4579c4aa623042586c1d152c883a607a8d14bcb339196f8a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: redcaplite-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2683464a0f412db8ab273fc0fa05afd207dc3d3dbcc5e33211ef28ff39267903
MD5 f70e3dbe6b42fc634adbfd5cb81762de
BLAKE2b-256 9b7e850d5a7544af4d12c88c359de60369e514a5d597bd48bd4285aae08275d0

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