Skip to main content

Converts pandas DataFrames into Tableau Hyper Extracts

Project description

pantab: Connecting pandas with Tableau

What is it?

pantab is a tool to help generate Hyper extracts (available with Tableau 10.5+) from a pandas DataFrame.

import pandas as pd
import pantab

df = pd.DataFrame(
    [[1, 2, 3, 4., 5., True, pd.to_datetime('1/1/18'), 'foo'],
     [6, 7, 8, 9., 10., True, pd.to_datetime('1/1/19'), 'foo']
     ], columns=['foo', 'bar', 'baz', 'qux', 'quux', 'quuuz', 'corge',
                 'garply'])

pantab.frame_to_hyper(df, 'foo.hyper')

The above will generate a Hyper extract in the specified location, which you can then open in Tableau.

Hyper Extract in Tableau

Requirements & Installation

  • Python >= 3.5
  • Tableau Extract API (see installation instructions here)
  • pandas

The preferred way to install this package is from pip. Note that this will resolve the pandas dependency for you but will not resolve the Tableau Extract API dependency. Please refer to their installation instructions.

pip install pantab

If you want to run the test suite for this application, you will also need to install pytest.

Known Limitations

The following are all known limitations of this tool:

  • The same Hyper extract cannot be written to twice
  • You can write Hyper extracts, but cannot currently read them
  • You cannot change the table name in your extract (defaulted to 'Extract' in SDK)
  • Duration, Categorical, Complex and Time-zone aware dtypes cannot be written to a Hyper extract

Also note that Tableau does not expose an API to manage different size types. int and float types will all be upcast to 64 bit. While this won't make a difference for writing files, it could prevent the preservation of type size when round-tripping if a reader can be supported by the Tableau API in the future.

Contributing

Want to make this package better? Awesome - any and all contributions are appreciated! With that said, any code contributions must contain test cases to be considered for merging.

Project details


Download files

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

Source Distribution

pantab-0.0.1.dev1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

pantab-0.0.1.dev1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file pantab-0.0.1.dev1.tar.gz.

File metadata

  • Download URL: pantab-0.0.1.dev1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pantab-0.0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 20daed879eb23a9b5997bacbc115790d3030d2e634965f5f2bd2b267c64539ef
MD5 98b0d7869e61f8553b2804a41e5ed0da
BLAKE2b-256 05bcf1efd47cae89928896e7e29029c9f63d0322c44d8133feb52e3daf07b393

See more details on using hashes here.

Provenance

File details

Details for the file pantab-0.0.1.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for pantab-0.0.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ced79b6ffbc9fe6fb14f55def6633d305cd8f73cb2e7ed6a9f0894fec81eaf2
MD5 bbd3719873e7c6b298a34327d4e2f422
BLAKE2b-256 7a511cac3c033aabb97a3e2432dfdd95893cffb40ea1e36f425b1c7acdff85b1

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page