This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
import argparse | |
import jsonlines | |
import csv | |
def jsonl2csv(filepath, type_=None, include=None, exclude=None): | |
def valid_type(item): | |
if type_: | |
return item.get('_type') == type_ |