statline


Namestatline JSON
Version 1.1.1 PyPI version JSON
download
home_pageNone
SummaryStatLine — weighted player scoring, efficiency modeling, and CLI tooling
upload_time2025-08-21 04:42:39
maintainerNone
docs_urlNone
authorStatLine
requires_python<3.14,>=3.10
licenseStatLine – Weighted Player Scoring and Analytics Copyright (C) 2025 StatLine LLC (in formation) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. As an additional condition, you may not use the name “StatLine” or any confusingly similar mark in connection with your distribution, hosting, or marketing of this software without express written permission from the copyright holder. This restriction is to protect the StatLine brand and avoid confusion between official and unofficial versions. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. --- Additional Terms (Trademark) "StatLine" and associated logos are trademarks of StatLine LLC (in formation), trademark registration pending. This license does not grant you any rights to use the StatLine name or branding without prior written permission, except for fair use when referring to the project. Any fork, derivative work, or public deployment must remove the StatLine trademark unless explicitly authorized under our Trademark Policy.
keywords analytics basketball cli discord efg google-sheets mvp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # StatLine

**StatLine™ — weighted player scoring, efficiency modeling, and tooling.**

“StatLine” is a trademark of StatLine LLC (in formation), registration pending.
Source code is licensed under the GNU Affero General Public License v3 (see LICENSE).
Brand, name, and logo are not covered by the AGPL.

---

## What is StatLine?

StatLine is an adapter-driven analytics framework that:

- normalizes raw game stats,
- computes per-metric scores (with clamps, inversion, and ratios),
- aggregates into buckets and applies weight presets (e.g., pri),
- exposes a clean CLI and library API,
- optionally ingests Google Sheets and caches mapped rows.

Supported Python:

- **3.10 – 3.13** (tested in CI across Linux, macOS, Windows)

---

## Install

Base install:

```bash
# pip
python -m venv .venv && source .venv/bin/activate   # use .\.venv\Scripts\activate on Windows
pip install statline
```

With extras:

```bash
# Google Sheets ingestion
pip install "statline[sheets]"

# Developer tools (linters, types, tests)
pip install -e ".[dev]"
```

---

## CLI Basics

StatLine installs a console script `statline`. You can also call the module directly.

```bash
statline --help
python -m statline.cli --help
```

### Common commands

```bash
# list bundled adapters
statline adapters

# interactive scoring REPL (banner + timing are enabled by default)
statline interactive

# score a file of rows (CSV or YAML understood by the adapter)
statline score --adapter example_game stats.csv

# write results to a CSV instead of stdout
statline score --adapter example_game stats.csv --out results.csv
```

Subcommands:

- `adapters` — show available adapter keys & aliases
- `interactive` — guided prompts + timing table
- `export-csv` — export cached mapped metrics (when using the cache/Sheets flow)
- `score` — batch-score a CSV/YAML through an adapter

When the CLI runs, you’ll see a banner (noted so you can confirm proper install):

```diff
=== StatLine — Adapter-Driven Scoring ===
```

Enable per-stage timing via env (eg: 14ms):

```bash
STATLINE_TIMING=1 statline score --adapter rbw5 stats.csv
```

---

## Input formats

StatLine reads **CSV** or **YAML**. The columns/keys must match what the adapter expects.

### CSV

- First row is the header.
- Each subsequent row is an entity (player).
- Provide whatever **raw** fields your adapter maps (e.g., `ppg, apg, fgm, fga, tov`).

```cs
display_name,team,ppg,apg,orpg,drpg,spg,bpg,fgm,fga,tov
Jordan,Red,27.3,4.8,1.2,3.6,1.9,0.7,10.2,22.1,2.1
```

### Example adapter (yaml)

Adapters define the schema for raw inputs, buckets, weights, and any derived metrics.
Below is the `example.yaml` you can ship in `statline/core/adapters/defs/`:

```yaml
key: example_game
version: 0.1.0
aliases: [ex, sample]
title: Example Game

dimensions:
  map:   { values: [MapA, MapB, MapC] }
  side:  { values: [Attack, Defense] }
  role:  { values: [Carry, Support, Flex] }
  mode:  { values: [Pro, Ranked, Scrim] }

buckets:
  scoring: {}
  impact: {}
  utility: {}
  survival: {}
  discipline: {}

metrics:
  # direct fields
  - { key: stat3_count, bucket: utility,    clamp: [0, 50],  source: { field: stat3_count } }
  - { key: mistakes,    bucket: discipline, clamp: [0, 25], invert: true, source: { field: mistakes } }

# ratios/derived — replace old mapping math
efficiency:
  - { key: stat1_per_round, make: raw["stat1_total"], attempt: raw["rounds_played"], bucket: scoring }
  - { key: stat2_rate,      make: raw["stat2_numer"], attempt: raw["stat2_denom"],   bucket: impact }
  - { key: stat4_quality,   make: raw["stat4_good"],  attempt: raw["stat4_total"],   bucket: survival }

weights:
  pri:
    scoring:    0.30
    impact:     0.28
    utility:    0.16
    survival:   0.16
    discipline: 0.10
  mvp:
    scoring:    0.34
    impact:     0.30
    utility:    0.12
    survival:   0.14
    discipline: 0.10
  support:
    scoring:    0.16
    impact:     0.18
    utility:    0.40
    survival:   0.16
    discipline: 0.10

penalties:
  pri:     { discipline: 0.10 }
  mvp:     { discipline: 0.12 }
  support: { discipline: 0.08 }

sniff:
  require_any_headers: [stat1_total, stat2_numer, stat2_denom, rounds_played, mistakes]
```

