mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
* Knowledge cores with msgpack * Put it in the cli package * Tidy up msgpack dumper * Created a loader
34 lines
536 B
Python
Executable file
34 lines
536 B
Python
Executable file
#!/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()
|
|
|