Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Update README and fix <pre>...</pre> rendering #340

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<pre>
```python3
>>> import camelot
>>> tables = camelot.read_pdf('foo.pdf')
>>> tables
&lt;TableList n=1&gt;
<TableList n=1>
>>> tables.export('foo.csv', f='csv', compress=True) # json, excel, html, sqlite
>>> tables[0]
&lt;Table shape=(7, 7)&gt;
<Table shape=(7, 7)>
>>> tables[0].parsing_report
{
'accuracy': 99.02,
Expand All @@ -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!
</pre>
```

| Cycle Name | KI (1/km) | Distance (mi) | Percent Fuel Savings | | | |
|------------|-----------|---------------|----------------------|-----------------|-----------------|----------------|
Expand All @@ -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?
Expand All @@ -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.

<pre>
$ conda install -c conda-forge camelot-py
</pre>
```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:

<pre>
$ pip install camelot-py[cv]
</pre>
```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:

<pre>
$ git clone https://www.github.com/socialcopsdev/camelot
</pre>
```bash
git clone https://www.github.com/socialcopsdev/camelot
```

and install Camelot using pip:

<pre>
$ cd camelot
$ pip install ".[cv]"
</pre>
```
cd camelot
pip install ".[cv]"
```

## Documentation

Expand All @@ -102,25 +104,25 @@ The [Contributor's Guide](https://camelot-py.readthedocs.io/en/master/dev/contri

You can check the latest sources with:

<pre>
$ git clone https://www.github.com/socialcopsdev/camelot
</pre>
```bash
git clone https://www.github.com/socialcopsdev/camelot
```

### Setting up a development environment

You can install the development dependencies easily, using pip:

<pre>
$ pip install camelot-py[dev]
</pre>
```bash
pip install camelot-py[dev]
```

### Testing

After installation, you can run tests using:

<pre>
$ python setup.py test
</pre>
```bash
python setup.py test
```

## Versioning

Expand Down