Skip to content

Downloads .ksy files and their dependencies straight from the official kaitai-struct format gallery.

License

Notifications You must be signed in to change notification settings

tins2831/ksy-dl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ksy-dl

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.

Requirements

$ git clone https://github.com/tins2831/ksy-dl.git
$ cd ksy-dl
$ python3 -m pip install --user -r requirements.txt

Usage

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" .

Auto-updating the database

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)

About

Downloads .ksy files and their dependencies straight from the official kaitai-struct format gallery.

Topics

Resources

License

Stars

Watchers

Forks