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

Feature request to support iterative parsing by reading from file objects #85

Open
Ragsboss opened this issue Jun 16, 2020 · 0 comments

Comments

@Ragsboss
Copy link

The use case here is to parse an output from a command that produces 1000s of lines of output. Instead of storing all that output into a string and passing it to the parser, we'd like to send a file object and let the parser call a provided callback after completing each record. This way, the whole output need not be in memory at once. For large outputs this makes a considerable difference in memory footprint. You can see similar support in tools like lxml - https://lxml.de/api/lxml.etree.iterparse-class.html.

Typically these commands are executed remotely using some mechanism such as paramiko which offers a way to read the output from a file object (wrapping a file descriptor). So this file object can directly be passed to textfsm to perform this iterative parsing in a streaming fashion.

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

No branches or pull requests

2 participants