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

Commit 91f9c4b

Browse files
committed
Rebrand CLI
1 parent 4e1cd2e commit 91f9c4b

File tree

4 files changed

+26
-27
lines changed

4 files changed

+26
-27
lines changed

camelot/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def set_config(self, key, value):
8181
)
8282
@click.pass_context
8383
def cli(ctx, *args, **kwargs):
84-
"""Camelot: PDF Table Extraction for Humans"""
84+
"""pypdf_table_extraction: PDF Table Extraction for Humans"""
8585
ctx.obj = Config()
8686
for key, value in kwargs.items():
8787
ctx.obj.set_config(key, value)

docs/user/advanced.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ To process background lines, you can pass ``process_background=True``.
2929

3030
.. code-block:: console
3131
32-
$ camelot lattice -back background_lines.pdf
32+
$ pypdf_table_extraction lattice -back background_lines.pdf
3333
3434
.. csv-table::
3535
:file: ../_static/csv/background_lines.csv
@@ -75,7 +75,7 @@ Let's plot all the text present on the table's PDF page.
7575

7676
.. code-block:: console
7777
78-
$ camelot lattice -plot text foo.pdf
78+
$ pypdf_table_extraction lattice -plot text foo.pdf
7979
8080
.. figure:: ../_static/png/plot_text.png
8181
:height: 674
@@ -102,7 +102,7 @@ Let's plot the table (to see if it was detected correctly or not). This plot typ
102102

103103
.. code-block:: console
104104
105-
$ camelot lattice -plot grid foo.pdf
105+
$ pypdf_table_extraction lattice -plot grid foo.pdf
106106
107107
.. figure:: ../_static/png/plot_table.png
108108
:height: 674
@@ -127,7 +127,7 @@ Now, let's plot all table boundaries present on the table's PDF page.
127127

128128
.. code-block:: console
129129
130-
$ camelot lattice -plot contour foo.pdf
130+
$ pypdf_table_extraction lattice -plot contour foo.pdf
131131
132132
.. figure:: ../_static/png/plot_contour.png
133133
:height: 674
@@ -150,7 +150,7 @@ Cool, let's plot all line segments present on the table's PDF page.
150150

151151
.. code-block:: console
152152
153-
$ camelot lattice -plot line foo.pdf
153+
$ pypdf_table_extraction lattice -plot line foo.pdf
154154
155155
.. figure:: ../_static/png/plot_line.png
156156
:height: 674
@@ -173,7 +173,7 @@ Finally, let's plot all line intersections present on the table's PDF page.
173173

174174
.. code-block:: console
175175
176-
$ camelot lattice -plot joint foo.pdf
176+
$ pypdf_table_extraction lattice -plot joint foo.pdf
177177
178178
.. figure:: ../_static/png/plot_joint.png
179179
:height: 674
@@ -196,7 +196,7 @@ You can also visualize the textedges found on a page by specifying ``kind='texte
196196

197197
.. code-block:: console
198198
199-
$ camelot stream -plot textedge foo.pdf
199+
$ pypdf_table_extraction stream -plot textedge foo.pdf
200200
201201
.. figure:: ../_static/png/plot_textedge.png
202202
:height: 674
@@ -223,7 +223,7 @@ Table areas that you want pypdf_table_extraction to analyze can be passed as a l
223223

