mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-16 16:51:02 +02:00
Tidy up msgpack dumper
This commit is contained in:
parent
7711b4bfed
commit
f3d090cd52
2 changed files with 29 additions and 3 deletions
|
|
@ -2,8 +2,33 @@
|
|||
|
||||
import msgpack
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
unpacker = msgpack.Unpacker(sys.stdin.buffer, raw=False)
|
||||
for unpacked in unpacker:
|
||||
print(unpacked)
|
||||
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()
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ setuptools.setup(
|
|||
"pulsar-client",
|
||||
"rdflib",
|
||||
"tabulate",
|
||||
"msgpack",
|
||||
],
|
||||
scripts=[
|
||||
"scripts/tg-graph-show",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue