-
Notifications
You must be signed in to change notification settings - Fork 0
/
mk_pkg.py
executable file
·49 lines (37 loc) · 1.15 KB
/
mk_pkg.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3
"""
Author : Ken Youens-Clark <[email protected]>
Date : 2020-01-09
Purpose: Make datapackage
"""
import argparse
import os
import sys
from datapackage import Package
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Make datapackage',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('file',
metavar='FILE',
type=argparse.FileType('r'),
help='Input file(s)')
parser.add_argument('-o',
'--outdir',
help='Output directory',
metavar='str',
type=str,
default=os.getcwd())
return parser.parse_args()
# --------------------------------------------------
def main():
"""Make a jazz noise here"""
args = get_args()
package = Package()
package.infer(args.file)
print(package.descriptor)
# --------------------------------------------------
if __name__ == '__main__':
main()