-
Notifications
You must be signed in to change notification settings - Fork 9
Created a docs version of the ReadMe file. #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1562a90
Created a docs version of the ReadMe file.
Veronika271 abf9e7a
Removed parent folder
Veronika271 9ef6b7d
Changed docs name
Veronika271 5fa6757
Added a deploy_mkdocs file
Veronika271 dd80e00
Fixed paths
Veronika271 ddbef66
fixed spelling!
Veronika271 bf6ecdb
Added CNAME file (custom domain) and specified domain in yaml
Veronika271 732fcfd
Fix MkDocs configuration and GitHub Pages deployment
yibeichan 785195a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8fd7720
Fix PR #98 issues from code review
yibeichan d24830d
Add GITHUB_TOKEN to MkDocs deployment workflow for explicit authentic…
yibeichan 140b8cf
Merge branch 'main' into main
yibeichan 7aca161
Fix release workflow authentication
yibeichan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Publish docs via GitHub Pages | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Deploy docs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout main | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Deploy docs | ||
| uses: mhausenblas/mkdocs-deploy-gh-pages@master | ||
| # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.AUTO_TOKEN }} | ||
| CUSTOM_DOMAIN: optionaldomain.com | ||
| CONFIG_FILE: mkdocs.yml | ||
| EXTRA_PACKAGES: build-base | ||
| # GITHUB_DOMAIN: github.myenterprise.com | ||
| # REQUIREMENTS: folder/requirements.txt | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| ## CLI usage | ||
|
|
||
| This package installs `reproschema` Command Line Interface (CLI). | ||
|
|
||
| ``` | ||
| $ reproschema --help | ||
|
|
||
| $ A client to support interactions with ReproSchema | ||
|
|
||
| To see help for a specific command, run | ||
|
|
||
| reproschema COMMAND --help e.g. reproschema validate --help | ||
|
|
||
| Options: | ||
| --version | ||
| -l, --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL] | ||
| Log level name [default: INFO] | ||
| --help Show this message and exit. | ||
|
|
||
| Commands: | ||
| convert Converts a path to a different format, jsonld,... | ||
| create | ||
| migrate Updates to a new reproschema version | ||
| redcap2reproschema Converts REDCap CSV files to Reproschema format. | ||
| reproschema2redcap Converts reproschema protocol to REDCap CSV format. | ||
| serve | ||
| validate Validates if the path has a valid reproschema format | ||
| reproschema2fhir Generates FHIR questionnaire resources from reproschema activities | ||
| output2redcap Generates redcap csv given the audio and survey data from reproschema ui | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Welcome to Reproschema-py | ||
|
|
||
| For full documentation visit [Reproschema-py](https://github.com/ReproNim/reproschema-py). | ||
| reproschema requires Python 3.10+ | ||
|
|
||
| ## Project layout | ||
| mkdocs.yml # The configuration file. | ||
| docs/ | ||
| index.md # The documentation homepage. | ||
| installation.md #A tutorial for installation. | ||
| cli_usage.md #Notes on CLI usage | ||
| reproschema2redcap.md #How to convert from resproschema to redcap | ||
| redcap2reproschema.md #How to convert from redcap to reproscehma | ||
| output2redcap.md #How to convert the output into redcap | ||
| reproschema2fhir.md #How to convert the reproschema into an FHIR Questionnaire Resource |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| ## Installation | ||
|
|
||
| Use the following command to install reproschema: | ||
|
|
||
| ``` | ||
| pip install reproschema | ||
| ``` | ||
|
|
||
| ### Developer installation | ||
|
|
||
| Fork this repo to your own GitHub account, then clone and install your forked repo in the developer mode: | ||
|
|
||
| ``` | ||
| git clone https://github.com/<your github>/reproschema-py.git | ||
| cd reproschema-py | ||
| pip install -e . | ||
| ``` | ||
| #### Style | ||
| This repo uses pre-commit to check styling. | ||
| - Install pre-commit with pip: `pip install pre-commit` | ||
| - 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. | ||
|
|
||
| When pre-commit is used, you may have to run git commit twice, | ||
| since pre-commit may make additional changes to your code for styling and will | ||
| not commit these changes by default. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ## `output2redcap` | ||
| The `output2redcap` function is designed to process the output from reproschema-ui into a REDCap CSV file as seen [here](reproschema/example/redcap). | ||
|
|
||
|
|
||
| ### CLI Usage | ||
|
|
||
| The `output2redcap` function has been integrated into a CLI tool, use the following command: | ||
| ```bash | ||
| reproschema output2redcap ./path/to/your_reproschema-ui_files ./path/to/directory_you_want_to_save_output | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ## `redcap2reproschema` | ||
| The `redcap2reproschema` function is designed to process a given REDCap CSV file and YAML configuration to generate the output in the reproschema format. | ||
|
|
||
| ### Prerequisites | ||
| Before the conversion, ensure you have the following: | ||
|
|
||
| **YAML Configuration File**: | ||
| - Download [templates/redcap2rs.yaml](templates/redcap2rs.yaml) and fill it out with your protocol details. | ||
|
|
||
| ### YAML File Configuration | ||
| In the `templates/redcap2rs.yaml` file, provide the following information: | ||
|
|
||
| - **protocol_name**: A unique identifier for your protocol. Use underscores for spaces and avoid special characters. | ||
| - **protocol_display_name**: Name that will appear in the application. | ||
| - **protocol_description**: A brief description of your protocol. | ||
| - **redcap_version**: Version of your redcap file (you can customize it). | ||
|
|
||
| Example: | ||
| ```yaml | ||
| protocol_name: "My_Protocol" | ||
| protocol_display_name: "Assessment Protocol" | ||
| protocol_description: "This protocol is for assessing cognitive skills." | ||
| redcap_version: "X.XX.X" | ||
| ``` | ||
| ### CLI Usage | ||
|
|
||
| The `redcap2reproschema` function has been integrated into a CLI tool, use the following command: | ||
| ```bash | ||
| reproschema redcap2reproschema path/to/your_redcap_data_dic.csv path/to/your_redcap2rs.yaml | ||
| ``` | ||
|
|
||
| Optionally you can provide a path to the output directory (default is the current directory) by adding the option: `--output-path PATH` | ||
| ### Python Function Usage | ||
|
|
||
| You can also use the `redcap2reproschema` function from the `reproschema-py` package in your Python code. | ||
|
|
||
| ```python | ||
| from reproschema import redcap2reproschema | ||
|
|
||
| csv_path = "path-to/your_redcap_data_dic.csv" | ||
| yaml_path = "path-to/your_redcap2rs.yaml" | ||
| output_path = "path-to/directory_you_want_to_save_output" | ||
|
|
||
| redcap2reproschema(csv_file, yaml_file, output_path) | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ## `reproschema2fhir` | ||
| The `reproschema2fhir` function is designed to convert reproschema activities and items into a FHIR Questionnaire resource as seen [here](reproschema/example/fhir). | ||
|
|
||
| ### CLI Usage | ||
|
|
||
| The `reproschema2fhir` function has been integrated into a CLI tool, use the following command: | ||
| ```bash | ||
| reproschema reproschema2fhir ./path/to/your_reproschema_activities ./path/to/directory_you_want_to_save_output | ||
| ``` | ||
| ### Notes | ||
| 1. The script requires an active internet connection to access the GitHub repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| ## `reproschema2redcap` | ||
|
|
||
| ### CLI Usage | ||
|
|
||
| You can use this feature directly from the command line. To convert ReproSchema protocol to REDCap CSV format, use the following command | ||
|
|
||
| ``` | ||
| reproschema reproschema2redcap <input_dir_path> <output_csv_filename> | ||
| ``` | ||
|
|
||
| - `<input_dir_path>`: The path to the root folder of a protocol. For example, to convert the reproschema-demo-protocol provided by ReproNim, you can use the following commands: | ||
| ```bash | ||
| git clone https://github.com/ReproNim/reproschema-demo-protocol.git | ||
| cd reproschema-demo-protocol | ||
| pwd | ||
| ``` | ||
| In this case, the output from `pwd` (which shows your current directory path) should be your `<input_dir_path>`. | ||
| - `<output_csv_filename>`: The name of the output CSV file where the converted data will be saved. | ||
|
|
||
| ### Python Function Usage | ||
|
|
||
| You can also use the `reproschema2redcap` function from the `reproschema-py` package in your Python code. | ||
|
|
||
| ```python | ||
| from reproschema import reproschema2redcap | ||
|
|
||
| input_dir_path = "path-to/reproschema-demo-protocol" | ||
| output_csv_filename = "output.csv" | ||
|
|
||
| reproschema2redcap(input_dir_path, output_csv_filename) | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| site_name: reporschema-py | ||
| nav: | ||
| - Home: index.md | ||
| - Installation: installation.md | ||
| - CLI Usage: cli_usage.md | ||
| - Converting from reproschema to redcap: reproschema2redcap.md | ||
| - Converting from redcap to reproschema: redcap2reproschema.md | ||
| - Converting the output into redcap: output2redcap.md | ||
| - Converting the reproschema into an FHIR Questionnaire Resource: reproschema2fhir.md | ||
|
|
||
| theme: readthedocs |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to https://repronim.github.io/reproschema-py/