Skip to content

Instantly share code, notes, and snippets.

View yanak's full-sized avatar
🍹

Yasunori Tanaka (田中 穏識) yanak

🍹
View GitHub Profile
@mgaitan
mgaitan / jsonl2csv.py
Last active July 22, 2021 22:53
Given a json line file, return same content in csv format
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_