Metadata-Version: 2.1
Name: tabeline
Version: 0.1.1
Summary: A data table and data grammar library
Home-page: https://github.com/drhagen/tabeline
License: MIT
Keywords: data,table,grammar,dplyr
Author: David Hagen
Author-email: david@drhagen.com
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: pandas
Requires-Dist: pandas (>=1.4.3,<2.0.0); extra == "pandas"
Requires-Dist: parsita (>=1.7.0,<2.0.0)
Requires-Dist: polars (>=0.13.11,<0.14.0)
Requires-Dist: pyarrow (>=8.0.0,<9.0.0); extra == "pandas"
Requires-Dist: typing_extensions (>=4.3.0,<5.0.0)
Project-URL: Documentation, https://tabeline.drhagen.com
Project-URL: Repository, https://github.com/drhagen/tabeline
Description-Content-Type: text/markdown

# Tabeline

Tabeline is a data table and data grammar library. You write the expressions in strings and supply them to methods on the `DataTable` class. The  strings are parsed by Parsita and converted into Polars for execution.

Tabeline draws inspiration from dplyr, the data grammar of R's tidyverse, especially for its methods names. The `filter`, `mutate`, `group`, and `summarize` methods should all feel familiar. But Tabeline is as proper a Python library as can be, using methods instead of pipes, like is standard in R. 

Tabeline uses Polars under the hood, but adds a lot of handling of edge cases from Polars, which otherwise result in crashes or behavior that is not type stable.

See the [Documentation](https://tabeline.drhagen.com) for the full user guide.

## Installation

It is recommended to install Tabeline from PyPI using `pip`.

```shell
pip install tabeline
```

## Motivating example

```python
from tabeline import DataTable

# Construct a table using clean syntax
# from_csv, from_pandas, and from_polars are also available 
table = DataTable(
    id=[0, 0, 0, 0, 1, 1, 1, 1, 1],
    t=[0, 6, 12, 24, 0, 6, 12, 24, 48],
    y=[0, 2, 3, 1, 0, 4, 3, 2, 1],
)

# Use data grammar methods and string expressions to define
# transformed data tables
analysis = (
    table
    .filter("t <= 24")
    .group("id")
    .summarize(auc="trapz(t, y)")
)

print(analysis)
# shape: (2, 2)
# ┌─────┬──────┐
# │ id  ┆ auc  │
# │ --- ┆ ---  │
# │ i64 ┆ f64  │
# ╞═════╪══════╡
# │ 0   ┆ 45.0 │
# ├╌╌╌╌╌┼╌╌╌╌╌╌┤
# │ 1   ┆ 63.0 │
# └─────┴──────┘
```