224224
.. code-block:: console
225225
226-
$ camelot stream -T 316,499,566,337 table_areas.pdf
226+
$ pypdf_table_extraction stream -T 316,499,566,337 table_areas.pdf
227227
228228
.. csv-table::
229229
:file: ../_static/csv/table_areas.csv
@@ -249,7 +249,7 @@ You can use the ``table_regions`` keyword argument to :meth:`read_pdf() <camelot
249249

250250
.. code-block:: console
251251
252-
$ camelot lattice -R 170,370,560,270 table_regions.pdf
252+
$ pypdf_table_extraction lattice -R 170,370,560,270 table_regions.pdf
253253
254254
.. csv-table::
255255
:file: ../_static/csv/table_regions.csv
@@ -278,7 +278,7 @@ Let's get back to the *x* coordinates we got from plotting the text that exists
278278

279279
.. code-block:: console
280280
281-
$ camelot stream -C 72,95,209,327,442,529,566,606,683 column_separators.pdf
281+
$ pypdf_table_extraction stream -C 72,95,209,327,442,529,566,606,683 column_separators.pdf
282282
283283
.. csv-table::
284284
:class: full-width
@@ -306,7 +306,7 @@ To deal with cases like the output from the previous section, you can pass ``spl
306306

307307
.. code-block:: console
308308
309-
$ camelot -split stream -C 72,95,209,327,442,529,566,606,683 column_separators.pdf
309+
$ pypdf_table_extraction -split stream -C 72,95,209,327,442,529,566,606,683 column_separators.pdf
310310
311311
.. csv-table::
312312
:class: full-width
@@ -341,7 +341,7 @@ You can solve this by passing ``flag_size=True``, which will enclose the supersc
341341

342342
.. code-block:: console
343343
344-
$ camelot -flag stream superscript.pdf
344+
$ pypdf_table_extraction -flag stream superscript.pdf
345345
346346
.. csv-table::
347347

@@ -366,7 +366,7 @@ You can strip unwanted characters like spaces, dots and newlines from a string u
366366

367367
.. code-block:: console
368368
369-
$ camelot -strip ' .\n' stream 12s0324.pdf
369+
$ pypdf_table_extraction -strip ' .\n' stream 12s0324.pdf
370370
371371
.. csv-table::
372372

@@ -397,7 +397,7 @@ Let's see the table area that is detected by default.
397397

398398
.. code-block:: console
399399
400-
$ camelot stream -plot contour edge.pdf
400+
$ pypdf_table_extraction stream -plot contour edge.pdf
401401
402402
.. figure:: ../_static/png/edge_tol_1.png
403403
:height: 674
@@ -418,7 +418,7 @@ To improve the detected area, you can increase the ``edge_tol`` (default: 50) va
418418

419419
.. code-block:: console
420420
421-
$ camelot stream -e 500 -plot contour edge.pdf
421+
$ pypdf_table_extraction stream -e 500 -plot contour edge.pdf
422422
423423
.. figure:: ../_static/png/edge_tol_2.png
424424
:height: 674
@@ -458,7 +458,7 @@ You can pass ``row_tol=<+int>`` to group the rows closer together, as shown belo
458458

459459
.. code-block:: console
460460
461-
$ camelot stream -r 10 group_rows.pdf
461+
$ pypdf_table_extraction stream -r 10 group_rows.pdf
462462
463463
.. csv-table::
464464

@@ -506,7 +506,7 @@ Clearly, the smaller lines separating the headers, couldn't be detected. Let's t
506506

507507
.. code-block:: console
508508
509-
$ camelot lattice -scale 40 -plot grid short_lines.pdf
509+
$ pypdf_table_extraction lattice -scale 40 -plot grid short_lines.pdf
510510
511511
.. figure:: ../_static/png/short_lines_2.png
512512
:alt: An improved plot of the PDF table with short lines
@@ -576,7 +576,7 @@ No surprises there — it did remain in place (observe the strings "2400" and "A
576576

577577
.. code-block:: console
578578
579-
$ camelot lattice -scale 40 -shift r -shift b short_lines.pdf
579+
$ pypdf_table_extraction lattice -scale 40 -shift r -shift b short_lines.pdf
580580
581581
.. csv-table::
582582

@@ -630,7 +630,7 @@ We don't need anything else. Now, let's pass ``copy_text=['v']`` to copy text in
630630

631631
.. code-block:: console
632632
633-
$ camelot lattice -copy v copy_text.pdf
633+
$ pypdf_table_extraction lattice -copy v copy_text.pdf
634634
635635
.. csv-table::
636636
:class: full-width

docs/user/cli.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ Command-Line Interface
55

66
pypdf_table_extraction comes with a command-line interface.
77

8-
You can print the help for the interface by typing ``camelot --help`` in your favorite terminal program, as shown below.
9-
Furthermore, you can print the help for each command by typing ``camelot <command> --help``. Try it out!
8+
You can print the help for the interface by typing ``pypdf_table_extraction --help`` in your favorite terminal program, as shown below.
9+
Furthermore, you can print the help for each command by typing ``pypdf_table_extraction <command> --help``. Try it out!
1010

1111
.. click:: camelot.cli:cli
1212
:prog: camelot
13-
:nested: short

docs/user/quickstart.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ You can also export all tables at once, using the :class:`tables <camelot.core.T
7777

7878
.. code-block:: console
7979
80-
$ camelot --format csv --output foo.csv lattice foo.pdf
80+
$ pypdf_table_extraction --format csv --output foo.csv lattice foo.pdf
8181
8282
This will export all tables as CSV files at the path specified. Alternatively, you can use ``f='json'``, ``f='excel'``, ``f='html'``, ``f='markdown'`` or ``f='sqlite'``.
8383

@@ -99,7 +99,7 @@ By default, pypdf_table_extraction only uses the first page of the PDF to extrac
9999

100100
.. code-block:: console
101101
102-
$ camelot --pages 1,2,3 lattice your.pdf
102+
$ pypdf_table_extraction --pages 1,2,3 lattice your.pdf
103103
104104
The ``pages`` keyword argument accepts pages as comma-separated string of page numbers. You can also specify page ranges — for example, ``pages=1,4-10,20-30`` or ``pages=1,4-10,20-end``.
105105

@@ -119,7 +119,7 @@ pypdf_table_extraction supports extracting tables in parrallel using all the ava
119119

120120
.. code-block:: console
121121
122-
$ camelot --pages all --parallel lattice foo.pdf
122+
$ pypdf_table_extraction --pages all --parallel lattice foo.pdf
123123
124124
.. note:: The reading of the PDF document is parallelized by processing pages by different CPU core.
125125
Therefore, a document with a low page count could be slower to process in parallel.
@@ -140,7 +140,7 @@ To extract tables from encrypted PDF files you must provide a password when call
140140

141141
.. code-block:: console
142142
143-
$ camelot --password userpass lattice foo.pdf
143+
$ pypdf_table_extraction --password userpass lattice foo.pdf
144144
145145
pypdf_table_extraction supports PDFs with all encryption types supported by `pypdf`_. This might require installing PyCryptodome. An exception is thrown if the PDF cannot be read. This may be due to no password being provided, an incorrect password, or an unsupported encryption algorithm.
146146

0 commit comments

Comments
 (0)