Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit 3817239

Browse files
committed
Update Docstrings
1 parent 7db4789 commit 3817239

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

camelot/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Initialize pypdf_table_extraction, formerly known as Camelot."""
2+
13
__all__ = ("main",)
24

35

camelot/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323

2424
class Config:
25+
"""Class method for creating a new class."""
26+
2527
def __init__(self):
2628
"""Initialize the configuration."""
2729
self.config = {}

camelot/image_processing.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Functions useful for detecting graphical elements from the image to using OpenCV to reconstruct / detect tables."""
2+
13
import cv2
24
import numpy as np
35

@@ -15,12 +17,14 @@ def adaptive_threshold(imagename, process_background=False, blocksize=15, c=-2):
1517
Size of a pixel neighborhood that is used to calculate a
1618
threshold value for the pixel: 3, 5, 7, and so on.
1719
18-
For more information, refer `OpenCV's adaptiveThreshold <https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#adaptivethreshold>`_.
20+
For more information, refer `OpenCV's adaptiveThreshold
21+
<https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#adaptivethreshold>`_.
1922
c : int, optional (default: -2)
2023
Constant subtracted from the mean or weighted mean.
2124
Normally, it is positive but may be zero or negative as well.
2225
23-
For more information, refer `OpenCV's adaptiveThreshold <https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#adaptivethreshold>`_.
26+
For more information, refer `OpenCV's adaptiveThreshold
27+
<https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#adaptivethreshold>`_.
2428
2529
Returns
2630
-------
@@ -52,8 +56,7 @@ def adaptive_threshold(imagename, process_background=False, blocksize=15, c=-2):
5256
def find_lines(
5357
threshold, regions=None, direction="horizontal", line_scale=15, iterations=0
5458
):
55-
"""Finds horizontal and vertical lines by applying morphological
56-
transformations on an image.
59+
"""Finds horizontal and vertical lines by applying morphological transformations on an image.
5760
5861
Parameters
5962
----------
@@ -132,7 +135,7 @@ def find_lines(
132135

133136

134137
def find_contours(vertical, horizontal):
135-
"""Finds table boundaries using OpenCV's findContours.
138+
"""Find table boundaries using OpenCV's findContours.
136139
137140
Parameters
138141
----------
@@ -172,7 +175,7 @@ def find_contours(vertical, horizontal):
172175

173176

174177
def find_joints(contours, vertical, horizontal):
175-
"""Finds joints/intersections present inside each table boundary.
178+
"""Find joints/intersections present inside each table boundary.
176179
177180
Parameters
178181
----------

camelot/parsers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""pypdf_table_extraction offers multiple methods to parse pdfs and reconstruct the tables."""
2+
13
from .hybrid import Hybrid
24
from .lattice import Lattice
35
from .network import Network

0 commit comments

Comments
 (0)