dd-artefact-checks¶
Checks a published code or data folder for the basics that anyone reusing it needs: a README, a licence, citation metadata, the code's dependencies and environment, file paths that work on another computer, and files that can be read without proprietary software. Each check is a fixed rule, so the same folder always gets the same report.
$ uv run dd-artefact-checks path/to/unzipped-archive -o report.json
>>> from pathlib import Path
>>> from dd_artefact_checks import check_folder
>>> [(c["check"], c["status"]) for c in check_folder(Path("analysis"))["checks"]]
[('readme', 'met'), ('licence', 'met'), ('citation', 'not_met'), ('dependencies', 'met'),
('environment', 'not_met'), ('relative_paths', 'not_met'), ('text_formats', 'met')]
It is for studies of whether published artefacts could be reused, such as checking the archive a paper links to, and for authors checking their own before deposit. It reads only the folder it is given and needs no network access.
It is contract-free and uses only the standard library: it imports no other Data Director package, so it can be copied out and published on its own (System and boundaries).
The checks¶
Each check answers met, not_met or not_applicable, with evidence: the relative paths it
rests on and, for code, line numbers. A report never quotes a file's content, so it can be shared
without sharing the artefact.
| Check | Met when | Serves |
|---|---|---|
readme |
A README* file is at the top of the folder. |
A README accompanies the data and code (TADA, SORTEE); supporting documentation (UKRI) |
licence |
A LICENSE*, LICENCE* or COPYING* file is at the top, or a top-level file has an SPDX-License-Identifier: line. The SPDX identifier is reported as written. |
A clear licence (UKRI, FAIR R1.1, FAIR4RS, TADA, SORTEE) |
citation |
CITATION.cff, codemeta.json or .zenodo.json is at the top: metadata that can name the paper the artefact belongs to. |
The artefact links to its manuscript (TADA); citation information (UKRI) |
dependencies |
Code or notebooks are present and a file names their dependencies (such as requirements.txt, pyproject.toml, environment.yml, DESCRIPTION, renv.lock, package.json, Project.toml, Makefile). Not applicable to a folder without code. |
Dependencies (TADA) |
environment |
Code or notebooks are present and the environment is described: a container (Dockerfile, Apptainer), a lock file with exact versions (uv.lock, renv.lock, Manifest.toml), Nix or Guix, or a .devcontainer or binder directory. Not applicable to a folder without code. |
Software versions, computational environments (TADA) |
relative_paths |
No string literal in code or notebooks starts with a path on one person's computer: /home/…, /Users/…, /mnt/…, /scratch/…, ~/…, C:\… and the like. Each one is reported by file and line. |
Relative file paths (TADA) |
text_formats |
Every file can be read as text (no NUL byte in its first 8 KB) and none is in a format that needs proprietary software (.docx, .xlsx, .sav, .dta, .mat, .pdf and others). Each other file is listed with why: binary or proprietary_format. |
Files open in a text editor (TADA); interoperable, non-proprietary formats (UKRI, SORTEE) |
A report also counts the folder's files, code files and notebooks, and lists its limitations.
What it does not do¶
Like the work it was written for, it measures only what is needed on the way from a paper to the reuse of its artefacts, and nothing about their value:
- It says whether something is present, never whether it is adequate: a one-line README
meets
readme. It does not judge quality, correctness, completeness or the likelihood of reuse. - It does not identify a licence from a licence file's text. Use an SPDX matcher for that, and check an SPDX identifier against the SPDX licence list.
- A binary file is not necessarily a problem. Images, HDF5 and NetCDF are binary, open formats.
text_formatslists them so that a person can decide; for a file's exact format, usedd-inventory, which identifies each file by its PRONOM record. - It does not run the code or check that it reproduces anything.
- It does not read version-control or tool directories (
.git,__pycache__,node_modules, virtual environments) or other hidden directories, and does not follow symbolic links. The report's limitations name each hidden directory it left out. - It reads files of at most 1 MB for SPDX lines and absolute paths. A notebook's line numbers are
those of the file as stored, which for
.ipynbis JSON.
The DOI records of the PID resolver give the other half: whether the artefact's identifier resolves, its licence, its version and the paper it is related to.
Credits and dependencies¶
It depends on nothing beyond Python 3.14's standard library. The checks were chosen from the UKRI research data policy, TADA, SORTEE, FAIR and FAIR4RS, as the points that any software or data artefact in any field needs for reuse, and that can be measured by rule.
Licence: MIT (LICENSE).