Skip to content

kaitai-io/kaitai_struct_samples

Repository files navigation

Kaitai Struct: sample library

REUSE compliance check

A library of sample files for testing file format specifications from the Kaitai Struct: format library.

Contributing

Before adding a new file, it's necessary to find out who owns the copyright and under what license the file was released. If the file is hosted in a repository on GitHub and you know the hash of a commit in which the file was added, this shell command may help you with finding the author, who is usually also the copyright holder (needs curl and jq):

Shell command for extracting the commit author
gh_auth_token=__YOUR_TOKEN__ # get __YOUR_TOKEN__ from https://github.com/settings/personal-access-tokens (public access)

repo=ElyesH/coreboot
sha=e0af9fcb2d526ffd654d0bb573dd5333d0d76269
curl \
  --fail-with-body -sSL \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $gh_auth_token" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  "https://api.github.com/repos/$repo/commits/$sha" \
| jq '{html_url, message: .commit.message | .[0:index("\n\n")], author: .commit.author, spdx: {copyright: (.commit.author.name + " <" + .commit.author.email + ">"), year: (if .commit.author.date | index("-") == 4 then .commit.author.date | .[0:4] else null end)}}'
Example command output
{
  "html_url": "https://github.com/ElyesH/coreboot/commit/e0af9fcb2d526ffd654d0bb573dd5333d0d76269",
  "message": "tests: Add lib/edid-test test case",
  "author": {
    "name": "Jakub Czapiga",
    "email": "jacz@semihalf.com",
    "date": "2020-10-09T14:02:46Z"
  },
  "spdx": {
    "copyright": "Jakub Czapiga <jacz@semihalf.com>",
    "year": "2020"
  }
}

When you know the copyright owner, find the license of the file. Then follow the REUSE tutorial to find out how to add the information to the repository.

You can use the REUSE helper tool (hosted primarily on Codeberg, but a mirror is also available on GitHub), which helps ensure that this project is compliant with the REUSE Specification. It is strongly recommended to use uv to install and manage the REUSE tool. This repository contains pyproject.toml and uv.lock, which lock the exact versions of reuse and its dependencies. That means you only need to install uv (which can optionally also be used to install and manage Python), and then always invoke the REUSE tool as uv run reuse <command>. This ensures that the version of the reuse tool is consistent across all developer machines and in the CI environment (GitHub Actions workflow reuse-lint.yml).

The most useful command is reuse annotate:

uv run reuse annotate -y 2026 -c 'Jane Doe <jane@example.com>' -l 'CC0-1.0' category/format/sample.bin

The usage of all commands is explained in the documentation.

Licensing

This repository uses REUSE to track copyright and licensing information, so check the comment headers of individual files, or a file of the same name with the .license extension appended (in the case of binary, uncommentable or generated files).

About

Kaitai Struct: library of sample files for testing

Resources

Stars

5 stars

Watchers

6 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors