bStats Metrics for Endstone Plugins
Project description
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:
pip install endstone-bstats
Quick start
bStats 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.
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 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.
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:
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 file for details.
Acknowledgments
This library is inspired by bStats for Java, ported by the EndstoneMC team to Python.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file endstone_bstats-0.1.0.tar.gz.
File metadata
- Download URL: endstone_bstats-0.1.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4743a934c7990e8c66872d7267806e0b1fcb889aeabac21830bc02aa357a7e6b
|
|
| MD5 |
f5f7091d57c57ee4cd8c4acb8773edc1
|
|
| BLAKE2b-256 |
900e9cb6ab7d083341301d222acb8c229ae14f763047f104be825e53bb3647c7
|
Provenance
The following attestation bundles were made for endstone_bstats-0.1.0.tar.gz:
Publisher:
cd.yml on EndstoneMC/bstats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
endstone_bstats-0.1.0.tar.gz -
Subject digest:
4743a934c7990e8c66872d7267806e0b1fcb889aeabac21830bc02aa357a7e6b - Sigstore transparency entry: 153108047
- Sigstore integration time:
-
Permalink:
EndstoneMC/bstats@e559bb1f30e2d0635eef9453a80ffb047d432f0b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/EndstoneMC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@e559bb1f30e2d0635eef9453a80ffb047d432f0b -
Trigger Event:
release
-
Statement type:
File details
Details for the file endstone_bstats-0.1.0-py3-none-any.whl.
File metadata
- Download URL: endstone_bstats-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97b42d1f7b0580c46333bc33d8c24ae350f30ce3dbe0964c5189bb9f88250325
|
|
| MD5 |
8652758c225614e7642234c35eea3a86
|
|
| BLAKE2b-256 |
94106b75d9a0b485aeae5891dc0e9e6a7027f384702bffe4f99271ff180c46a5
|
Provenance
The following attestation bundles were made for endstone_bstats-0.1.0-py3-none-any.whl:
Publisher:
cd.yml on EndstoneMC/bstats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
endstone_bstats-0.1.0-py3-none-any.whl -
Subject digest:
97b42d1f7b0580c46333bc33d8c24ae350f30ce3dbe0964c5189bb9f88250325 - Sigstore transparency entry: 153108048
- Sigstore integration time:
-
Permalink:
EndstoneMC/bstats@e559bb1f30e2d0635eef9453a80ffb047d432f0b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/EndstoneMC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@e559bb1f30e2d0635eef9453a80ffb047d432f0b -
Trigger Event:
release
-
Statement type: