Refactor imports to support package-based usage and improve project structure#204
Open
AdamAdham wants to merge 6 commits intomicrosoft:mainfrom
Open
Refactor imports to support package-based usage and improve project structure#204AdamAdham wants to merge 6 commits intomicrosoft:mainfrom
AdamAdham wants to merge 6 commits intomicrosoft:mainfrom
Conversation
Author
|
@microsoft-github-policy-service agree |
AdamAdham
added a commit
to AdamAdham/pdf-tables-extraction
that referenced
this pull request
Jan 25, 2026
This is microsoft's Table-Transformer repo with modification in import structure. For a better understanding of the changes done to the repo check this PR microsoft/table-transformer#204
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR refactors the import structure across the codebase to enable clean package-based usage of
table-transformer. The changes remove reliance on runtime path manipulation and ensure modules can be imported consistently when the project is installed as a package.Changes
src/,detr/,detr/datasets/, anddetr/models/to use explicit relative imports__init__.pyfiles to ensure proper package recognitionREADME.md,inference.md) and added a new guide describing how to install and use the project as a local Python packageMotivation
The previous import structure assumed execution from specific working directories and relied on runtime path modification. This pattern makes it difficult to integrate the project into larger systems, such as data pipelines or services where the code is consumed as a Python package.
These changes improve:
Scope and Impact
python -m table_transformer.src.inference) rather than direct executionTesting
See updated README.md and INFERENCE.md for correct command usage.