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

Reflect camelot in pypdf_table_extraction namespace #11

Merged
merged 5 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ignore = E203,E501,RST201,RST203,RST301,W503
max-line-length = 120
max-complexity = 10
docstring-convention = numpy
per-file-ignores = tests/*:S101,S106,F403,F405,F841
per-file-ignores = tests/*:S101,S106,F403,F405,F841 pypdf_table_extraction/*:D100,D103,D104,F401,W0611,C0114
rst-roles = class,const,func,meth,mod,ref
rst-directives = deprecated
7 changes: 7 additions & 0 deletions pypdf_table_extraction/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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
from camelot.io import read_pdf
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()
1 change: 1 addition & 0 deletions pypdf_table_extraction/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from camelot.__version__ import __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_backend import GhostscriptBackend # 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 @@ -11,6 +11,7 @@ documentation = "https://pypdf-table-extraction.readthedocs.io/"

packages = [
{ include = "camelot", from = "." },
{ include = "pypdf_table_extraction", from = "." },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down Expand Up @@ -70,6 +71,7 @@ myst-parser = {version = ">=2.0.0"}

[tool.poetry.scripts]
camelot = "camelot.__main__:main"
pypdf_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
Loading