Skip to main content

Reads and writes data stored in StarTable format; and stores table data inmemory as a Pandas data frame for easy manipulation.

Project description

pdtable

run-tests

The pdtable Python package offers interfaces to read, write, and manipulate StarTable data.

Documentation

The pdtable documentation is available at pdtable.readthedocs.io.

Examples

Demo: see the pdtable_demo notebook or, if you a Jupyter notebook doesn't do it for you, the notebook's paired script.

Installation

pdtable is available from pypi.org

pip install pdtable

and from conda-forge

conda install pdtable -c conda-forge

Data and metadata: storage and access

Table blocks are stored as TableDataFrame objects, which inherit from pandas.DataFrame but include additional, hidden metadata. This hidden metadata contains all the information from Table blocks that does not fit in a classic Pandas dataframe object: table destinations, column units, table origin, etc.

Data in TableDataFrame objects can be accessed and manipulated using the Pandas API as it the object were a vanilla Pandas dataframe, with all the convenience that this entails.

The StarTable-specific metadata hidden in a TableDataFrame's metadata can in principle be accessed directly; however a much more ergonomic interface is offered via a Table facade object, which is a thin wrapper around TableDataFrame. Table also supports some limited data manipulation, though with the advantage of more easily supporting StarTable-specific metadata; for example, easily specifying column units when adding new columns.

I/O

Readers and writers are available for CSV and Excel, both as files and as streams. Parsing is efficient and, by default, lenient, though this is readily customized.

Reading can also be filtered early, such that only certain block types or tables with certain names get fully parsed. This can reduce reading time substantially when reading e.g. only a few tables from an otherwise large file or stream.

Directive blocks are parsed by the readers, and presented to the client code for application-specific interpretation.

Import from and export to JSON is also supported.

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

pdtable-0.0.4b0.tar.gz (53.5 kB view details)

Uploaded Source

Built Distribution

pdtable-0.0.4b0-py3-none-any.whl (69.4 kB view details)

Uploaded Python 3

File details

Details for the file pdtable-0.0.4b0.tar.gz.

File metadata

  • Download URL: pdtable-0.0.4b0.tar.gz
  • Upload date:
  • Size: 53.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.9

File hashes

Hashes for pdtable-0.0.4b0.tar.gz
Algorithm Hash digest
SHA256 26ed800792426b1f29ddc3327072f3de914e492e64a15b1af5157c25d1b0b3d8
MD5 80de66ad14198c0f8ac23b9297f01da7
BLAKE2b-256 1abfe92cece3f4152e409e58e2ca391af199df6c5df9eeb1d02a82d61ea0a419

See more details on using hashes here.

File details

Details for the file pdtable-0.0.4b0-py3-none-any.whl.

File metadata

  • Download URL: pdtable-0.0.4b0-py3-none-any.whl
  • Upload date:
  • Size: 69.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.9

File hashes

Hashes for pdtable-0.0.4b0-py3-none-any.whl
Algorithm Hash digest
SHA256 45e4e7d6a401f463a829b1e2c313662b414429d3be4ab72511b58d84748f7614
MD5 63f5f5ff4bc270f55c3650a5e3ff0068
BLAKE2b-256 b97f2f4a26e0d1537a1449e8d2c72a8e819f7125f355b9fa275d4e26a2faf8c3

See more details on using hashes here.

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