Skip to main content

PyCap: Python interface to REDCap

Project description

https://secure.travis-ci.org/sburns/PyCap.png?branch=master

Intro

PyCap is a python module exposing the REDCap API through some helpful abstractions. Information about the REDCap project can be found at http://project-redcap.org/.

Available under the BSD (3-clause) license.

Features

Currently, these API calls are available:

  • Export Records
  • Export Metadata
  • Import Records

Events and Arms are automatically exported for longitudinal projects (see below).

Requirements

  • requests (> 0.12.1)

    $ easy_install requests

Usage

>>> import redcap
# Init the project with the api url and your specific api key
>>> project = redcap.Project(api_url, api_key)

# Export all data
>>> all_data = project.export_records()

# import data
>>> data = [{'subjid': i, 'age':a} for i, a in zip(range(1,6), range(7, 13))]
>>> num_processed = project.import_records(data)

# For longitudinal projects, project already contains events, arm numbers
# and arm names
>>> print project.events
...
>>> print project.arm_nums
...
>>> print project.arm_names
...

Installation

$ git clone git://github.com/sburns/PyCap.git PyCap
$ cd PyCap
$ python setup.py install

OR

$ pip install PyCap

TODO

  • More Tests
  • File export and import

HISTORY

0.5.1 (2012-10-04)

  • Fix potential issue when exporting strange characters

0.5 (2012-09-19)

  • Add initial support for longitudinal databases
  • Add helper attributes on redcap.Project class
  • Improve testing
  • Add Travis-CI testing on github

0.4.2 (2012-03-15)

  • 0.4.1 didn’t play well with pypi?

0.4.1 (2012-03-15)

  • Defend against non-unicode characters in Redcap Project

0.3.4 (2012-01-12)

  • New documentation

0.3.3 (2011-11-21)

  • Bug fix when exporting all fields

0.3.2 (2011-11-21)

  • Works with current version of requests
  • Under-the-hood changes (only json is used for RCRequest)
  • Bug fix in Project.filter

0.3.1 (2011-11-02)

  • Bug fix in import_records

0.3 (2011-09-27)

  • Using Kenneth Reitz’s request module, greatly simplifying request code.

0.21 (2011-09-14)

  • First public release on PyPI
  • Version bump

0.1 (2011-09-14)

  • Basic import, export, metadata

Project details


Release history Release notifications

History Node

1.0.2

History Node

1.0.1

History Node

1.0

History Node

0.9

History Node

0.8.1

History Node

0.8

History Node

0.7

History Node

0.6.1

History Node

0.6

History Node

0.5.2

This version
History Node

0.5.1

History Node

0.5

History Node

0.4.2

History Node

0.4

History Node

0.3.4

History Node

0.3.2

History Node

0.3

History Node

0.2

History Node

0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
PyCap-0.5.1.tar.gz (10.4 kB) Copy SHA256 hash SHA256 Source None Oct 4, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page