endstone-bstats


Nameendstone-bstats JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummarybStats Metrics for Endstone Plugins
upload_time2024-12-03 16:39:01
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords bstats endstone metrics minecraft
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # endstone-bstats

`endstone-bstats` is a Python library that provides functionality for integrating bStats metrics into your Endstone
plugins. It is designed to be simple, extensible, and lightweight.

## Features

- Supports various types of charts, including:
    - Simple Pie
    - Advanced Pie
    - Drilldown Pie
    - Single Line
    - Multi Line
    - Simple Bar
    - Advanced Bar
- Easy-to-use APIs for collecting and sending metric data.
- Designed for flexibility and extensibility.

## Installation

Install the package using pip:

```bash
pip install endstone-bstats
```

## Quick start

[bStats](https://bstats.org/getting-started) is a free and open source website that helps you to collect usage data for
your plugin. Integrating bStats into your plugin is straight forward and done in a matter of seconds.

Here’s a simple example of how to add bStats to your plugin.

```python
from endstone.plugin import Plugin
from endstone_bstats import Metrics


class ExamplePlugin(Plugin):
    def on_enable(self):
        plugin_id = 1234  # <-- Replace with the id of your plugin!
        self._metrics = Metrics(self, plugin_id)

    def on_disable(self):
        self._metrics.shutdown()
```

After adding bStats to your plugin you have to [create an account](https://bstats.org/register) to register your plugin.
You can manage your plugins with this account, e.g. adding customs graphs, etc.

## Add custom charts

Adding charts to your plugin consists of two parts:

- Adding charts to your code
- Adding charts on the website

To add a chart on the website, check the [detailed instructions here](https://bstats.org/help/custom-charts).

A **Simple Pie** is the most basic chart type. It's a great option for config settings as it only accepts one value per
server. Adding the chart to your code is fairly easy:

```python
from endstone.plugin import Plugin
from endstone_bstats import Metrics, SimplePie


class ExamplePlugin(Plugin):
    def on_enable(self):
        plugin_id = 1234  # <-- Replace with the id of your plugin!
        self._metrics = Metrics(self, plugin_id)
        self._metrics.add_custom_chart(
            SimplePie("used_language", lambda: "en_US")
        )

    def on_disable(self):
        self._metrics.shutdown()
```

## Contributing

We welcome contributions! Feel free to open an issue or submit a pull request to improve the library.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Acknowledgments

This library is inspired by [bStats for Java](https://bstats.org/), ported by the EndstoneMC team to Python.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "endstone-bstats",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "bstats, endstone, metrics, minecraft",
    "author": null,
    "author_email": "Vincent Wu <magicdroidx@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/90/0e/9cb6ab7d083341301d222acb8c229ae14f763047f104be825e53bb3647c7/endstone_bstats-0.1.0.tar.gz",
    "platform": null,
    "description": "# endstone-bstats\n\n`endstone-bstats` is a Python library that provides functionality for integrating bStats metrics into your Endstone\nplugins. It is designed to be simple, extensible, and lightweight.\n\n## Features\n\n- Supports various types of charts, including:\n    - Simple Pie\n    - Advanced Pie\n    - Drilldown Pie\n    - Single Line\n    - Multi Line\n    - Simple Bar\n    - Advanced Bar\n- Easy-to-use APIs for collecting and sending metric data.\n- Designed for flexibility and extensibility.\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install endstone-bstats\n```\n\n## Quick start\n\n[bStats](https://bstats.org/getting-started) is a free and open source website that helps you to collect usage data for\nyour plugin. Integrating bStats into your plugin is straight forward and done in a matter of seconds.\n\nHere\u2019s a simple example of how to add bStats to your plugin.\n\n```python\nfrom endstone.plugin import Plugin\nfrom endstone_bstats import Metrics\n\n\nclass ExamplePlugin(Plugin):\n    def on_enable(self):\n        plugin_id = 1234  # <-- Replace with the id of your plugin!\n        self._metrics = Metrics(self, plugin_id)\n\n    def on_disable(self):\n        self._metrics.shutdown()\n```\n\nAfter adding bStats to your plugin you have to [create an account](https://bstats.org/register) to register your plugin.\nYou can manage your plugins with this account, e.g. adding customs graphs, etc.\n\n## Add custom charts\n\nAdding charts to your plugin consists of two parts:\n\n- Adding charts to your code\n- Adding charts on the website\n\nTo add a chart on the website, check the [detailed instructions here](https://bstats.org/help/custom-charts).\n\nA **Simple Pie** is the most basic chart type. It's a great option for config settings as it only accepts one value per\nserver. Adding the chart to your code is fairly easy:\n\n```python\nfrom endstone.plugin import Plugin\nfrom endstone_bstats import Metrics, SimplePie\n\n\nclass ExamplePlugin(Plugin):\n    def on_enable(self):\n        plugin_id = 1234  # <-- Replace with the id of your plugin!\n        self._metrics = Metrics(self, plugin_id)\n        self._metrics.add_custom_chart(\n            SimplePie(\"used_language\", lambda: \"en_US\")\n        )\n\n    def on_disable(self):\n        self._metrics.shutdown()\n```\n\n## Contributing\n\nWe welcome contributions! Feel free to open an issue or submit a pull request to improve the library.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\nThis library is inspired by [bStats for Java](https://bstats.org/), ported by the EndstoneMC team to Python.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "bStats Metrics for Endstone Plugins",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [
        "bstats",
        " endstone",
        " metrics",
        " minecraft"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "94106b75d9a0b485aeae5891dc0e9e6a7027f384702bffe4f99271ff180c46a5",
                "md5": "8652758c225614e7642234c35eea3a86",
                "sha256": "97b42d1f7b0580c46333bc33d8c24ae350f30ce3dbe0964c5189bb9f88250325"
            },
            "downloads": -1,
            "filename": "endstone_bstats-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8652758c225614e7642234c35eea3a86",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 14276,
            "upload_time": "2024-12-03T16:39:00",
            "upload_time_iso_8601": "2024-12-03T16:39:00.169817Z",
            "url": "https://files.pythonhosted.org/packages/94/10/6b75d9a0b485aeae5891dc0e9e6a7027f384702bffe4f99271ff180c46a5/endstone_bstats-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "900e9cb6ab7d083341301d222acb8c229ae14f763047f104be825e53bb3647c7",
                "md5": "f5f7091d57c57ee4cd8c4acb8773edc1",
                "sha256": "4743a934c7990e8c66872d7267806e0b1fcb889aeabac21830bc02aa357a7e6b"
            },
            "downloads": -1,
            "filename": "endstone_bstats-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f5f7091d57c57ee4cd8c4acb8773edc1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 13842,
            "upload_time": "2024-12-03T16:39:01",
            "upload_time_iso_8601": "2024-12-03T16:39:01.466142Z",
            "url": "https://files.pythonhosted.org/packages/90/0e/9cb6ab7d083341301d222acb8c229ae14f763047f104be825e53bb3647c7/endstone_bstats-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-03 16:39:01",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "endstone-bstats"
}
        
Elapsed time: 0.37950s