mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 16:36:21 +02:00
24 lines
416 B
Python
Executable file
24 lines
416 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import pyarrow as pa
|
|
import pyarrow.csv as pc
|
|
import pyarrow.parquet as pq
|
|
import pandas as pd
|
|
import sys
|
|
|
|
df = None
|
|
|
|
for file in sys.argv[1:]:
|
|
|
|
part = pq.read_table(file).to_pandas()
|
|
|
|
if df is None:
|
|
df = part
|
|
else:
|
|
df = pd.concat([df, part], ignore_index=True)
|
|
|
|
if df is not None:
|
|
|
|
table = pa.Table.from_pandas(df)
|
|
pc.write_csv(table, sys.stdout.buffer)
|
|
|