Skip to main content

Simple wrapper for tabula-java, read tables from PDF into DataFrame

Project description

tabula-py

Build Status PyPI version Documentation Status Patreon

tabula-py is a simple Python wrapper of tabula-java, which can read table of PDF. You can read tables from PDF and convert into pandas's DataFrame. tabula-py also enables you to convert a PDF file into CSV/TSV/JSON file.

You can see the example notebook and try it on Google Colab, or we highly recommend to read our document especially for FAQ.

Requirements

  • Java 8+
  • Python 3.5+

OS

I confirmed working on macOS and Ubuntu. But some people confirm it works on Windows 10. See also the document for the detailed installation for Windows 10.

Usage

Install

Ensure you have Java runtime and set PATH for it.

pip install tabula-py

Example

tabula-py enables you to extract table from PDF into DataFrame and JSON. It also can extract tables from PDF and save file as CSV, TSV or JSON.

import tabula

# Read pdf into list of DataFrame
df = tabula.read_pdf("test.pdf", pages='all')

# Read remote pdf into list of DataFrame
df2 = tabula.read_pdf("https://github.com/tabulapdf/tabula-java/raw/master/src/test/resources/technology/tabula/arabic.pdf")

# convert PDF into CSV file
tabula.convert_into("test.pdf", "output.csv", output_format="csv", pages='all')

# convert all PDFs in a directory
tabula.convert_into_by_batch("input_directory", output_format='csv', pages='all)

See example notebook for more detail. I also recommend to read the tutorial article written by @aegis4048.

Contributing

Interested in helping out? I'd love to have your help!

You can help by:

  • Reporting a bug.
  • Adding or editing documentation.
  • Contributing code via a Pull Request. See also for the contribution
  • Write a blog post or spreading the word about tabula-py to people who might be able to benefit from using it.

Contributors

Another support

You can also support our continued work on tabula-py with a donation on Patreon.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tabula-py-2.0.2.tar.gz (10.7 MB view details)

Uploaded Source

Built Distribution

tabula_py-2.0.2-py3-none-any.whl (10.4 MB view details)

Uploaded Python 3

File details

Details for the file tabula-py-2.0.2.tar.gz.

File metadata

  • Download URL: tabula-py-2.0.2.tar.gz
  • Upload date:
  • Size: 10.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for tabula-py-2.0.2.tar.gz
Algorithm Hash digest
SHA256 3eee2417422ef18cfb1edfb6a2607308776e658d5dcab21f166b3ba87034a19a
MD5 b7eb78fad3fcf632a678b6278ff999f0
BLAKE2b-256 402fbab2065c0cf461d8b4941d695f0353c967d280c67f22bc9af5107f0a0684

See more details on using hashes here.

File details

Details for the file tabula_py-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: tabula_py-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for tabula_py-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6ef8bdd2d0c19a2b32e99663937d7298a55979ce2ef6e575d3b94c9dacb57c2
MD5 9ddc4397689a5ec0e1c02057aa5ae8a8
BLAKE2b-256 449f386fdfe550a82b43656689413ace844f1d2103fc44af6771490c5d2c8c4f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page