mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 08:26:21 +02:00
35 lines
536 B
Text
35 lines
536 B
Text
|
|
#!/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()
|
||
|
|
|