Camelot: PDF Table Extraction for Humans

Overview

Camelot: PDF Table Extraction for Humans

Build Status Documentation Status codecov.io image image image Gitter chat image

Camelot is a Python library that makes it easy for anyone to extract tables from PDF files!

Note: You can also check out Excalibur, which is a web interface for Camelot!


Here's how you can extract tables from PDF files. Check out the PDF used in this example here.

>>> import camelot
>>> tables = camelot.read_pdf('foo.pdf')
>>> tables
<TableList n=1>
>>> tables.export('foo.csv', f='csv', compress=True) # json, excel, html, sqlite
>>> tables[0]
<Table shape=(7, 7)>
>>> tables[0].parsing_report
{
    'accuracy': 99.02,
    'whitespace': 12.24,
    'order': 1,
    'page': 1
}
>>> tables[0].to_csv('foo.csv') # to_json, to_excel, to_html, to_sqlite
>>> tables[0].df # get a pandas DataFrame!
Cycle Name KI (1/km) Distance (mi) Percent Fuel Savings
Improved Speed Decreased Accel Eliminate Stops Decreased Idle
2012_2 3.30 1.3 5.9% 9.5% 29.2% 17.4%
2145_1 0.68 11.2 2.4% 0.1% 9.5% 2.7%
4234_1 0.59 58.7 8.5% 1.3% 8.5% 3.3%
2032_2 0.17 57.8 21.7% 0.3% 2.7% 1.2%
4171_1 0.07 173.9 58.1% 1.6% 2.1% 0.5%

There's a command-line interface too!

Note: Camelot only works with text-based PDFs and not scanned documents. (As Tabula explains, "If you can click and drag to select text in your table in a PDF viewer, then your PDF is text-based".)

Why Camelot?

  • You are in control.: Unlike other libraries and tools which either give a nice output or fail miserably (with no in-between), Camelot gives you the power to tweak table extraction. (This is important since everything in the real world, including PDF table extraction, is fuzzy.)
  • Bad tables can be discarded based on metrics like accuracy and whitespace, without ever having to manually look at each table.
  • Each table is a pandas DataFrame, which seamlessly integrates into ETL and data analysis workflows.
  • Export to multiple formats, including JSON, Excel, HTML and Sqlite.

See comparison with other PDF table extraction libraries and tools.

Installation

Using conda

The easiest way to install Camelot is to install it with conda, which is a package manager and environment management system for the Anaconda distribution.

$ conda install -c conda-forge camelot-py

Using pip

After installing the dependencies (tk and ghostscript), you can simply use pip to install Camelot:

$ pip install camelot-py[cv]

From the source code

After installing the dependencies, clone the repo using:

$ git clone https://www.github.com/camelot-dev/camelot

and install Camelot using pip:

$ cd camelot
$ pip install ".[cv]"

Documentation

Great documentation is available at http://camelot-py.readthedocs.io/.

Development

The Contributor's Guide has detailed information about contributing code, documentation, tests and more. We've included some basic information in this README.

Source code

You can check the latest sources with:

$ git clone https://www.github.com/camelot-dev/camelot

Setting up a development environment

You can install the development dependencies easily, using pip:

$ pip install camelot-py[dev]

Testing

After installation, you can run tests using:

$ python setup.py test

Versioning

Camelot uses Semantic Versioning. For the available versions, see the tags on this repository. For the changelog, you can check out HISTORY.md.

License

This project is licensed under the MIT License, see the LICENSE file for details.

