Skip to content

Conversation

VarshaUN
Copy link

In Scancode toolkit #4001 [https://github.com/aboutcode-org/scancode-toolkit/issues/4001] required allowing extraction of libre office docs.

Signed-off-by : Varsha U N varshaun58@gmail.com

@stefan6419846
Copy link

print should not be used in production code. And having to call it explicitly does not seem right.

The goal is to use the following code and allow for corresponding extraction, where target_directory should hold the single files afterwards:

from extractcode import all_kinds
from extractcode.api import extract_archive
from extractcode.archive import should_extract


# Example file: https://github.com/mar10/wunderbaum/blob/main/test/gui_test.ods
archive_path = '/path/to/gui_test.ods'
if should_extract(location=archive_path, kinds=all_kinds):
    for _event in extract_archive(location=archive_path, target=target_directory):
        pass

Signed-off-by: Varsha U N <varshamaddur2006@gmail.com>
Signed-off-by: Varsha U N <varshamaddur2006@gmail.com>
@VarshaUN VarshaUN force-pushed the Support-libre-office-docs branch from b92a7bc to fd532ff Compare January 19, 2025 03:10
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.

2 participants