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.2.0.tar.gz (20.3 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.2.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for redcaplite-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f120c764c74ac82ee4c47a8111ef1a305640146e858c3db6c202465b5a2d3c12
MD5 02f7b441f86f041232533d8df245cbc4
BLAKE2b-256 8a4f15c28b5486f69730b2dbe68737af0bfa362de7de10a683f1128fc46a29b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: redcaplite-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e69904571164f4ccd5d2bc7902a9f215ce8a151c93c0c3bbdbed43b3ef9afb6b
MD5 52b621e9018a72a3b99433c3f15c62aa
BLAKE2b-256 7a1d63feb8ec15d032a7be9ce9c58ee1a34fe36a1e49912f052bc7f24a5f25b1

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