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 tables in a PDF. You can read tables from a PDF and convert them into a pandas DataFrame. tabula-py also enables you to convert a PDF file into a CSV, a TSV or a JSON file.

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

Requirements

  • Java 8+
  • Python 3.6+

OS

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

Usage

Install

Ensure you have a Java runtime and set the PATH for it.

pip install tabula-py

Example

tabula-py enables you to extract tables from a PDF into a DataFrame, or a JSON. It can also extract tables from a PDF and save the file as a CSV, a TSV, or a 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 details. 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.3.0.tar.gz (12.5 MB view details)

Uploaded Source

Built Distribution

tabula_py-2.3.0-py3-none-any.whl (12.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tabula-py-2.3.0.tar.gz
  • Upload date:
  • Size: 12.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for tabula-py-2.3.0.tar.gz
Algorithm Hash digest
SHA256 9da61aa5d4256f79e7fa64d1fb09956d4c104d1a0116566c43bf9f612f37c149
MD5 af7b588664060ffe7cf86417803af7bc
BLAKE2b-256 d9ba07f59c8777849aa422d833c95a3d7dfc300be9b18a8c60c4fcb004e39954

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tabula_py-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for tabula_py-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 784c37a9a46bc8b928cf31cef1d7ed1c9db8af19fb6bb1e63a481ecda0d169d1
MD5 870add9aefad670bd223925dc74c986b
BLAKE2b-256 25aa40404ffebbd1bb4d19ae4445f1eb63be8e12c5ab0146d0bf7e78c8d09e2e

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