Skip to main content

Read and write tfs files.

Project description

TFS-Pandas

Cron Testing Code Climate coverage Code Climate maintainability (percentage)

PyPI Version GitHub release Conda-forge Version 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.

See the API documentation for details.

Installing

Installation is easily done via pip:

python -m pip install tfs-pandas

One can also install in a conda environment via the conda-forge channel with:

conda install -c conda-forge 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.

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.1.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

tfs_pandas-3.1.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tfs-pandas-3.1.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for tfs-pandas-3.1.0.tar.gz
Algorithm Hash digest
SHA256 fd4e645db2ec983ad8350d832ccbed2ae8d671e25fa8c4a7b3e86bf5462183b8
MD5 44162745eba3b02ec389f60827122dd5
BLAKE2b-256 a7038a13227b07a01e904ab9156620f32bbf04864b8e0dc72e5efe4dc9399523

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tfs_pandas-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for tfs_pandas-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ac60905e2a5182eccc982a38ae988cd91593bd58c929adedae0764071fad5a1
MD5 849e717d0f9baa5c1c5341124b81e2e7
BLAKE2b-256 8ef4aa3fe961e662373e4802d0e8afab074b552c2428e016590d60a26828b78f

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