Code Monkey home page Code Monkey logo

Comments (6)

vinayak-mehta avatar vinayak-mehta commented on May 18, 2024

Current API:

>>> from camelot.pdf import Pdf
>>> from camelot.lattice import Lattice
>>> manager = Pdf(Lattice(), "/path/to/pdf")
>>> tables = manager.extract()

This is redundant (since two imports are needed to create a 'manager' that parses PDFs and not intuitive (since the user doesn't know what is returned in tables, which is a dict with multiple keys that make him/her/them look at the documentation, these multiple keys contain different stats and data is present in the 'data' key as a 2-D list).

from camelot.

vinayak-mehta avatar vinayak-mehta commented on May 18, 2024

Edit: Commented again.

from camelot.

vinayak-mehta avatar vinayak-mehta commented on May 18, 2024

Will list down properties of the Table object here later, the idea is to let the user get the data without having to look at the docs often, either by having a df property which contains a pandas DataFrame object or a 2-D list again perhaps? Other properties can be the various stats.

from camelot.

vinayak-mehta avatar vinayak-mehta commented on May 18, 2024

Make configuration parameters for parsing methods more intuitive (either through docs or making them simpler or removing them?), for example, user has no idea what threshold_constant is.

from camelot.

vinayak-mehta avatar vinayak-mehta commented on May 18, 2024

New API:

>>> import camelot
>>> tables = camelot.read_pdf("foo.pdf")
>>> tables
<TableList n=2>
>>> tables.to_csv(zip=True) # to_json, to_excel, to_html
>>> tables[0]
<Table shape=(3,4)>
>>> tables[0].parsing_report
{
    "accuracy": 96,
    "whitespace": 80,
    "time_taken": 0.5,
    "page": 1
}
>>> df = tables[0].df
>>> tables[0].to_csv("foo.csv") # to_json, to_excel, to_html

Each table is internally represented as a pandas DataFrame.

from camelot.

vinayak-mehta avatar vinayak-mehta commented on May 18, 2024

Opening another issue #95 for configuration parameter names.

from camelot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.