-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqvsplit
executable file
·34 lines (25 loc) · 955 Bytes
/
qvsplit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
'''
This is a command-line tool to slice a specific set of tags from a Quiver file
into another Quiver file.
Usage:
qvslice big.qv <tag1> <tag2> ... <tagN> > smaller.qv
'''
import sys
import os
from quiver import Quiver
import argparse
#def split(self, ntags: int, outdir: str, prefix: str):
'''
This is a command-line tool to split a Quiver file into multiple Quiver files
with a specified number of tags per file.
'''
# Parse command-line arguments
parser = argparse.ArgumentParser(description='Split a Quiver file into multiple Quiver files with a specified number of tags per file.')
parser.add_argument('file', metavar='FILE', type=str, help='Quiver file to split')
parser.add_argument('ntags', metavar='NTAGS', type=int, help='Number of tags per file')
args = parser.parse_args()
# Open the Quiver file
q = Quiver(args.file, 'r')
# Split the file
q.split(args.ntags, os.getcwd(), 'split')