https://github.com/tkruer/go-redcap
Go REDCap client
https://github.com/tkruer/go-redcap
go golang redcap redcap-api
Last synced: 5 months ago
JSON representation
Go REDCap client
- Host: GitHub
- URL: https://github.com/tkruer/go-redcap
- Owner: tkruer
- License: apache-2.0
- Created: 2024-02-07T15:19:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T18:05:46.000Z (about 1 year ago)
- Last Synced: 2025-10-10T10:13:55.098Z (8 months ago)
- Topics: go, golang, redcap, redcap-api
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-redcap
> [!WARNING]
> This is a Go client for the REDCap API. It is a work in progress and is not yet feature complete as of 04/23/2024.
## Overview
It is based on the [REDCap API documentation](https://redcap.vanderbilt.edu/api/help/) and aims to provide a simple and easy-to-use interface for interacting with REDCap projects. Use this client understanding that some functionality may be limited or in development.
## Example Usage
```go
package main
import (
"fmt"
"log"
redcap "github.com/tkruer/go-redcap/pkg"
)
func main() {
// Create a new client
client := redcap.RedCapClient{
URL: "https://redcap.example.com/api/",
Token: "YOUR_API_TOKEN",
ResponseFormat: "json",
}
// Export events from a project
client.ExportEvents()
}
```
## Installation
To install the package, run:
```bash
go get github.com/tkruer/go-redcap
```
## Documentation
For more information, please refer to the [GoDoc documentation](https://pkg.go.dev/github.com/tkruer/go-redcap). You can also find additional documentation and examples in the [examples](https://github.com/tkruer/go-redcap/tree/main/examples) directory. Common use cases for this library include exporting data, importing data, and managing records in a REDCap project from either a CLI or a API wrapper.
This library is really a layer of abstraction on top of the REDCap API. It is designed to make it easier to interact with REDCap projects by providing a simple and easy-to-use interface for common tasks. It is not intended to be a complete implementation of the REDCap API, but rather a starting point for building more complex applications.
## Contributing
Contributions are welcome! Please feel free to open an issue or submit a pull request if you find a bug or would like to suggest an improvement. Before submitting a pull request, please make sure to run `go fmt` and `go test` to ensure that your code is properly formatted and passes all tests.
## Features
Currently, these API calls are available:
Certainly! Below are the markdown tables for the documentation, with a single column for the feature and a checkmark (✅) indicating the capability.
### Export
| Feature | Available |
|---------------------------------|:---------:|
| Arms | ✅ |
| Data Access Groups | ✅ |
| Events | ✅ |
| Field names | ✅ |
| Instruments | ✅ |
| Instrument-event mapping | ✅ |
| File | ✅ |
| Logging | ✅ |
| Metadata | ✅ |
| Project Info | ✅ |
| PDF of instruments | ✅ |
| Records | ✅ |
| Repeating instruments and events| ✅ |
| Report | ✅ |
| Survey participant list | ✅ |
| Users | ✅ |
| User-DAG assignment | ✅ |
| User Roles | ✅ |
| User-Role assignment | ✅ |
| Version | ✅ |
### Import
| Feature | Available |
|---------------------------------|:---------:|
| Arms | ✅ |
| Data Access Groups | ✅ |
| Events | ✅ |
| File | ✅ |
| Instrument-event mapping | ✅ |
| Metadata | ✅ |
| Records | ✅ |
| Repeating instruments and events| ✅ |
| Users | ✅ |
| User-DAG assignment | ✅ |
| User Roles | ✅ |
| User-Role assignment | ✅ |
### Delete
| Feature | Available |
|---------------------------------|:---------:|
| Arms | ✅ |
| Data Access Groups | ✅ |
| Events | ✅ |
| File | ✅ |
| Records | ✅ |
| Users | ✅ |
| User Roles | ✅ |
### Other
| Feature | Available |
|--------------------------------|:---------:|
| Generate next record name | ✅ |
| Switch data access group | ✅ |
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/tkruer/go-redcap/tree/main/LICENSE) file for details.