Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream parser #12

Open
Andrei-Pozolotin opened this issue Nov 13, 2019 · 1 comment
Open

stream parser #12

Andrei-Pozolotin opened this issue Nov 13, 2019 · 1 comment

Comments

@Andrei-Pozolotin
Copy link

  1. current code is bound to using *.pcap file
    https://github.com/vfrazao-ns1/IEXTools/blob/master/IEXTools/IEXparser.py#L52

  2. it would help instead to expose a stream parser StreamParser,
    which would operate on top of another stream/io provider,
    such as GzipFile de-compresion stream

  3. proposed usage pattern, which allows to scan *.pcap.gz compressed file:

from gzip import GzipFile
from IEXTools import StreamParser
file_path = "2019-11-07.tops.pcap.gz"
with GzipFile(file_path, 'rb') as file_io:
    with StreamParser(file_io) as message_io:
         print(next(message_io))
@martinitus
Copy link

I think that would also allow to decompress while downloading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants