Skip to content

Commit

Permalink
Reflect camelot packing in pypdf_table_extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
foarsitter committed Mar 1, 2024
1 parent 567520b commit ca1dd07
Show file tree
Hide file tree
Showing 21 changed files with 101 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pypdf_table_extraction/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from camelot import __version__ # noqa: F401
from camelot import format_string # noqa F401
from camelot import formatter # noqa F401
from camelot import handler # noqa F401
from camelot import logger # noqa F401
from camelot import plot # noqa F401
11 changes: 11 additions & 0 deletions pypdf_table_extraction/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
__all__ = ("main",)


def main():
from camelot.cli import cli

cli()


if __name__ == "__main__":
main()
11 changes: 11 additions & 0 deletions pypdf_table_extraction/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from camelot.__version__ import PRERELEASE # noqa: F401
from camelot.__version__ import REVISION # noqa F401
from camelot.__version__ import VERSION # noqa F401
from camelot.__version__ import __author__ # noqa F401
from camelot.__version__ import __author_email__ # noqa F401
from camelot.__version__ import __description__ # noqa F401
from camelot.__version__ import __license__ # noqa F401
from camelot.__version__ import __title__ # noqa F401
from camelot.__version__ import __url__ # noqa F401
from camelot.__version__ import __version__ # noqa F401
from camelot.__version__ import generate_version # noqa F401
1 change: 1 addition & 0 deletions pypdf_table_extraction/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .image_conversion import ImageConversionBackend # noqa: F401
1 change: 1 addition & 0 deletions pypdf_table_extraction/backends/ghostscript_backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from camelot.backends.ghostscript import Ghostscript # noqa: F401
2 changes: 2 additions & 0 deletions pypdf_table_extraction/backends/image_conversion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from camelot.backends.image_conversion import BACKENDS # noqa: F401
from camelot.backends.image_conversion import ImageConversionBackend # noqa: F401
1 change: 1 addition & 0 deletions pypdf_table_extraction/backends/poppler_backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from camelot.backends.poppler_backend import PopplerBackend # noqa: F401
6 changes: 6 additions & 0 deletions pypdf_table_extraction/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from camelot.cli import Config # noqa: F401
from camelot.cli import cli # noqa F401
from camelot.cli import lattice # noqa F401
from camelot.cli import logger # noqa F401
from camelot.cli import pass_config # noqa F401
from camelot.cli import stream # noqa F401
7 changes: 7 additions & 0 deletions pypdf_table_extraction/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from camelot.core import TABLE_AREA_PADDING # noqa: F401
from camelot.core import TEXTEDGE_REQUIRED_ELEMENTS # noqa F401
from camelot.core import Cell # noqa F401
from camelot.core import Table # noqa F401
from camelot.core import TableList # noqa F401
from camelot.core import TextEdge # noqa F401
from camelot.core import TextEdges # noqa F401
1 change: 1 addition & 0 deletions pypdf_table_extraction/handlers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from camelot.handlers import PDFHandler # noqa: F401
4 changes: 4 additions & 0 deletions pypdf_table_extraction/image_processing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from camelot.image_processing import adaptive_threshold # noqa: F401
from camelot.image_processing import find_contours # noqa F401
from camelot.image_processing import find_joints # noqa F401
from camelot.image_processing import find_lines # noqa F401
1 change: 1 addition & 0 deletions pypdf_table_extraction/io.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from camelot.io import read_pdf # noqa: F401
2 changes: 2 additions & 0 deletions pypdf_table_extraction/parsers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from camelot.parsers import Lattice # noqa
from camelot.parsers import Stream # noqa
1 change: 1 addition & 0 deletions pypdf_table_extraction/parsers/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from camelot.parsers.base import BaseParser # noqa: F401
2 changes: 2 additions & 0 deletions pypdf_table_extraction/parsers/lattice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from camelot.parsers.lattice import Lattice # noqa: F401
from camelot.parsers.lattice import logger # noqa: F401
2 changes: 2 additions & 0 deletions pypdf_table_extraction/parsers/stream.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from camelot.parsers.stream import Stream # noqa: F401
from camelot.parsers.stream import logger # noqa: F401
1 change: 1 addition & 0 deletions pypdf_table_extraction/plotting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from camelot.plotting import PlotMethods # noqa: F401
Empty file added pypdf_table_extraction/py.typed
Empty file.
29 changes: 29 additions & 0 deletions pypdf_table_extraction/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from camelot.utils import _VALID_URLS # noqa F401
from camelot.utils import TemporaryDirectory # noqa F401
from camelot.utils import bbox_area # noqa F401
from camelot.utils import bbox_intersect # noqa F401
from camelot.utils import bbox_intersection_area # noqa F401
from camelot.utils import bbox_longer # noqa F401
from camelot.utils import compute_accuracy # noqa F401
from camelot.utils import compute_whitespace # noqa F401
from camelot.utils import download_url # noqa F401 # noqa F401
from camelot.utils import flag_font_size # noqa F401
from camelot.utils import get_page_layout # noqa F401
from camelot.utils import get_rotation # noqa F401
from camelot.utils import get_table_index # noqa F401
from camelot.utils import get_text_objects # noqa F401
from camelot.utils import is_url # noqa F401
from camelot.utils import lattice_kwargs # noqa F401
from camelot.utils import merge_close_lines # noqa F401
from camelot.utils import random_string # noqa F401
from camelot.utils import remove_extra # noqa F401
from camelot.utils import scale # noqa F401
from camelot.utils import scale_image # noqa F401
from camelot.utils import scale_pdf # noqa F401
from camelot.utils import segments_in_bbox # noqa F401
from camelot.utils import split_textline # noqa F401
from camelot.utils import stream_kwargs # noqa F401
from camelot.utils import text_in_bbox # noqa F401
from camelot.utils import text_strip # noqa F401
from camelot.utils import translate # noqa F401
from camelot.utils import validate_input # noqa F401
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repository = "https://github.com/camelot-dev/camelot"
documentation = "https://camelot-py.readthedocs.io"
packages = [
{ include = "camelot", from = "." },
{ include = "pypdf_table_extraction", from = "." },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down Expand Up @@ -55,6 +56,7 @@ myst-parser = {version = ">=0.16.1"}

[tool.poetry.scripts]
camelot = "camelot.__main__:main"
table_extraction = "pypdf_table_extraction.__main__:main"

[tool.poetry.group.base.dependencies]
ghostscript = "^0.7"
Expand Down
10 changes: 10 additions & 0 deletions tests/test_rename.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def test_imports():

from camelot.backends.poppler_backend import PopplerBackend # noqa: F401
from camelot.handlers import Lattice # noqa: F401
from camelot.handlers import Stream # noqa: F401
from pypdf_table_extraction.backends.poppler_backend import ( # noqa: F401,F811
PopplerBackend,
)
from pypdf_table_extraction.parsers import Lattice # noqa: F401, F811
from pypdf_table_extraction.parsers import Stream # noqa: F401, F811

0 comments on commit ca1dd07

Please sign in to comment.