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 BytesIO Objects in EPUB Reading #292

Closed

Conversation

ReinforcedKnowledge
Copy link

@ReinforcedKnowledge ReinforcedKnowledge commented Nov 20, 2023

Summary:

This pull request introduces support for BytesIO objects when reading EPUB files. The primary goal is to enhance the flexibility of the EPUB reading functionality, allowing users to read EPUB content from in-memory byte streams.

Changes:

  • Added compatibility for reading EPUB files from BytesIO objects (EpubReader class's _load).
  • Refactored the EpubReader class's _load function for improved readability and maintainability.

Motivation:

The inclusion of support for BytesIO objects addresses a common use case where users may have EPUB content stored in-memory rather than as a file on disk. This is the case when query remote storage for example. This enhancement improves the overall usability and integration capabilities of the EPUB reading module. The refactoring of the _load function makes it easier for developers to locate and understand the EPUB reading logic.

How to Test:

Since tests are not the primary focus at the moment, testing instructions are simplified:

  • Manually instantiate a BytesIO object containing EPUB content.
  • Manually pass the BytesIO object to the EPUB reading function
  • Manually pass the EPUB file path to the EPUB reading function.
  • Manually check that both objects are the same, and that the content was parsed correctly.

Closes:

N/A

Additional Notes:

  • While tests are not included in this PR, future contributions to add tests are welcome.
  • The refactoring of the _load function enhances code maintainability and makes it easier for developers to troubleshoot EPUB reading issues.

Please review and merge at your earliest convenience.

@c1924959470
Copy link

c1924959470 commented Nov 20, 2023 via email

@ReinforcedKnowledge
Copy link
Author

Thank you!

@aerkalov aerkalov closed this Jul 20, 2024
@aerkalov
Copy link
Owner

Just closing it. Thanks for it.

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.

4 participants