tabeline


Nametabeline JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/drhagen/tabeline
SummaryA data frame and data grammar library
upload_time2023-11-03 10:00:06
maintainer
docs_urlNone
authorDavid Hagen
requires_python>=3.9,<3.13
licenseMIT
keywords dataframe datatable datagrammar dplyr
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Tabeline

Tabeline is a data frame and data grammar library. You write the expressions in strings and supply them to methods on the `DataFrame` 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_by`, 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 DataFrame

# Construct a data frame using clean syntax
# from_csv, from_pandas, and from_polars are also available 
df = DataFrame(
    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 frames
analysis = (
    df
    .filter("t <= 24")
    .group_by("id")
    .summarize(auc="trapz(t, y)")
)

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


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/drhagen/tabeline",
    "name": "tabeline",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<3.13",
    "maintainer_email": "",
    "keywords": "dataframe,datatable,datagrammar,dplyr",
    "author": "David Hagen",
    "author_email": "david@drhagen.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/f3/65c1baf7f98f05b365d303ece5ef0f9c19d7f3a440c4832abfc685d37883/tabeline-0.4.0.tar.gz",
    "platform": null,
    "description": "# Tabeline\n\nTabeline is a data frame and data grammar library. You write the expressions in strings and supply them to methods on the `DataFrame` class. The strings are parsed by Parsita and converted into Polars for execution.\n\nTabeline draws inspiration from dplyr, the data grammar of R's tidyverse, especially for its methods names. The `filter`, `mutate`, `group_by`, 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. \n\nTabeline 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.\n\nSee the [Documentation](https://tabeline.drhagen.com) for the full user guide.\n\n## Installation\n\nIt is recommended to install Tabeline from PyPI using `pip`.\n\n```shell\npip install tabeline\n```\n\n## Motivating example\n\n```python\nfrom tabeline import DataFrame\n\n# Construct a data frame using clean syntax\n# from_csv, from_pandas, and from_polars are also available \ndf = DataFrame(\n    id=[0, 0, 0, 0, 1, 1, 1, 1, 1],\n    t=[0, 6, 12, 24, 0, 6, 12, 24, 48],\n    y=[0, 2, 3, 1, 0, 4, 3, 2, 1],\n)\n\n# Use data grammar methods and string expressions to define\n# transformed data frames\nanalysis = (\n    df\n    .filter(\"t <= 24\")\n    .group_by(\"id\")\n    .summarize(auc=\"trapz(t, y)\")\n)\n\nprint(analysis)\n# shape: (2, 2)\n# \u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n# \u2502 id  \u2506 auc  \u2502\n# \u2502 --- \u2506 ---  \u2502\n# \u2502 i64 \u2506 f64  \u2502\n# \u255e\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n# \u2502 0   \u2506 45.0 \u2502\n# \u251c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n# \u2502 1   \u2506 63.0 \u2502\n# \u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A data frame and data grammar library",
    "version": "0.4.0",
    "project_urls": {
        "Documentation": "https://tabeline.drhagen.com",
        "Homepage": "https://github.com/drhagen/tabeline",
        "Repository": "https://github.com/drhagen/tabeline"
    },
    "split_keywords": [
        "dataframe",
        "datatable",
        "datagrammar",
        "dplyr"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33a8a5b95fa24d39a0cb5016e81cae812435cce1223a5930544c1d9a2ef4780b",
                "md5": "f8d148a418ad243db0e08d2a7a320d41",
                "sha256": "ffaa22117611ce9c6e3a7bcac3ad33904b5605c5474482e09a1700866ba0d98b"
            },
            "downloads": -1,
            "filename": "tabeline-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f8d148a418ad243db0e08d2a7a320d41",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.13",
            "size": 20318,
            "upload_time": "2023-11-03T10:00:04",
            "upload_time_iso_8601": "2023-11-03T10:00:04.704280Z",
            "url": "https://files.pythonhosted.org/packages/33/a8/a5b95fa24d39a0cb5016e81cae812435cce1223a5930544c1d9a2ef4780b/tabeline-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6cf365c1baf7f98f05b365d303ece5ef0f9c19d7f3a440c4832abfc685d37883",
                "md5": "bd3bc1982baf89795f23382ca47c75c3",
                "sha256": "d3f8756f12c374a815f66c4cc1e80b67ef7d1fdf5cb624c865da95e761b85383"
            },
            "downloads": -1,
            "filename": "tabeline-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bd3bc1982baf89795f23382ca47c75c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.13",
            "size": 17522,
            "upload_time": "2023-11-03T10:00:06",
            "upload_time_iso_8601": "2023-11-03T10:00:06.990698Z",
            "url": "https://files.pythonhosted.org/packages/6c/f3/65c1baf7f98f05b365d303ece5ef0f9c19d7f3a440c4832abfc685d37883/tabeline-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-03 10:00:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "drhagen",
    "github_project": "tabeline",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tabeline"
}
        
Elapsed time: 0.14380s