Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ If you want to load REDCap data into [`pandas`](https://pandas.pydata.org/) data
$ pip install PyCap[all]
```

For secure credential management, create a `.env` file in your project root with your REDCap credentials:

```dotenv
REDCAP_API_URL=https://redcap.example.edu/api/
REDCAP_API_KEY=YourSuperSecretAPIKeyHere
```

To install the bleeding edge version from the github repo, use the following

```sh
Expand Down
17 changes: 15 additions & 2 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@

PyCap makes it very simple to interact with the data stored in your REDCap projects

> First, install python-dotenv (`poetry add python-dotenv`) and create a `.env` file in your project root with your REDCap credentials:

```dotenv
REDCAP_API_URL=https://redcap.example.edu/api/
REDCAP_API_KEY=SomeSuperSecretAPIKeyThatNobodyElseShouldHave
```

Then update your code to load the values from the environment:

```python
from dotenv import load_dotenv
import os
from redcap import Project

api_url = 'https://redcap.example.edu/api/'
api_key = 'SomeSuperSecretAPIKeyThatNobodyElseShouldHave'
load_dotenv() # Load variables from .env file

api_url = os.getenv('REDCAP_API_URL')
api_key = os.getenv('REDCAP_API_KEY')
project = Project(api_url, api_key)
```

Expand Down
Loading