How to use the twarc.json2csv.text function in twarc

To help you get started, we’ve selected a few twarc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DocNow / twarc / utils / View on Github external
parser.add_argument('files', metavar='FILE', nargs='*', default=['-'], help='files to read, if empty, stdin is used')

args = parser.parse_args()

flags = 0
if args.ignore:
    flags = re.IGNORECASE

    regex = re.compile(args.regex, flags)
except Exception as e:
    sys.exit("error: regex failed to compile: {}".format(e))

for line in fileinput.input(files=args.files):
    tweet = json.loads(line)
    text = json2csv.text(tweet)
        print(line, end='')


Archive tweets from the command line

Latest version published 6 months ago

Package Health Score

69 / 100
Full package analysis

Similar packages