Reference `HOWTO.md` should you have any questions regarding adapters and yaml formatting.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "statline",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.10",
    "maintainer_email": null,
    "keywords": "analytics, basketball, cli, discord, efg, google-sheets, mvp",
    "author": "StatLine",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/22/b9/1c37a97043ae8988c68858d60e1d3c0001f6381e550fd002f72c96ff4a23/statline-1.1.1.tar.gz",
    "platform": null,
    "description": "# StatLine\n\n**StatLine\u2122 \u2014 weighted player scoring, efficiency modeling, and tooling.**\n\n\u201cStatLine\u201d is a trademark of StatLine LLC (in formation), registration pending.\nSource code is licensed under the GNU Affero General Public License v3 (see LICENSE).\nBrand, name, and logo are not covered by the AGPL.\n\n---\n\n## What is StatLine?\n\nStatLine is an adapter-driven analytics framework that:\n\n- normalizes raw game stats,\n- computes per-metric scores (with clamps, inversion, and ratios),\n- aggregates into buckets and applies weight presets (e.g., pri),\n- exposes a clean CLI and library API,\n- optionally ingests Google Sheets and caches mapped rows.\n\nSupported Python:\n\n- **3.10 \u2013 3.13** (tested in CI across Linux, macOS, Windows)\n\n---\n\n## Install\n\nBase install:\n\n```bash\n# pip\npython -m venv .venv && source .venv/bin/activate   # use .\\.venv\\Scripts\\activate on Windows\npip install statline\n```\n\nWith extras:\n\n```bash\n# Google Sheets ingestion\npip install \"statline[sheets]\"\n\n# Developer tools (linters, types, tests)\npip install -e \".[dev]\"\n```\n\n---\n\n## CLI Basics\n\nStatLine installs a console script `statline`. You can also call the module directly.\n\n```bash\nstatline --help\npython -m statline.cli --help\n```\n\n### Common commands\n\n```bash\n# list bundled adapters\nstatline adapters\n\n# interactive scoring REPL (banner + timing are enabled by default)\nstatline interactive\n\n# score a file of rows (CSV or YAML understood by the adapter)\nstatline score --adapter example_game stats.csv\n\n# write results to a CSV instead of stdout\nstatline score --adapter example_game stats.csv --out results.csv\n```\n\nSubcommands:\n\n- `adapters` \u2014 show available adapter keys & aliases\n- `interactive` \u2014 guided prompts + timing table\n- `export-csv` \u2014 export cached mapped metrics (when using the cache/Sheets flow)\n- `score` \u2014 batch-score a CSV/YAML through an adapter\n\nWhen the CLI runs, you\u2019ll see a banner (noted so you can confirm proper install):\n\n```diff\n=== StatLine \u2014 Adapter-Driven Scoring ===\n```\n\nEnable per-stage timing via env (eg: 14ms):\n\n```bash\nSTATLINE_TIMING=1 statline score --adapter rbw5 stats.csv\n```\n\n---\n\n## Input formats\n\nStatLine reads **CSV** or **YAML**. The columns/keys must match what the adapter expects.\n\n### CSV\n\n- First row is the header.\n- Each subsequent row is an entity (player).\n- Provide whatever **raw** fields your adapter maps (e.g., `ppg, apg, fgm, fga, tov`).\n\n```cs\ndisplay_name,team,ppg,apg,orpg,drpg,spg,bpg,fgm,fga,tov\nJordan,Red,27.3,4.8,1.2,3.6,1.9,0.7,10.2,22.1,2.1\n```\n\n### Example adapter (yaml)\n\nAdapters define the schema for raw inputs, buckets, weights, and any derived metrics.\nBelow is the `example.yaml` you can ship in `statline/core/adapters/defs/`:\n\n```yaml\nkey: example_game\nversion: 0.1.0\naliases: [ex, sample]\ntitle: Example Game\n\ndimensions:\n  map:   { values: [MapA, MapB, MapC] }\n  side:  { values: [Attack, Defense] }\n  role:  { values: [Carry, Support, Flex] }\n  mode:  { values: [Pro, Ranked, Scrim] }\n\nbuckets:\n  scoring: {}\n  impact: {}\n  utility: {}\n  survival: {}\n  discipline: {}\n\nmetrics:\n  # direct fields\n  - { key: stat3_count, bucket: utility,    clamp: [0, 50],  source: { field: stat3_count } }\n  - { key: mistakes,    bucket: discipline, clamp: [0, 25], invert: true, source: { field: mistakes } }\n\n# ratios/derived \u2014 replace old mapping math\nefficiency:\n  - { key: stat1_per_round, make: raw[\"stat1_total\"], attempt: raw[\"rounds_played\"], bucket: scoring }\n  - { key: stat2_rate,      make: raw[\"stat2_numer\"], attempt: raw[\"stat2_denom\"],   bucket: impact }\n  - { key: stat4_quality,   make: raw[\"stat4_good\"],  attempt: raw[\"stat4_total\"],   bucket: survival }\n\nweights:\n  pri:\n    scoring:    0.30\n    impact:     0.28\n    utility:    0.16\n    survival:   0.16\n    discipline: 0.10\n  mvp:\n    scoring:    0.34\n    impact:     0.30\n    utility:    0.12\n    survival:   0.14\n    discipline: 0.10\n  support:\n    scoring:    0.16\n    impact:     0.18\n    utility:    0.40\n    survival:   0.16\n    discipline: 0.10\n\npenalties:\n  pri:     { discipline: 0.10 }\n  mvp:     { discipline: 0.12 }\n  support: { discipline: 0.08 }\n\nsniff:\n  require_any_headers: [stat1_total, stat2_numer, stat2_denom, rounds_played, mistakes]\n```\n\nReference `HOWTO.md` should you have any questions regarding adapters and yaml formatting.\n",
    "bugtrack_url": null,
    "license": "StatLine \u2013 Weighted Player Scoring and Analytics\n        Copyright (C) 2025 StatLine LLC (in formation)\n        \n        This program is free software: you can redistribute it and/or modify\n        it under the terms of the GNU Affero General Public License as published\n        by the Free Software Foundation, either version 3 of the License, or\n        (at your option) any later version.\n        \n        As an additional condition, you may not use the name \u201cStatLine\u201d or any\n        confusingly similar mark in connection with your distribution, hosting,\n        or marketing of this software without express written permission from\n        the copyright holder. This restriction is to protect the StatLine brand\n        and avoid confusion between official and unofficial versions.\n        \n        This program is distributed in the hope that it will be useful,\n        but WITHOUT ANY WARRANTY; without even the implied warranty of\n        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n        GNU Affero General Public License for more details.\n        \n        You should have received a copy of the GNU Affero General Public License\n        along with this program.  If not, see <https://www.gnu.org/licenses/>.\n        \n        ---\n        \n        Additional Terms (Trademark)\n        \n        \"StatLine\" and associated logos are trademarks of StatLine LLC (in formation), trademark registration pending.  \n        This license does not grant you any rights to use the StatLine name or branding without prior written permission, except for fair use when referring to the project. Any fork, derivative work, or public deployment must remove the StatLine trademark unless explicitly authorized under our Trademark Policy.",
    "summary": "StatLine \u2014 weighted player scoring, efficiency modeling, and CLI tooling",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/amillolive/StatLine",
        "Issues": "https://github.com/amillolive/StatLine/issues",
        "Repository": "https://github.com/amillolive/StatLine"
    },
    "split_keywords": [
        "analytics",
        " basketball",
        " cli",
        " discord",
        " efg",
        " google-sheets",
        " mvp"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "04f128512da8cf92e01694e0b40a25c8f7484395d800b87f57dcd0981b27ffd9",
                "md5": "6f0272eab34c7ca8be2a85d8ea41b35d",
                "sha256": "ea8239d4bc94d551c0f316b00233587e6ad55b171fd47148e6d1cc44c6f37fb1"
            },
            "downloads": -1,
            "filename": "statline-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6f0272eab34c7ca8be2a85d8ea41b35d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.10",
            "size": 52466,
            "upload_time": "2025-08-21T04:42:38",
            "upload_time_iso_8601": "2025-08-21T04:42:38.135366Z",
            "url": "https://files.pythonhosted.org/packages/04/f1/28512da8cf92e01694e0b40a25c8f7484395d800b87f57dcd0981b27ffd9/statline-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "22b91c37a97043ae8988c68858d60e1d3c0001f6381e550fd002f72c96ff4a23",
                "md5": "eb56020045b4f64a80a8e8d7e85b005f",
                "sha256": "a0c68057572489aad631c9655f12f609aced0f0291deb013c5bc6243605bd432"
            },
            "downloads": -1,
            "filename": "statline-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "eb56020045b4f64a80a8e8d7e85b005f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.10",
            "size": 40514,
            "upload_time": "2025-08-21T04:42:39",
            "upload_time_iso_8601": "2025-08-21T04:42:39.337642Z",
            "url": "https://files.pythonhosted.org/packages/22/b9/1c37a97043ae8988c68858d60e1d3c0001f6381e550fd002f72c96ff4a23/statline-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-21 04:42:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "amillolive",
    "github_project": "StatLine",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "statline"
}
        
Elapsed time: 1.90565s