{"id":20911041,"url":"https://github.com/lren-chuv/pfa-validator","last_synced_at":"2025-10-25T22:08:47.463Z","repository":{"id":26514523,"uuid":"104345248","full_name":"LREN-CHUV/pfa-validator","owner":"LREN-CHUV","description":"Validation of the PFA model and its predictive algorithm","archived":false,"fork":false,"pushed_at":"2023-02-15T02:08:18.000Z","size":82,"stargazers_count":2,"open_issues_count":11,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T19:59:13.223Z","etag":null,"topics":["algorithm-factory","docker-image","pfa-standard","testing"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LREN-CHUV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-21T12:28:31.000Z","updated_at":"2019-12-18T06:54:18.000Z","dependencies_parsed_at":"2024-11-18T14:19:46.945Z","dependency_job_id":"d8cd2158-09b5-4170-a0e0-1bfca9fd1032","html_url":"https://github.com/LREN-CHUV/pfa-validator","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LREN-CHUV%2Fpfa-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LREN-CHUV%2Fpfa-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LREN-CHUV%2Fpfa-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LREN-CHUV%2Fpfa-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LREN-CHUV","download_url":"https://codeload.github.com/LREN-CHUV/pfa-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253894859,"owners_count":21980414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm-factory","docker-image","pfa-standard","testing"],"created_at":"2024-11-18T14:19:02.965Z","updated_at":"2025-10-16T07:33:40.178Z","avatar_url":"https://github.com/LREN-CHUV.png","language":"Python","readme":"[![CHUV](https://img.shields.io/badge/CHUV-LREN-AF4C64.svg)](https://www.unil.ch/lren/en/home.html) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/LREN-CHUV/pfa-validator/blob/master/LICENSE) [![DockerHub](https://img.shields.io/badge/docker-hbpmip%2Fpfa--validator-008bb8.svg)](https://hub.docker.com/r/hbpmip/pfa-validator/) [![ImageVersion](https://images.microbadger.com/badges/version/hbpmip/pfa-validator.svg)](https://hub.docker.com/r/hbpmip/pfa-validator/tags \"hbpmip/pfa-validator image tags\") [![ImageLayers](https://images.microbadger.com/badges/image/hbpmip/pfa-validator.svg)](https://microbadger.com/#/images/hbpmip/pfa-validator \"hbpmip/pfa-validator on microbadger\") [![Codacy Badge](https://api.codacy.com/project/badge/Grade/96b3483a2345429fb9fc4918fa7d205b)](https://www.codacy.com/app/hbp-mip/pfa-validator?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=HBPMedical/pfa-validator\u0026amp;utm_campaign=Badge_Grade) [![CircleCI](https://circleci.com/gh/HBPMedical/pfa-validator.svg?style=svg)](https://circleci.com/gh/HBPMedical/pfa-validator)\n\n# pfa-validator\n\nA small python program that validates that a PFA document is:\n- Syntaxically correct JSON\n- Syntaxically correct PFA\n- Semantically correct PFA\n\nThis project does not perform cross-validation on the PFA document.\n\n## Usage\nThe program can be run as a **Python program** or as a **Docker container**.\n\nIt may fetch the PFA document to validate from the file system or from a PostgreSQL database.\n\n* **When fetching the PFA document from the file system**, the program expects a `PFA_PATH` environment\nvariable that contains the path to the PFA document to validate.\n\n* **When fetching the PFA document from a PostgreSQL database**, the program expects the following environment variables:\n  * `INPUT_METHOD` that must be set to `POSTGRESQL`\n  * the database's credentials: `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER` and `DB_PASSWORD`\n  * the parameters of the query to perform: `DB_TABLE` `DB_COLUMN`\n  * the job ID (used to check the job_id column and get the right PFA document): `JOB_ID`\n\nIn addition, the program will also need the following environment variables to be set up in order to get some\nvalidation data: `FEATURES_DB_HOST`, `FEATURES_DB_PORT`, `FEATURES_DB_NAME`, `FEATURES_DB_USER`, `FEATURES_DB_PASSWORD`\nand `FEATURES_DB_TABLE`\n\n### Examples\n\n#### Validate a PFA file\n1. Build the image: `docker build -t pfa-validator .`\n2. Run a container based on that image:\n\n```sh\n    docker run --volume $(pwd)/data:/data \\\n    --env PFA_PATH=\"/data/example_01_valid/model.pfa\" \\\n    --env FEATURES_DB_HOST=db \\\n    --env FEATURES_DB_PORT=5432 \\\n    --env FEATURES_DB_NAME=sample \\\n    --env FEATURES_DB_USER=sample \\\n    --env FEATURES_DB_PASSWORD=... \\\n    --env FEATURES_DB_TABLE=features \\\n    hbpmip/pfa-validator:0.10.1-2\n```\n\n#### Validate a PFA PostgreSQL column\n1. Build the image: `docker build -t pfa-validator .`\n2. Run a container based on that image:\n\n```sh\n  docker run \\\n    --env INPUT_METHOD=POSTGRESQL \\\n    --env JOB_ID=1\n    --env DB_HOST=172.20.0.2 \\\n    --env DB_PORT=5432 \\\n    --env DB_NAME=woken \\\n    --env DB_USER=woken \\\n    --env DB_PASSWORD=... \\\n    --env DB_TABLE=job_result \\\n    --env DB_COLUMN=data \\\n    --env FEATURES_DB_HOST=db \\\n    --env FEATURES_DB_PORT=5432 \\\n    --env FEATURES_DB_NAME=sample \\\n    --env FEATURES_DB_USER=sample \\\n    --env FEATURES_DB_PASSWORD=... \\\n    --env FEATURES_DB_TABLE=features \\\n    hbpmip/pfa-validator:0.10.1-2\n```\n\nNOTE: If you don't want to use Docker, you can install the dependencies with: `pip install -r requirements.txt`\nand run this program using Python2. The environment variables still have to be set up.\n\n## TODO\n\n* Allow validation of YAML formatted PFA document\n\n# Acknowledgements\n\nThis work has been funded by the European Union Seventh Framework Program (FP7/2007­2013) under grant agreement no. 604102 (HBP)\n\nThis work is part of SP8 of the Human Brain Project (SGA1).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flren-chuv%2Fpfa-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flren-chuv%2Fpfa-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flren-chuv%2Fpfa-validator/lists"}