Skip to content

Instantly share code, notes, and snippets.

View studiawan's full-sized avatar

Hudan Studiawan studiawan

View GitHub Profile
@studiawan
studiawan / parallel-log-parser-chunk.py
Created May 27, 2020 02:42
Parallel log parser with PyParsing and multiprocessing. Read the log file in chunk.
import sys
import multiprocessing
import csv
from pyparsing import Word, alphas, Suppress, Combine, string, nums, Optional, Regex
from itertools import zip_longest
class ParallelLogParser(object):
def __init__(self, log_file):
self.log_file = log_file