Simple wrapper for tabula-java, read tables from PDF into DataFrame
Project description
tabula-py
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
- Documentation
- FAQ would be helpful if you have issue
- Example notebook on Google Colaboratory
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
- @lahoffm
- @jakekara
- @lcd1232
- @kirkholloway
- @CurtLH
- @nikhilgk
- @krassowski
- @alexandreio
- @rmnevesLH
- @red-bin
- @Gallaecio
- @red-bin
- @alexandreio
- @bpben
- @Bueddl
Another support
You can also support our continued work on tabula-py
with a donation on Patreon.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tabula-py-2.0.3.tar.gz
.
File metadata
- Download URL: tabula-py-2.0.3.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.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0175e91e2bf50dd0be4e4df753335b9cbbd352a58ab3e97f773f35f5e9bfc5e |
|
MD5 | 688e6942f345485431394712a01e600d |
|
BLAKE2b-256 | 458d5c588b226754f54c4f7e68591ad32e2fd01518689ef91181ee1e7157f8d4 |
File details
Details for the file tabula_py-2.0.3-py3-none-any.whl
.
File metadata
- Download URL: tabula_py-2.0.3-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.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1a233c6d8eee8e0fc843b38fbb5daacd21fe4934abb6ab6dbcdf64e4120949 |
|
MD5 | 914f230cfbe9c0cae5d5ef207046ac5f |
|
BLAKE2b-256 | 3496de3bf25950cc18255f22511022475cda4fdf2c3588f11d04198e7d8d4f1d |