Comments
  • 'Please make sure that Ghostscript is installed' error when it is already successfully installed

    'Please make sure that Ghostscript is installed' error when it is already successfully installed

    Facing issue when tried to run following code:

    import camelot tables = camelot.read_pdf('test.pdf')

    Error:

    tables = camelot.read_pdf('Unaudited-Financial-Results.pdf') Traceback (most recent call last): File "C:\Users\hp1\Anaconda2\envs\lib\site-packages\camelot\parsers\la ttice.py", line 193, in get_executable raise ValueError ValueError

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "", line 1, in File "C:\Users\hp1\Anaconda2\envs\lib\site-packages\camelot\io.py", li ne 101, in read_pdf tables = p.parse(flavor=flavor, **kwargs) File "C:\Users\hp1\Anaconda2\envs\lib\site-packages\camelot\handlers.p y", line 157, in parse t = parser.extract_tables(p) File "C:\Users\hp1\Anaconda2\envs\lib\site-packages\camelot\parsers\la ttice.py", line 356, in extract_tables self._generate_image() File "C:\Users\hp1\Anaconda2\envs\lib\site-packages\camelot\parsers\la ttice.py", line 220, in _generate_image gs = get_executable() File "C:\Users\hp1\Anaconda2\envs\lib\site-packages\camelot\parsers\la ttice.py", line 206, in get_executable 'Please make sure that Ghostscript is installed' camelot.parsers.lattice.GhostscriptNotFound: Please make sure that Ghostscript i s installed and available on the PATH environment variable

    When checked in cmd for GhostScript it shows successfully installed and Path is set correctly:

    C:>gswin64c.exe -version GPL Ghostscript 9.25 (2018-09-13) Copyright (C) 2018 Artifex Software, Inc. All rights reserved.

    Also, instead of lattice, if stream method is used, a csv file can be generated successfully:

    tables = camelot.read_pdf('test.pdf', flavor='stream', table_area tables

    >>> tables.export('test.csv', f='csv', compress=True)

    Requesting to fix above mentioned issue.

    opened by narsinha 43
  • ImportError

    ImportError

    `--------------------------------------------------------------------------- ImportError Traceback (most recent call last) in () 1 import pandas as pd ----> 2 import camelot

    /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/camelot/init.py in () 4 5 from .version import version ----> 6 from .io import read_pdf 7 8

    /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/camelot/io.py in () 1 # -- coding: utf-8 -- 2 ----> 3 from .handlers import PDFHandler 4 from .utils import validate_input, remove_extra 5

    /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/camelot/handlers.py in () 5 from PyPDF2 import PdfFileReader, PdfFileWriter 6 ----> 7 from .core import TableList 8 from .parsers import Stream, Lattice 9 from .utils import (TemporaryDirectory, get_page_layout, get_text_objects,

    ImportError: cannot import name 'TableList'`

    opened by enolette 28
  • [MRG + 1] Create a new figure and test each plot type #127

    [MRG + 1] Create a new figure and test each plot type #127

    • move plot() to plotting.py as plot_pdf()
    • add filename param to plot_pdf()
    • modify plotting functions to return matplotlib figures
    • add test_plotting.py and baseline images
    • import plot_pdf() in __init__
    • update cli.py to use plot_pdf()
    • update advanced usage docs to reflect changes
    opened by Suyash458 18
  • Not able to read multiple pages using pages='1,2,3' or pages='all'

    Not able to read multiple pages using pages='1,2,3' or pages='all'

    When I am reading a pdf filw with multiple pages, I am only getting first page by default.

    When I am using this code read_pdf(sample.pdf, pages='1-2') or read_pdf(sample.pdf, pages='all') or read_pdf(sample.pdf, pages='1,2') I am getting following error.

    AttributeError: 'PDFHandler' object has no attribute 'password'

    Can you please fix this issue

    bug 
    opened by ghost 15
  • Please add support for reading tables with Arabic fonts

    Please add support for reading tables with Arabic fonts

    Versions: Linux-4.9.0-6-amd64-x86_64 Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) [GCC 7.2.0] NumPy 1.15.2 OpenCV 3.4.2

    Hi,

    Can you please support reading languages in Arabic fonts?

    In particular, I'm trying to extract tables from this document (backup link since Scribd seems to be down right now).

    Starting at page 6, the document presents lines of Arabic on the left column and lines of English in the right column. I used these commands to extract that text as a table:

    tables = camelot.read_pdf('quran.pdf', pages='6',columns=['240'])
    tables.export('quran.csv', f='csv', compress=False)
    

    However, the extracted table has two issues:

    1. The (I think unicode) characters for the Arabic text seem to have either been corrupted in the process or they've lost any mapping to the Arabic fonts. Even when I tried opening up the file in Google Sheets & other editors and set the font to Arabic the words would still not be properly displayed

    2. Text that should have been on the same row of two different rows is instead placed in two different columns of the same row. (This is a minor annoyance that I can easily work around, and perhaps you tool already has a fix for this that I haven't discovered)

    Below is the full output generated by the above command. Interestingly, in the beginning part of the file (line 3 and a bit of line 4) you can at least recognize the Arabic letters. However, again there are two issues:

    1. The order of the letters has been flipped around. This is probably due to the fact that Arabic reads from right to left. I suspect PDFminer gave Camelot the letters in the "correct" left to right order, but Camelot, not being aware that the letters should be read in the opposite order, flipped the order around
    2. The two lines of visible Arabic are both from the same word, the characters of which somehow got split into two different rows
    "ِ",""
    "",""
    "ِةِِ حـِتاَف",""
    "ْلَا","al-Fātiḥah"
    "َ",""
    "",""
    "","1.  1In the Name of Allah,"
    "",""
    "","the All-beneficent, the All-merciful."
    "",""
    "","2. All praise belongs to Allah,2"
    "",""
    "",""
    "","Lord of all the worlds,"
    "",""
    "","3. the All-beneficent, the All-merciful,"
    "",""
    "","4. Master3 of the Day of Retribution."
    "",""
    "","5. You [alone] do we worship,"
    "",""
    "","and to You [alone] do we turn for help."
    "",""
    "","6. Guide us on the straight path,"
    "",""
    "","7. the path of those whom You have blessed4"
    "",""
    "","—such as5 have not incurred Your wrath,6"
    "1 That is, ‘the opening’ sūrah. Another common name of the sūrah is ‘Sūrat al-Ḥamd, ’that is, the sūrah of",""
    "the [Lord’s] praise.",""
    "2 In Muslim parlance the phrase al-ḥamdu lillāh also signifies ‘thanks to Allah.’",""
    "3 This is in accordance with the reading mālik yawm al-dīn, adopted by ‘Āṣim, al-Kisā’ī, Ya‘qūb al-Ḥaḍramī,",""
    "and Khalaf. Other authorities of qirā’ah (the art of recitation of the Qur’ān) have read ‘malik yawm al-",""
    "","dīn,’meaning ‘Sovereign of the Day of Retribution’(see Mu‘jam al-Qirā’āt al-Qur’āniyyah). Traditions ascribe"
    "both readings to Imam Ja‘far al-Ṣādiq (‘a). See al-Qummī, al-‘Ayyāshī, Tafsīr al-Imām al-‘Askarī.",""
    "4 For further Qur’ānic references to ‘those whom Allah has blessed,’see 4:69 and 19:58; see also 5:23, 110;",""
    "12:6; 27:19; 28:17; 43:59; 48:2.",""
    "5 This is in accordance with the qirā’ah of ‘Āṣim, ghayril-maghḍūbi, which appears in the Arabic text above.",""
    "","However, in accordance with an alternative, and perhaps preferable, reading ghayral-maghḍūbi (attributed"
    
    bug 
    opened by ZainRizvi 15
  • can not parse Chinese pdf document

    can not parse Chinese pdf document

    This is the file I want to parse. W020180518365531252048.pdf PdfReadWarning: Illegal character in Name Object [generic.py:489] Traceback (most recent call last): File "D:\Python\Python36\lib\site-packages\IPython\core\interactiveshell.py", line 2961, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in tables = camelot.read_pdf("W020180518365531252048.pdf") File "D:\Python\Python36\lib\site-packages\camelot\io.py", line 91, in read_pdf tables = p.parse(flavor=flavor, **kwargs) File "D:\Python\Python36\lib\site-packages\camelot\handlers.py", line 141, in parse self._save_page(self.filename, p, tempdir) File "D:\Python\Python36\lib\site-packages\camelot\handlers.py", line 95, in save_page layout, dim = get_page_layout(fpath) File "D:\Python\Python36\lib\site-packages\camelot\utils.py", line 586, in get_page_layout document = PDFDocument(parser) File "D:\Python\Python36\lib\site-packages\pdfminer.six-20170720-py3.6.egg\pdfminer\pdfdocument.py", line 566, in init xref.load(parser) File "D:\Python\Python36\lib\site-packages\pdfminer.six-20170720-py3.6.egg\pdfminer\pdfdocument.py", line 195, in load (, obj) = parser.nextobject() File "D:\Python\Python36\lib\site-packages\pdfminer.six-20170720-py3.6.egg\pdfminer\psparser.py", line 606, in nextobject raise PSSyntaxError('Invalid dictionary construct: %r' % objs) pdfminer.psparser.PSSyntaxError: Invalid dictionary construct: [/'Type', /'Font', /'Subtype', /'Type0', /'BaseFont', /b"b'", /"ABCDEE+\xb7\xc2\xcb\xce'", /'Encoding', /'Identity-H', /'DescendantFonts', PDFObjRef:6, /'ToUnicode', PDFObjRef:12]

    opened by yuyangyoung 14
  • [MRG] Replace gs subprocess call

    [MRG] Replace gs subprocess call

    This is a cleaner way to interact with the ghostscript, need to see if this PyPI package is available in anaconda or not. Also need to suppress the unnecessary logs generated by ghostscript.

    EDIT: If it isn't available, maybe we could vendorize it.

    Closes #152.

    opened by vinayak-mehta 14
  • read-pdf not part of camelot module??

    read-pdf not part of camelot module??

    My code

    tables = camelot.read_pdf("./test/spyglass.pdf")
    

    The error:

    Traceback (most recent call last):
      File "camelot.py", line 1, in <module>
        import camelot
      File "/Users/milad/Desktop/projects/shamrock/camelot.py", line 2, in <module>
        tables = camelot.read_pdf("./test.pdf");
    AttributeError: 'module' object has no attribute 'read_pdf'
    
    opened by Miladinho 14
  • Create a new figure and test each plot type

    Create a new figure and test each plot type

    Camelot supports plotting of 5 types of geometries for debugging and tweaking parser configurations.

    Plotting needs to be refactored in such a way that all plot functions return a matplotlib figure, so that they can be tested either by using pytest or matplotlib's image_comparison decorator. You can also check how pandas tests plots.

    The user should be given an option to save their plots, in addition to the current option of just displaying the figure, which might fail when there are no screens available.

    The new plots should also be tested to work in Jupyter notebooks.

    enhancement moderate help wanted 
    opened by vinayak-mehta 13
  • NotImplementedError: only algorithm code 1 and 2 are supported

    NotImplementedError: only algorithm code 1 and 2 are supported

    Having trouble running this code on my mac. Using Conda virtual env and installed using conda. Pdf is not password protected.

    import camelot import pandas as pd import re import numpy as np table1 = camelot.read_pdf('IEEJ - 2019 - Outlook.pdf')


    NotImplementedError Traceback (most recent call last) in ----> 1 table1 = camelot.read_pdf('IEEJ - 2019 - Outlook.pdf')#, pages = ex_page, password = None)#, area = (left, 112, right,112+ 90)) 2 table1

    /anaconda3/envs/tensorflow/lib/python3.6/site-packages/camelot/io.py in read_pdf(filepath, pages, password, flavor, suppress_stdout, layout_kwargs, **kwargs) 104 kwargs = remove_extra(kwargs, flavor=flavor) 105 tables = p.parse(flavor=flavor, suppress_stdout=suppress_stdout, --> 106 layout_kwargs=layout_kwargs, **kwargs) 107 return tables

    /anaconda3/envs/tensorflow/lib/python3.6/site-packages/camelot/handlers.py in parse(self, flavor, suppress_stdout, layout_kwargs, **kwargs) 153 with TemporaryDirectory() as tempdir: 154 for p in self.pages: --> 155 self._save_page(self.filepath, p, tempdir) 156 pages = [os.path.join(tempdir, 'page-{0}.pdf'.format(p)) 157 for p in self.pages]

    /anaconda3/envs/tensorflow/lib/python3.6/site-packages/camelot/handlers.py in _save_page(self, filepath, page, temp) 98 infile = PdfFileReader(fileobj, strict=False) 99 if infile.isEncrypted: --> 100 infile.decrypt(self.password) 101 fpath = os.path.join(temp, 'page-{0}.pdf'.format(page)) 102 froot, fext = os.path.splitext(fpath)

    /anaconda3/envs/tensorflow/lib/python3.6/site-packages/PyPDF2/pdf.py in decrypt(self, password) 1985 self._override_encryption = True 1986 try: -> 1987 return self._decrypt(password) 1988 finally: 1989 self._override_encryption = False

    /anaconda3/envs/tensorflow/lib/python3.6/site-packages/PyPDF2/pdf.py in _decrypt(self, password) 1994 raise NotImplementedError("only Standard PDF encryption handler is available") 1995 if not (encrypt['/V'] in (1, 2)): -> 1996 raise NotImplementedError("only algorithm code 1 and 2 are supported") 1997 user_password, key = self._authenticateUserPassword(password) 1998 if user_password:

    NotImplementedError: only algorithm code 1 and 2 are supported

    opened by nelsonlin2708968 12
  • Bring back OCR in a future release

    Bring back OCR in a future release

    The experimental version exists before this commit 9753889ea266c3b8e412d77eb411617ec40d8393. It uses Tesseract (using pyocr). ocropy looked promising the last time I checked, opening this issue for discussion and experiments around OCR.

    An earlier issue around the same topic: #14

    enhancement 
    opened by vinayak-mehta 12
  • Can't install on MacOS

    Can't install on MacOS

    Try to install with pip defaulting to Python2 (see Python3 attempt further down)

    % git clone https://www.github.com/camelot-dev/camelot % cd camelot % pip install ".[cv]"
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. Processing /Users/psommerfeld/Dropbox/work/camelot ERROR: Command errored out with exit status 1: command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7s/8v3x7mf531q3bblgckwq8hl00000gn/T/pip-req-build-RkYLrh/setup.py'"'"'; file='"'"'/private/var/folders/7s/8v3x7mf531q3bblgckwq8hl00000gn/T/pip-req-build-RkYLrh/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/7s/8v3x7mf531q3bblgckwq8hl00000gn/T/pip-pip-egg-info-5J2Gos cwd: /private/var/folders/7s/8v3x7mf531q3bblgckwq8hl00000gn/T/pip-req-build-RkYLrh/ Complete output (8 lines): Traceback (most recent call last): File "", line 1, in File "/private/var/folders/7s/8v3x7mf531q3bblgckwq8hl00000gn/T/pip-req-build-RkYLrh/setup.py", line 10, in exec(f.read(), about) File "", line 11 version_parts.append(f"-{prerelease}") ^ SyntaxError: invalid syntax ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

    Try with Python3:

    % python3 -m pip install "[.cv]"
    ERROR: Exception: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py", line 102, in init req = REQUIREMENT.parseString(requirement_string) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyparsing/core.py", line 1141, in parse_string raise exc.with_traceback(None) pip._vendor.pyparsing.exceptions.ParseException: Expected string_end, found '[' (at char 11), (line:1, col:12)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper status = run_func(*args) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper return func(self, options, args) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 344, in run reqs = self.get_requirements(args, options, finder, session) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 411, in get_requirements req_to_add = install_req_from_line( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/req/constructors.py", line 393, in install_req_from_line parts = parse_req_from_line(name, line_source) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/req/constructors.py", line 332, in parse_req_from_line extras = convert_extras(extras_as_string) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/req/constructors.py", line 57, in convert_extras return get_requirement("placeholder" + extras.lower()).extras File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/utils/packaging.py", line 45, in get_requirement return Requirement(req_string) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py", line 104, in init raise InvalidRequirement( pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'[.cv]'": Expected string_end

    opened by psommerfeld 0
  • Update image_processing.py

    Update image_processing.py

    I made the following changes in this PR:

    • Removed unnecessary multiplication of vertical and horizontal arrays, as it seems to be excessive, so I tried to improve that bit (I might be wrong though, but it seems like that)
    • Changed the try-except block to just a single line that calls cv2.findContours() and gets the second element of the returned tuple, which is the list of contours
    • Simplified the calculation for the coordinates of the joint by using int division to calculate the center of the bounding rectangle for each contour (about htis one, first we are tracing the contours of the object in the image, then drawing a rectangle around each contour, then finding the point in the middle and in the end using this point as an est for the coordinates of the joint we were looking for)

    Ping me if there are any questions, thanks.

    opened by whoiskatrin 0
  • pdf file with multi pages can't parse fully,the second page's tables can not display

    pdf file with multi pages can't parse fully,the second page's tables can not display

    a pdf file has tow pages ,the first page has 3 tables,the second has 2 tables. but when use camelot.read_pdf ,with parameter: pages='all', the result return only 3 tables,not 5 tables.

    import camelot tables = camelot.read_pdf('a22.pdf',pages='all') tables

    why return only 3 tables? thanks the source pdf is here: a22.pdf

    opened by cheneygan 1
  • Problems with pages with no tables - total number of pages variable, no good page indexing

    Problems with pages with no tables - total number of pages variable, no good page indexing

    Hello,

    There is a daily pdf report whose last page has no tables, but whose total number of pages vary each day.

    I cannot extract 'all' when there is a page with no table: _

    File ~\anaconda3\lib\site-packages\camelot\io.py:113 in read_pdf tables = p.parse(

    File ~\anaconda3\lib\site-packages\camelot\handlers.py:176 in parse t = parser.extract_tables(

    File ~\anaconda3\lib\site-packages\camelot\parsers\stream.py:456 in extract_tables self._generate_table_bbox()

    File ~\anaconda3\lib\site-packages\camelot\parsers\stream.py:310 in _generate_table_bbox table_bbox = self._nurminen_table_detection(hor_text)

    File ~\anaconda3\lib\site-packages\camelot\parsers\stream.py:287 in _nurminen_table_detection table_bbox = textedges.get_table_areas(textlines, relevant_textedges)

    File ~\anaconda3\lib\site-packages\camelot\core.py:221 in get_table_areas average_textline_height = sum_textline_height / float(len(textlines))

    ZeroDivisionError: float division by zero

    _

    And cannot index the reading pages from first to second to last, as I cannot know beforehand the total number of pages.

    Can you help me out?

    opened by Bernardo-Hazan 2
  • Do you have stream + only vertical lines seperation?

    Do you have stream + only vertical lines seperation?

    Hello,

    I am working with a pdf which I can not share due to confidentiality, however my question and issue is very simple. The pdf format is what we call "stream" BUT with vertical tabular lines between each column. So in the end I dont have row-lines but have column-lines.

    When I use camelot like this: camelot.read_pdf('mypdf.pdf', flavor="stream", pages="all", split_text=True)

    since my 2 columns are very close to each other (but seperated with the line I mentioned) camelot merges these two columns even I use split_text = True. Is there a harmonic method available for me to use "stream" but with appying vertial -OR- horizontal line avareness to the conversion.

    I know that I can use manual-inputted column cut point coordinate with "split" parameter but all my pdf files arrives with different split coordination so I can not hardcode some points. All I have in common is these vertical column seperator lines.

    Do you have a built-in solution for solving these kind of problems? If not, do you have a plan to add it in upcoming releases?

    Best.

    opened by Erenaliaslangiray 0
Releases(v0.7.2)
Owner
Atlan Technologies Pvt Ltd
Democratizing data for teams around the world :sparkles: Humans of data, welcome home :heart:
Atlan Technologies Pvt Ltd
Repository collecting all the submodules for the new PyTorch-based OCR System.

OCRopus3 is being replaced by OCRopus4, which is a rewrite using PyTorch 1.7; release should be soonish. Please check github.com/tmbdev/ocropus for up

NVIDIA Research Projects 138 Dec 09, 2022
Character Segmentation using TensorFlow

Character Segmentation Segment characters and spaces in one text line,from this paper Chinese English mixed Character Segmentation as Semantic Segment

26 Aug 25, 2022
This repository contains the code for the paper "SCANimate: Weakly Supervised Learning of Skinned Clothed Avatar Networks"

SCANimate: Weakly Supervised Learning of Skinned Clothed Avatar Networks (CVPR 2021 Oral) This repository contains the official PyTorch implementation

Shunsuke Saito 235 Dec 18, 2022
This repository provides train&test code, dataset, det.&rec. annotation, evaluation script, annotation tool, and ranking.

SCUT-CTW1500 Datasets We have updated annotations for both train and test set. Train: 1000 images [images][annos] Additional point annotation for each

Yuliang Liu 600 Dec 18, 2022
Satoshi is a discord bot template in python using discord.py that allow you to track some live crypto prices with your own discord bot.

Satoshi ~ DiscordCryptoBot Satoshi is a simple python discord bot using discord.py that allow you to track your favorites cryptos prices with your own

Théo 2 Sep 15, 2022
A simple Digits Recogniser made in Python

⭐ Python Digit Recogniser A simple digit Recogniser made in Python Demo Run Locally Clone the project git clone https://github.com/yashraj-n/python-

Yashraj narke 4 Nov 29, 2021
Let's explore how we can extract text from forms

Form Segmentation Let's explore how we can extract text from any forms / scanned pages. Objectives The goal is to find an algorithm that can extract t

Philip Doxakis 42 Jun 05, 2022
Here use convulation with sobel filter from scratch in opencv python .

Here use convulation with sobel filter from scratch in opencv python .

Tamzid hasan 2 Nov 11, 2021
Table recognition inside douments using neural networks

TableTrainNet A simple project for training and testing table recognition in documents. This project was developed to make a neural network which reco

Giovanni Cavallin 93 Jul 24, 2022
Tesseract Open Source OCR Engine (main repository)

Tesseract OCR About This package contains an OCR engine - libtesseract and a command line program - tesseract. Tesseract 4 adds a new neural net (LSTM

48.4k Jan 09, 2023
This is a real life mario project using python and mediapipe

real-life-mario This is a real life mario project using python and mediapipe How to run to run this just run - realMario.py file requirements This req

Programminghut 42 Dec 22, 2022
A Tensorflow model for text recognition (CNN + seq2seq with visual attention) available as a Python package and compatible with Google Cloud ML Engine.

Attention-based OCR Visual attention-based OCR model for image recognition with additional tools for creating TFRecords datasets and exporting the tra

Ed Medvedev 933 Dec 29, 2022
OCR-D-compliant page segmentation

ocrd_segment This repository aims to provide a number of OCR-D-compliant processors for layout analysis and evaluation. Installation In your virtual e

OCR-D 59 Sep 10, 2022
Geometric Augmentation for Text Image

Text Image Augmentation A general geometric augmentation tool for text images in the CVPR 2020 paper "Learn to Augment: Joint Data Augmentation and Ne

Canjie Luo 440 Jan 05, 2023
learn how to use Gesture Control to change the volume of a computer

Volume-Control-using-gesture In this project we are going to learn how to use Gesture Control to change the volume of a computer. We first look into h

Diwas Pandey 49 Sep 22, 2022
Detecting Text in Natural Image with Connectionist Text Proposal Network (ECCV'16)

Detecting Text in Natural Image with Connectionist Text Proposal Network The codes are used for implementing CTPN for scene text detection, described

Tian Zhi 1.3k Dec 22, 2022
Detect and fix skew in images containing text

Alyn Skew detection and correction in images containing text Image with skew Image after deskew Install and use via pip! Recommended way(using virtual

Kakul 230 Dec 21, 2022
Course material for the Multi-agents and computer graphics course

TC2008B Course material for the Multi-agents and computer graphics course. Setup instructions Strongly recommend using a custom conda environment. Ins

16 Dec 13, 2022
Détection de créneaux de vaccination disponibles pour l'outil ViteMaDose

Vite Ma Dose ! est un outil open source de CovidTracker permettant de détecter les rendez-vous disponibles dans votre département afin de vous faire v

CovidTracker 239 Dec 13, 2022
OpenCV-Erlang/Elixir bindings

evision [WIP] : OS : arch Build Status Ubuntu 20.04 arm64 Ubuntu 20.04 armv7 Ubuntu 20.04 s390x Ubuntu 20.04 ppc64le Ubuntu 20.04 x86_64 macOS 11 Big

Cocoa 194 Jan 05, 2023