Skip to main content

tlfs

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install tlfs

License

tlfs is distributed under the terms of the MIT license.

Example usage

For some "standard" (opinionated) stuff you could do the following (which is what is done in the web version on streamlit):

tlf = TLF("Test")
tlf.from_xlsx("path-to-your.xlsx")
tlf
tlf.to_docx("path-to-your.docx")

For custom stuff one has to program by hand:

# overloading * Quant/Quali/Itemset to create Tables quickly
age = Quant("Age")
sex = Quali("Sex", groups = ["M", "F"])
trt = Quali("Treatment", groups = ["EXP", "CTRL"])
prices = Itemset("Unit costs",
                 items = ["Dentist", "Hospice", "Blood test"],
                 contents = ["unit cost", "per", "source"])
nation = Quali("Nation", groups = ["UK", "ITA"])

age * trt
[var * trt for var in [age, sex]] + [prices * nation]


# Changing display default in a table
age2 = Quant("Age", display = ["median", "25pct", "75pct"], unit = 'years')
age3 = Quant("Age", display = "median (iqr)", cell_content = "xx (xx - xx)")
sex2 = Quali("Sex", groups = ["M", "F"], display = "n", cell_content = "x")


univ = Section("Univariate tables", [Table(age), Table(sex)])
changed_def = Section("Some changed defaults", [Table(age2), age2 * trt, age3 * trt, Table(sex2)])
listings = Section("Listings", [Table(prices), prices * nation])
tlf2 = TLF("Table, Listings, Figure examples", [univ, biv, changed_def, listings])
tlf.to_doc("whatever.docx")

TODO

  • add random figures/graphs
  • table/figure numbering?
  • overload + in Table to stack them
  • overload + in Sections to concatenate them
  • just do Section("Univariate tables", [age, sex]) instead of Section("Univariate tables", [Table(age), Table(sex)])
  • "UK|Control", "UK|Intervention", "Tot|Control", "Tot|Intervention", by three way tables

Metadata

Release files for tlfs 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tlfs 0.0.5
File Size Uploaded Provenance Actions
tlfs-0.0.5.tar.gz 34.6 kB Without provenance Details for tlfs-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tlfs 0.0.5
File Interpreter ABI Platform Actions
tlfs-0.0.5-py3-none-any.whl Python 3 none any Details for tlfs-0.0.5-py3-none-any.whl

Total release size: 42.5 kB

Release files / tlfs-0.0.5.tar.gz

Download URL tlfs-0.0.5.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
eae88f34e5493128061e4d181b7c284a18c2382941e47e8d3567c304d9076566
BLAKE2b-256 checksum
How to use checksums
257edbf68f7589d5c7f54725378894a2e35fb958f949a10d89966975da9bf5fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release files / tlfs-0.0.5-py3-none-any.whl

Download URL tlfs-0.0.5-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa73456e416634872a2424db49872379890ea56b489fee943f88c17ca45b97b4
BLAKE2b-256 checksum
How to use checksums
a5cece5245018e9d583aedbc46a17410eaa6774e1dff865e4b18768f15725fa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Security for tlfs 0.0.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page