44
55## Installation
66
7- reproschema requires Python 3.7 +.
7+ reproschema requires Python 3.10 +.
88
99```
1010pip install reproschema
1111```
1212
1313### Developer installation
1414
15- Install repo in developer mode:
15+ After you create a fork, you can clone and install repo in developer mode:
1616
1717```
18- git clone https://github.com/ReproNim /reproschema-py.git
18+ git clone https://github.com/<your github> /reproschema-py.git
1919cd reproschema-py
2020pip install -e .[dev]
2121```
22+ #### Style
23+ This repo uses pre-commit to check styling.
24+ - Install pre-commit with pip: ` pip install pre-commit `
25+ - In order to use it with the repository, you have to run ` run pre-commit install ` in the root directory the first time you use it.
2226
23- It is also useful to install pre-commit, which takes care of styling when
24- committing code. When pre-commit is used you may have to run git commit twice,
27+ When pre-commit is used you may have to run git commit twice,
2528since pre-commit may make additional changes to your code for styling and will
26- not commit these changes by default:
29+ not commit these changes by default.
30+
2731
28- ```
29- pre-commit install
30- ```
3132## CLI usage
3233
33- This package installs ` reproschema ` a CLI.
34+ This package installs ` reproschema ` Command Line Interface ( CLI) .
3435
3536```
36- $ reproschema
37- Usage: reproschema [OPTIONS] COMMAND [ARGS]...
37+ $ reproschema --help
3838
39- A client to support interactions with ReproSchema
39+ $ A client to support interactions with ReproSchema
4040
4141 To see help for a specific command, run
4242
@@ -49,17 +49,18 @@ Options:
4949 --help Show this message and exit.
5050
5151Commands:
52- convert
52+ convert Converts a path to a different format, jsonld,...
5353 create
54- redcap2reproschema Convert REDCap CSV files to Reproschema format.
55- reproschema2redcap Convert reproschema protocol to REDCap CSV format.
54+ migrate Updates to a new reproschema version
55+ redcap2reproschema Converts REDCap CSV files to Reproschema format.
56+ reproschema2redcap Converts reproschema protocol to REDCap CSV format.
5657 serve
57- validate
58+ validate Validates if the path has a valid reproschema format
5859```
5960
60- ## ` reproschema2redcap ` Usage
61+ ## ` reproschema2redcap `
6162
62- ### Command-Line Usage
63+ ### CLI Usage
6364
6465You can use this feature directly from the command line. To convert ReproSchema protocol to REDCap CSV format, use the following command
6566
@@ -73,7 +74,7 @@ reproschema reproschema2redcap <input_dir_path> <output_csv_filename>
7374 cd reproschema-demo-protocol
7475 pwd
7576 ```
76- In this case, the output from ` pwd ` (which shows your current directory path)should be your ` <input_dir_path> ` .
77+ In this case, the output from ` pwd ` (which shows your current directory path) should be your ` <input_dir_path> ` .
7778- ` <output_csv_filename> ` : The name of the output CSV file where the converted data will be saved.
7879
7980### Python Function Usage
@@ -89,7 +90,7 @@ output_csv_filename = "output.csv"
8990reproschema2redcap(input_dir_path, output_csv_filename)
9091```
9192
92- ## ` redcap2reproschema ` Usage
93+ ## ` redcap2reproschema `
9394The ` redcap2reproschema ` function is designed to process a given REDCap CSV file and YAML configuration to generate the output in the reproschema format.
9495
9596### Prerequisites
@@ -111,13 +112,14 @@ protocol_name: "My_Protocol"
111112protocol_display_name : " Assessment Protocol"
112113protocol_description : " This protocol is for assessing cognitive skills."
113114` ` `
114- ### Command-Line Usage
115+ ### CLI Usage
115116
116117The ` redcap2reproschema`` function has been integrated into a CLI tool, use the following command:
117118` ` ` bash
118119reproschema redcap2reproschema path/to/your_redcap_data_dic.csv path/to/your_redcap2rs.yaml
119120` ` `
120121
122+ Optionally you can provide a path to the output directory (defaults is the current directory) by adding option : ` --output-path PATH`
121123# ## Python Function Usage
122124
123125You can also use the `redcap2reproschema` function from the `reproschema-py` package in your Python code.
@@ -127,15 +129,10 @@ from reproschema import redcap2reproschema
127129
128130csv_path = "path-to/your_redcap_data_dic.csv"
129131yaml_path = "path-to/your_redcap2rs.yaml"
132+ output_path = "path-to/directory_you_want_to_save_output"
130133
131- reproschema2redcap(input_dir_path, output_csv_filename )
134+ reproschema2redcap(csv_file, yaml_file, output_path )
132135` ` `
133136
134- After configuring the YAML file :
135-
136- 1. Run the Python script with the paths to your CSV file and the YAML file as arguments.
137- 2. Command Format : ` python script_name.py path/to/your_redcap_data_dic.csv path/to/your_redcap2rs.yaml`
138-
139137# ## Notes
1401381. The script requires an active internet connection to access the GitHub repository.
141- 2. Make sure you use `git add`, `git commit`, `git push` properly afterwards to maintain a good version control for your converted data.
0 commit comments