TFS-Pandas
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 pandas.DataFrame, which in addition to the normal behavior attaches a dictionary 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/mamba 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, speficying the
# compatibility mode as well as the behavior in case of errors
tfs.frame.validate(
data_frame,
non_unique_behavior="raise", # or choose "warn"
compatibility="mad-x", # or choose "mad-ng"
)
# Writing out to disk is simple too
tfs.write("path_to_output.tfs", data_frame, save_index="index_column")
Compression is automatically supported, based on the provided file extension (for supported formats):
import tfs
# Reading a compressed file is simple, compression format is inferred
df = tfs.read("path_to_input.tfs.gz")
# When writing choose the compression format by providing the appropriate file extension
tfs.write("path_to_output.tfs.bz2", df)
tfs.write("path_to_output.tfs.zip", df)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for tfs-pandas 4.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tfs_pandas-4.0.2.tar.gz | 34.5 kB | Without provenance | Details for tfs_pandas-4.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tfs_pandas-4.0.2-py3-none-any.whl | Python 3 | none | any | Details for tfs_pandas-4.0.2-py3-none-any.whl |
Total release size: 66.8 kB
Release files / tfs_pandas-4.0.2.tar.gz
| Download URL | tfs_pandas-4.0.2.tar.gz |
|---|---|
| Size | 34.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2eda7f5bb467539fe4c27d17c242194e28d2e9c74ba1e2fa623017c04f29d493
|
|
BLAKE2b-256 checksum How to use checksums |
2689ccb5bfcd6567be5251d1dd27bd241bf8d8559b85832e5d42096b8b9d6278
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tfs_pandas-4.0.2-py3-none-any.whl
| Download URL | tfs_pandas-4.0.2-py3-none-any.whl |
|---|---|
| Size | 32.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c8097a870806964b921ba4a77d434f8cd189697f45d2eeb6bbdbaadd93d2f49
|
|
BLAKE2b-256 checksum How to use checksums |
302821eadf6d141faa2df88088669a06b2ceae9936afe5e8c359abc8a3de62e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for tfs-pandas 4.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.