|
1 | 1 | [](https://github.com/bids-standard/bids-validator/actions/workflows/node_tests.yml) |
2 | | -[](https://github.com/bids-standard/bids-validator/actions/workflows/python_tests.yml) |
3 | 2 | [](https://github.com/bids-standard/bids-validator/actions/workflows/test-bids-examples.yml) |
4 | 3 | [](https://circleci.com/gh/bids-standard/bids-validator) |
5 | 4 | [](https://codecov.io/gh/bids-standard/bids-validator) |
|
19 | 18 | - [On the Server](#on-the-server) |
20 | 19 | - [Through Command Line](#through-command-line) |
21 | 20 | - [Docker image](#docker-image) |
22 | | - - [Python Library](#python-library) |
23 | | - - [Example](#example) |
24 | 21 | - [Development](#development) |
25 | 22 | - [Running Locally in a Browser](#running-locally-in-a-browser) |
26 | 23 | - [Testing](#testing) |
|
46 | 43 | 1. Install Docker |
47 | 44 | 1. From a terminal run `docker run -ti --rm -v /path/to/data:/data:ro bids/validator /data` |
48 | 45 | but replace the `/path/to/data` part of the command with your own path on your machine. |
49 | | -1. Python Library: |
50 | | - 1. Install [Python](https://www.python.org/) |
51 | | - 1. Install [Pip](https://pip.pypa.io/en/stable/installing/) package manager for Python, if |
52 | | - not already installed. |
53 | | - 1. From a terminal run `pip install bids_validator` to acquire the |
54 | | - [BIDS Validator PyPI package](https://pypi.org/project/bids-validator/) |
55 | | - or `conda install bids-validator` for the |
56 | | - [Conda package](https://anaconda.org/conda-forge/bids-validator). |
57 | | - 1. Open a Python terminal and type: `python` |
58 | | - 1. Import the BIDS Validator package `from bids_validator import BIDSValidator` |
59 | | - 1. Check if a file is BIDS compatible `BIDSValidator().is_bids('/relative/path/to/a/bids/file')` |
60 | | - 1. Note, the file path must be relative to the root of the BIDS dataset, and |
61 | | - a leading forward slash `/` must be added to the file path. |
62 | 46 |
|
63 | 47 | ## Support |
64 | 48 |
|
65 | 49 | The BIDS Validator is designed to work in both the browser and in Node.js. We |
66 | 50 | target support for the latest long term stable (LTS) release of Node.js and the |
67 | 51 | latest version of Chrome. |
68 | 52 |
|
69 | | -There is also a library of helper functions written in Python, for use with BIDS |
70 | | -compliant applications written in this language. |
71 | | - |
72 | 53 | Please report any issues you experience while using these support targets via |
73 | 54 | the [GitHub issue tracker](https://github.com/bids-standard/bids-validator/issues). |
74 | 55 | If you experience issues outside of these supported environments and believe we |
@@ -385,31 +366,6 @@ See here for a brief explanation of the commands: |
385 | 366 | - the third field is optional. In our case, we use `ro` to specify that the |
386 | 367 | mounted data is _read only_ |
387 | 368 |
|
388 | | -## Python Library |
389 | | - |
390 | | -[](https://badge.fury.io/py/bids-validator) |
391 | | -[](https://anaconda.org/conda-forge/bids-validator) |
392 | | - |
393 | | -There are is a limited library of helper functions written in Python. The main function |
394 | | -determines if a file extension is compliant with the BIDS specification. You can find |
395 | | -the available functions in the library, as well as their descriptions, |
396 | | -[here](https://github.com/bids-standard/bids-validator/blob/master/bids-validator/bids_validator/bids_validator.py). |
397 | | -To install, run `pip install -U bids_validator` (requires python and pip) or |
398 | | -`conda install bids-validator` (requires a Conda environment). |
399 | | - |
400 | | -### Example |
401 | | - |
402 | | -```Python |
403 | | -from bids_validator import BIDSValidator |
404 | | -validator = BIDSValidator() |
405 | | -filepaths = ["/sub-01/anat/sub-01_rec-CSD_T1w.nii.gz", "/sub-01/anat/sub-01_acq-23_rec-CSD_T1w.exe"] |
406 | | -for filepath in filepaths: |
407 | | - print(validator.is_bids(filepath)) # will print True, and then False |
408 | | -``` |
409 | | - |
410 | | -Note, the file path must be relative to the root of the BIDS dataset, and a |
411 | | -leading forward slash `/` must be added to the file path. |
412 | | - |
413 | 369 | ## Development |
414 | 370 |
|
415 | 371 | To develop locally, clone the project and run `npm install` from the project |
@@ -465,7 +421,7 @@ Global installs are not recommended for development because of the possibility o |
465 | 421 |
|
466 | 422 | Publishing is done with [Lerna](https://github.com/lerna/lerna). Use the command `npx lerna publish` and follow instructions to set a new version. |
467 | 423 |
|
468 | | -Using lerna publish will create a git commit with updated version information and create a version number tag for it, push the tag to GitHub, then publish to NPM and PyPI. The GitHub release is manual following that. |
| 424 | +Using lerna publish will create a git commit with updated version information and create a version number tag for it, push the tag to GitHub, then publish to NPM. The GitHub release is manual following that. |
469 | 425 |
|
470 | 426 | ## Acknowledgments |
471 | 427 |
|
|
0 commit comments