{"id":20837789,"url":"https://github.com/astrazeneca/qscheck","last_synced_at":"2025-07-02T14:35:15.599Z","repository":{"id":38357993,"uuid":"387519707","full_name":"AstraZeneca/qscheck","owner":"AstraZeneca","description":"An R library to perform assertions and decision on input arguments.","archived":false,"fork":false,"pushed_at":"2023-10-30T11:26:32.000Z","size":372,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-18T23:01:51.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","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/AstraZeneca.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-19T15:57:27.000Z","updated_at":"2024-04-30T06:47:02.000Z","dependencies_parsed_at":"2023-02-16T20:16:09.640Z","dependency_job_id":"41341fb0-0c97-42d7-9de5-0cab07fae6b0","html_url":"https://github.com/AstraZeneca/qscheck","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraZeneca%2Fqscheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraZeneca%2Fqscheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraZeneca%2Fqscheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraZeneca%2Fqscheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstraZeneca","download_url":"https://codeload.github.com/AstraZeneca/qscheck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243196292,"owners_count":20251849,"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":[],"created_at":"2024-11-18T01:08:35.476Z","updated_at":"2025-03-12T09:41:54.250Z","avatar_url":"https://github.com/AstraZeneca.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QSCheck\n\n\n![Status](https://github.com/AstraZeneca/qscheck/actions/workflows/r.yml/badge.svg)\n[![Maturity Level](https://img.shields.io/badge/Maturity%20Level-Under%20Development-orange)](https://img.shields.io/badge/Maturity%20Level-Under%20Development-orange)\n\nQSCheck is a library to perform checks on values, data, and content. It's built on top of assertthat\nand each routine can be used as assertions to stop execution. They can also be used to\nperform decisions (e.g. in if conditions).\n\nThere is some overlap between qscheck and assertthat, as well as many similar\nchecker packages (e.g. checkr). At AstraZeneca, we needed an internally developed\nsolution for this requirement, so that we could have more flexibility on the conditions\nwe want to check and the error messages we will deliver to the user, without having\nto rely on the development cycle of external packages.\n\n## When to use it\n\nqscheck is meant to be used to ensure that routine calls receive the correct arguments,\nwith the correct lengths, keys, or values, and fail with a properly descriptive error\nif the argument does not comply with the expectation.\n\nYou should generally use qscheck for those packages that need to be used directly by\nusers or by other developers.\n\nqscheck can also be used to evaluate data and perform decisions. It is not only limited\nto assertions. You can use qscheck in if conditions and perform different actions according\nto the passed data. All check routines can only return a single TRUE or FALSE, and are therefore\nsafe to use in if conditions.\n\n## Conventions for routine and argument names\n\nThe following conventions exist for the naming of the functions:\n\n- Routine names that check for a single value (and not an array)\n  always end in _value (e.g. is_string_value will be satisfied by \"foo\",\n  but not by c(\"foo\", \"bar\")). This convention of course is only applied for\n  atomic entities that can be vectors.\n\nArguments have the following conventions. They should always be called as\nkeyworded arguments, rather than using their position, as new ones may be\nadded.\n\n- exact_* specifies that the entry must be satisfied _exactly_.\n  e.g. exact_names means that the names must be exactly as specified, no\n  more, no less.\n- required_* specifies that the entity must be satisfied at a minimum.\n  e.g. required_names means that the specified names must be present,\n  but other names may exist as well.\n- allow_(na|null) specifies that the test will pass not only for the actual\n  request, but also if the value is NA or NULL.\n- allow_na_values means that the vector is checked for presence of NAs,\n  and if present, a decision to pass the test or not will be taken accordingly.\n\n## Example\n\nCheck if an entity is a data frame with only the specified colnames \"foo\" and \"bar\", or a NULL value.\n\n```\n    assertthat::assert_that(\n        qscheck::is_data_frame(\n            my_parameter, exact_colnames = c(\"foo\", \"bar\"), allow_null = TRUE\n        )\n    )\n```\n\nIn this case, the assertion will produce a meaningful error message, specifying\nexactly what kind of information was expected in the failed assertion.\n\nThe same check can also be used in an if condition to branch execution:\n\n```\n    if (qscheck::is_data_frame(\n            my_parameter, exact_colnames = c(\"foo\", \"bar\"), allow_null = TRUE\n       )\n    )\n```\n\nThere are many different types of check function, each with additional parameters\nto diversify the expected properties. There are also check functions to combine checks together,\nor perform more advanced semantic integrity on the passed values.\n\n# Future development\n\nqscheck is still in 0.x release. Its API is therefore not fully defined, and maintaining\nbackward compatibility, while attempted as much as possible, is not guaranteed. We focus on\nan API that is communicative of intent and uniform.\n\n# Documentation\n\nThere is currently no generated documentation yet, but it will be added soon as github pages.\nFor now, the best action is to check the assertions.R file.\n\n# Contacts\n\n- Author: Stefano Borini \u003cstefano.borini@astrazeneca.com\u003e\n- Maintainer: Stefano Borini \u003cstefano.borini@astrazeneca.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrazeneca%2Fqscheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrazeneca%2Fqscheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrazeneca%2Fqscheck/lists"}