Feature/rework kg core (#171)

* Knowledge cores with msgpack
* Put it in the cli package
* Tidy up msgpack dumper
* Created a loader
This commit is contained in:
cybermaggedon 2024-11-25 20:46:35 +00:00 committed by GitHub
parent 319f9ac04a
commit 340d7a224f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 700 additions and 4 deletions

View file

@ -0,0 +1,34 @@
#!/usr/bin/env python3
import msgpack
import sys
import argparse
def run(input_file):
with open(input_file, 'rb') as f:
unpacker = msgpack.Unpacker(f, raw=False)
for unpacked in unpacker:
print(unpacked)
def main():
parser = argparse.ArgumentParser(
prog='tg-load-pdf',
description=__doc__,
)
parser.add_argument(
'-i', '--input-file',
required=True,
help=f'Input file'
)
args = parser.parse_args()
run(**vars(args))
main()