bids-validator
bids-validator copied to clipboard
Request for a Python Variant of JS bids-validator
Our team frequently utilizes the JS bids-validator and appreciates its robust capabilities.
Given the increasing adoption of Python in the neuroimaging community and some challenges we face using the Node-based validator, we wonder if there's any consideration or roadmap for a Python-centric version of the bids-validator.
Specifically:
- We find the process of installing node, executing it as a child process, and subsequently handling its results to be less than seamless.
- The current validation mechanism in pybids, while functional, doesn't quite capture all intricacies, leading to issues when utilizing certain BIDS-apps.
While we're keen on the idea of a py-bids-validator
, our team's resources might be stretched to take the lead. However, we're enthusiastic about contributing if such a project is initiated.
Thank you for considering this feedback.
Just to make sure it is mentioned.
There is already a python library that can help do a "superficial" validation of bids filenames:
https://github.com/bids-standard/bids-validator/tree/master/bids-validator#python-library
https://pypi.org/project/bids-validator/
Also if Node installation is source of trouble but docker is not, consider using the docker image of the validator:
https://hub.docker.com/r/bids/validator
We also have the start of a validator in the BIDS specification repository: https://github.com/bids-standard/bids-specification/blob/master/tools/schemacode/bidsschematools/validator.py
This is installed with the Python package bidsschematools
. Right now, it's just a Python interface, and it only does filename validation. It's been written toward the DANDI archive's use for BIDS validation, so the API may need refinement to fit other use cases.
Note that I've started scoping out a design in this doc:
https://demo.hedgedoc.org/s/yvkCVA3kh#
Thank you, @effigies. Looking forward to this tool. Please let me know if you need help with testing, brainstorming, etc.
Please see https://github.com/bids-standard/python-validator, which has been moved out of this repository.
Contributions are more than welcome, and I've begun fleshing out some more of the validator structures in https://github.com/bids-standard/python-validator/pull/2. It is currently a side-project for me, as the javascript validator is the most critical goal. I would be happy to discuss and hand off work with someone if they have the time and energy to put into it.
Please see https://github.com/bids-standard/python-validator, which has been moved out of this repository.
Contributions are more than welcome, and I've begun fleshing out some more of the validator structures in bids-standard/python-validator#2. It is currently a side-project for me, as the javascript validator is the most critical goal. I would be happy to discuss and hand off work with someone if they have the time and energy to put into it.
probably worth making an "announcement" about this
Sure. Where? bids-discussion
? Or update the README?
update the README
Let's start with this but I was thinking of a mini-blog post on the new bids website that we could then advertise in the mailing list, neurostars and social medias.
Maybe something that reminds people of the deno validator?
Yeah, a blog post sounds good. It would be good to walk through the overall schema world:
v1.14.6
graph LR;
subgraph bids-specification;
markdown ---> specification
schema --> bidsschematools --> specification & schema.json
end
subgraph "bids-validator @ v1.14.6";
regex["filename patterns"] --> Node.js & python
deno
end
specification -. interpreted .-> regex
schema.json --> deno
v1.14.7
graph LR;
subgraph bids-specification;
markdown ---> specification
schema --> bidsschematools --> specification & schema.json
end
subgraph "bids-validator @ v1.14.7";
regex["filename patterns"] --> Node.js
deno
python
end
specification -. interpreted .-> regex
schema.json --> deno
bidsschematools --> python
v1.14.8+
graph LR;
subgraph bids-specification;
markdown ---> specification
schema --> bidsschematools --> specification & schema.json
end
subgraph "bids-validator > v1.14.7";
regex["filename patterns"] --> Node.js
deno
end
subgraph "python-validator > v1.14.7";
python
end
specification -. interpreted .-> regex
schema.json --> deno
bidsschematools ---> python