Skip to main content

Read and write tfs files.

Project description

TFS-Pandas

Cron Testing Code Climate coverage Code Climate maintainability (percentage) GitHub last commit GitHub release DOI

This package provides reading and writing functionality for table format system (tfs) files. Files are read into a TfsDataFrame, a class built on top of the famous pandas.DataFrame, which in addition to the normal behaviour attaches an OrderedDict of headers to the DataFrame.

Installing

Installation is easily done via pip:

pip install tfs-pandas

Example Usage

The package is imported as tfs, and exports top-level functions for reading and writing:

import tfs

# Loading a TFS file is simple
data_frame = tfs.read("path_to_input.tfs", index="index_column")

# You can access and modify the headers with the .headers attribute
useful_variable = data_frame.headers["SOME_KEY"]
data_frame.headers["NEW_KEY"] = some_variable

# Manipulate data as you do with pandas DataFrames
data_frame["NEWCOL"] = data_frame.COL_A * data_frame.COL_B

# You can check the validity of a TfsDataFrame, and choose the behavior in case of errors
tfs.frame.validate(data_frame, non_unique_behavior="raise")  # or choose "warn"

# Writing out to disk is simple too
tfs.write("path_to_output.tfs", data_frame, save_index="index_column")

It also provides some tools to validate and manipulate TfsDataFrames and their headers; or lazily manage a collection of TFS files. See the API documentation for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

tfs-pandas-3.0.1.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

tfs_pandas-3.0.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file tfs-pandas-3.0.1.tar.gz.

File metadata

  • Download URL: tfs-pandas-3.0.1.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for tfs-pandas-3.0.1.tar.gz
Algorithm Hash digest
SHA256 e0044dadfb9859e64a4e83d3026e43f52cb1e8532d2eda2517f3d34352dc86b4
MD5 31c83ec292025c94e0894724b21a131f
BLAKE2b-256 c747991ab44de010076a2a56d30c35fabfdf815f08c219a35057ce8f7a1be8fa

See more details on using hashes here.

File details

Details for the file tfs_pandas-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: tfs_pandas-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for tfs_pandas-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 952cbac3cf7976430be74105568748bd4cd1ce12d301a39b3ce6352e8a010573
MD5 4afdf51f2dc050a684a7ce0c4b325d75
BLAKE2b-256 5dc47d46c9cb14eaa8f07ffe54d798cec9436e4d19a1645f164f8fff0ae14b54

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