Macs in Chemistry

Insanely Great Science

Camelot, python tool for extracting PDF table data

 

Camelot is described as a PDF Table Extraction for Humans, it is a Python library that makes it easy to extract tables from PDF files.

>>> import camelot
>>> tables = camelot.read_pdf('foo.pdf')
>>> tables
<TableList n=1>
>>> tables.export('foo.csv', f='csv', compress=True) # json, excel, html
>>> tables[0]
<Table shape=(7, 7)>
>>> tables[0].parsing_report
{
    'accuracy': 99.02,
    'whitespace': 12.24,
    'order': 1,
    'page': 1
}
>>> tables[0].to_csv('foo.csv') # to_json, to_excel, to_html
>>> tables[0].df # get a pandas DataFrame!

Camelot only works with text-based PDFs and not scanned documents. Camelot also comes with a command-line interface. It can be installed using conda

$ conda install -c camelot-dev camelot-py

I've added it to the Data Analysis tools page

Comments

Installing Cheminformtics packages on a Mac

 

A while back I wrote a very popular page describing how to install a wide variety of chemiformatics packages on a Mac, since there have been some changes with Homebrew which have meant that a few of the scientific applications are no longer available so I've decided to rewrite the page on installing the missing packages using Anaconda.

I've also included a list of quick demos so you can everything is working as expected.

Full details are here

Packages include:

  • OpenBabel
  • RDKit
  • brew install cdk
  • chemspot
  • indigo
  • inchi
  • opsin
  • osra
  • pymol
  • oddt

In addition to gfortran and a selection of developers tools.

Comments