diff --git a/README.md b/README.md index 3f6013f5..59c521b1 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,14 @@ **Here's how you can extract tables from PDF files.** Check out the PDF used in this example [here](https://github.com/socialcopsdev/camelot/blob/master/docs/_static/pdf/foo.pdf). -
+```python3 >>> 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, @@ -33,7 +33,7 @@ } >>> 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 | | | | |------------|-----------|---------------|----------------------|-----------------|-----------------|----------------| @@ -46,6 +46,8 @@ There's a [command-line interface](https://camelot-py.readthedocs.io/en/master/user/cli.html) too! +Refer to the [QuickStart Guide](https://github.com/socialcopsdev/camelot/blob/master/docs/user/quickstart.rst#quickstart) to quickly get started with Camelot, extract tables from PDFs and explore some basic options. + **Note:** Camelot only works with text-based PDFs and not scanned documents. (As Tabula [explains](https://github.com/tabulapdf/tabula#why-tabula), "If you can click and drag to select text in your table in a PDF viewer, then your PDF is text-based".) ## Why Camelot? @@ -63,32 +65,32 @@ See [comparison with other PDF table extraction libraries and tools](https://git The easiest way to install Camelot is to install it with [conda](https://conda.io/docs/), which is a package manager and environment management system for the [Anaconda](http://docs.continuum.io/anaconda/) distribution. -
-$ conda install -c conda-forge camelot-py -+```bash +conda install -c conda-forge camelot-py +``` ### Using pip After [installing the dependencies](https://camelot-py.readthedocs.io/en/master/user/install-deps.html) ([tk](https://packages.ubuntu.com/trusty/python-tk) and [ghostscript](https://www.ghostscript.com/)), you can simply use pip to install Camelot: --$ pip install camelot-py[cv] -+```bash +pip install camelot-py[cv] +``` ### From the source code After [installing the dependencies](https://camelot-py.readthedocs.io/en/master/user/install.html#using-pip), clone the repo using: --$ git clone https://www.github.com/socialcopsdev/camelot -+```bash +git clone https://www.github.com/socialcopsdev/camelot +``` and install Camelot using pip: --$ cd camelot -$ pip install ".[cv]" -+``` +cd camelot +pip install ".[cv]" +``` ## Documentation @@ -102,25 +104,25 @@ The [Contributor's Guide](https://camelot-py.readthedocs.io/en/master/dev/contri You can check the latest sources with: --$ git clone https://www.github.com/socialcopsdev/camelot -+```bash +git clone https://www.github.com/socialcopsdev/camelot +``` ### Setting up a development environment You can install the development dependencies easily, using pip: --$ pip install camelot-py[dev] -+```bash +pip install camelot-py[dev] +``` ### Testing After installation, you can run tests using: --$ python setup.py test -+```bash +python setup.py test +``` ## Versioning