Skip to main content

(F)ile T(ables)

Project description

Fables - (F)ile T(ables)

CircleCI Apache2.0License Checked with mypy Code style: black

For users:

Parse the tabular data in the input file:

import fables

for parse_result in fables.parse(''):
    for table in parse_result.tables:
    for error in parse_result.errors:

Inspect the contents of the input file:

node = fables.detect('')

for child in node.children:

Note if you've already discovered the input tree from detect(), you can pass it into parse():

parse_results = parse(tree=node)

Handling encrypted zip, xlsx, xlsb, and xls files:

node = fables.detect('encrypted.xlsx')
assert node.encrypted
node.add_password('encrypted.xlsx', 'fables')
assert not node.encrypted

You can also supply a passwords dictionary (filename -> password) into detect and parse:

node = fables.detect(
        '': 'fables',
        # an encrypted file inside the zip
        'encrypted.xlsx': 'foobles',
# and/or parse
parse_results = fables.parse(
        'sub_dir/encrypted.xlsx': 'fables',
        'sub_dir/encrypted.xls': 'foobles',

Seeing is believing:

Clone the repository & run the example file by executing the script with the following command:



The python library python-magic requires additional system dependencies. There are installation instructions there, but here are recommended routes to try:

  • on OSX: brew install libmagic.

  • on Windows: this pip install python-magic-bin will install a built version using ctypes to access the libmagic file type identification library.

Then pip install -r requirements.txt should do the trick.

For contributors:


  • all tests: pytest
    • coverage: pytest --cov=fables tests
  • integration: pytest tests/integration
    • coverage: pytest --cov=fables tests/integration
  • unit: pytest tests/unit
    • coverage: pytest --cov=fables tests/unit

Note all the coverage statistics are for statements.

Type checking with mypy

  • mypy fables


  • We enforce flake8:
    • flake8 .

Run test, type checking, and linter all at once

  • nox

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fables, version 1.2.2
Filename, size File type Python version Upload date Hashes
Filename, size fables-1.2.2-py3-none-any.whl (17.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size fables-1.2.2.tar.gz (12.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page