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

Add support for parsing metadata from IO objects #16

Merged
merged 1 commit into from
Apr 2, 2024
Merged

Conversation

ikapelyukhin
Copy link
Owner

Changed the interface for all parser classes in order to support supplying IO objects (e.g., File or StringIO) as data sources.

All parser classes now don't take any constructor arguments, instead the parse and parse_file methods expect IO objects and filenames as arguments respectively.

Closes #15.

Changed the interface for all parser classes in order to support
supplying IO objects (e.g., `File` or `StringIO`) as data sources.

All parser classes now don't take any constructor arguments,
instead the `parse` and `parse_file` methods expect IO objects
and filenames as arguments respectively.
@ikapelyukhin
Copy link
Owner Author

@josegomezr give it a look, give it a test.

@felixsch
Copy link
Contributor

felixsch commented Apr 2, 2024

Is this stale? Do you need a review @ikapelyukhin?

@ikapelyukhin
Copy link
Owner Author

Is this stale? Do you need a review @ikapelyukhin?

Hi, @felixsch. Yep, could use a review. What's the final word on this and StringIO, do you want to move ahead with this? I haven't heard back from @josegomezr, so I haven't merged yet.

@josegomezr
Copy link

@ikapelyukhin ah! I replied onm the Issue hehe, but looks great to me so far.

I left on the issue comment benchmarks and a sample impl of the parser working event-based: #15 (comment)

Benchmark-wise looks good, the event-based part could be handy in the future

@ikapelyukhin
Copy link
Owner Author

@ikapelyukhin ah! I replied onm the Issue hehe, but looks great to me so far.

I left on the issue comment benchmarks and a sample impl of the parser working event-based: #15 (comment)

Benchmark-wise looks good, the event-based part could be handy in the future

OK, let's merge this bad boy then.

Full blown event-based architecture is probably not required (would you really ever have more than one subscriber?), it's probably enough to just pass a code block to the parse method. I'll contemplate on that and maybe write something a bit later.

@ikapelyukhin ikapelyukhin merged commit 99548ae into master Apr 2, 2024
7 checks passed
@ikapelyukhin ikapelyukhin deleted the io-support branch April 2, 2024 10:35
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

Successfully merging this pull request may close these issues.

Question: Support for StringIO
3 participants