-
Notifications
You must be signed in to change notification settings - Fork 0
feat(parser): добавил парсер xlsx формата вместе с тестами #32
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ead7b78
Fix(cargo): pined quick-xml version
aragami3070 1a662bd
Feat(cargo): add calamine crate
aragami3070 c578c0f
Chore(assets-for-tests): update Book.xlsx
aragami3070 47ab946
Chore(parsers): add type Bytes for MS office format parsers
aragami3070 fc62663
Feat(errors): add convert from calamine error to ParserError
aragami3070 4c81321
Chore(parsers): init xlsx
aragami3070 ed34930
Feat(parsers): add MSOfficeParser trait
aragami3070 fa012d8
Feat(pptx): impl MSOfficeParser trait
aragami3070 4ffec68
Feat(docx): impl MSOfficeParser trait
aragami3070 49c60bd
Feat(xlsx): init XlsxParser struct
aragami3070 5ddabcb
Feat(xlsx): add method `new`
aragami3070 3e75daa
Feat(xlsx): impl MSOfficeParser with get_text method
aragami3070 adfc791
Fix(parsers): MSOFFIcePaser name typo
aragami3070 8b8c9e6
Chore(parser): rename all get_text fn names to extract_text
aragami3070 3ae72be
Feat(errors): add std::fmt error in ParserError
aragami3070 40a5253
Feat(xlsx): separate and rework extract text from sheets
aragami3070 fcd57f3
Feat(xlsx): extract images and text from them
aragami3070 31d0e99
Chore(app): add usage xlsx example
aragami3070 ead2019
Feat(xlsx): add extract text from xlsx test
aragami3070 aea6c65
Feat(docs_parser.pyi): update info for python lsp
aragami3070 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,17 @@ | ||
| import docs_parser | ||
|
|
||
| # NOTE: все эти точно работают и работают хорошо | ||
| # (doc_p, _) = docs_parser.get_text("parser/assets/text_and_tables.docx") | ||
| # (doc_p, _) = docs_parser.get_text("parser/assets/text_and_tables.docx") | ||
| # (doc_p, _) = docs_parser.get_text("parser/assets/some_text.docx") | ||
| # (doc_p, _) = docs_parser.get_text("parser/assets/text_tables_png.docx") | ||
| # (doc_p, _) = docs_parser.get_text("parser/assets/text_from_img.png") | ||
| # (doc_p, _) = docs_parser.get_text("parser/assets/main.typ") | ||
| # (doc_p, _) = docs_parser.get_text("parser/assets/main.pdf") | ||
| # (doc_p, _) = docs_parser.get_text("parser/assets/too_many_png.docx") | ||
| # (doc_p, _) = docs_parser.get_text("parser/assets/Presentation.pptx") | ||
| # print(doc_p) | ||
| # (doc_p, _) = docs_parser.extract_text("parser/assets/text_and_tables.docx") | ||
| # (doc_p, _) = docs_parser.extract_text("parser/assets/text_and_tables.docx") | ||
| # (doc_p, _) = docs_parser.extract_text("parser/assets/some_text.docx") | ||
| # (doc_p, _) = docs_parser.extract_text("parser/assets/text_tables_png.docx") | ||
| # (doc_p, _) = docs_parser.extract_text("parser/assets/text_from_img.png") | ||
| # (doc_p, _) = docs_parser.extract_text("parser/assets/main.typ") | ||
| # (doc_p, _) = docs_parser.extract_text("parser/assets/main.pdf") | ||
| # (doc_p, _) = docs_parser.extract_text("parser/assets/too_many_png.docx") | ||
| # (doc_p, _) = docs_parser.extract_text("parser/assets/Presentation.pptx") | ||
| (doc_p, _) = docs_parser.extract_text("parser/assets/Book.xlsx") | ||
| print(doc_p) | ||
| # docs_parser.convert_to_new_format("parser/assets/old_docs.doc", "parser/assets/tests_results") | ||
| # docs_parser.convert_to_new_format("parser/assets/old_pres.ppt", "parser/assets/tests_results") | ||
| # docs_parser.convert_to_new_format("parser/assets/old_exel.xls", "parser/assets/tests_results") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /*** Sheet: Лист1 ***/ | ||
| Имя, Номер | ||
| Вася, 1 | ||
| Петя, 3 | ||
| Ваня, 2 | ||
| Тема, 4 | ||
| Егор, 6 | ||
| Саша, 5 | ||
|
|
||
| /*** Sheet: Sheet2 ***/ | ||
| Страница 2 | ||
| some text | ||
|
|
||
| /************* Image = 0 *************/ | ||
| МЯУ=191919 | ||
| /*************************************/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| def get_text(from_path: str) -> tuple[str, dict[tuple[int, int], bytes]]: ... | ||
| def extract_text(from_path: str) -> tuple[str, dict[tuple[int, int], bytes]]: ... | ||
| def convert_to_new_format(old_file_path: str, new_path: str): ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Откатил версию, ибо эти гении перезаписали релиз поменяв апи и у меня один метод упал из-за этого