Downloads .ksy
files and their dependencies straight from the official kaitai-struct format gallery.
This tool will:
- Fetch any of the official specifications
- Fetch only their dependencies
- Organize the specifications into separate directories based on the category of the specification
- Rewrite the import paths of the dependencies so that they use relative paths
This makes it easy to include, modify, and share official and community created kaitai-struct specifications in individual projects.
$ git clone https://github.com/tins2831/ksy-dl.git
$ cd ksy-dl
$ python3 -m pip install --user -r requirements.txt
usage: python3 ksy-dl.py QUERY OUTPUT_DIR
...
Examples:
$ python3 ksy-dl.py "network/pcap" .
$ python3 ksy-dl.py "pcap" ../kaitai # will create non-existing directories too
$ python3 ksy-dl.py "/network/pcap" network/
$ python3 ksy-dl.py "pcap.ksy" .
$ python3 ksy-dl.py "google_protobuf" .
First, clone the kaitai format gallery from github:
$ git clone https://github.com/kaitai-io/kaitai_struct_formats.git
Then adjust and append this to your crontab:
# Update ksy-dl format db.
# Runs every day at midnight.
00 00 * * * (KAITAI_FMT_REPO=<path to repo> <path to ksy-dl repo>/tools/db-update.sh)