Skip to main content

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.

Metadata

Release files for endstone-bstats 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for endstone-bstats 0.1.0
File Size Uploaded Provenance
endstone_bstats-0.1.0.tar.gz 13.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for endstone-bstats 0.1.0
File Interpreter ABI Platform
endstone_bstats-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / endstone_bstats-0.1.0.tar.gz

Download URL endstone_bstats-0.1.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4743a934c7990e8c66872d7267806e0b1fcb889aeabac21830bc02aa357a7e6b
BLAKE2b-256 checksum
How to use checksums
900e9cb6ab7d083341301d222acb8c229ae14f763047f104be825e53bb3647c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2024.

Transparency log

Release files / endstone_bstats-0.1.0-py3-none-any.whl

Download URL endstone_bstats-0.1.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97b42d1f7b0580c46333bc33d8c24ae350f30ce3dbe0964c5189bb9f88250325
BLAKE2b-256 checksum
How to use checksums
94106b75d9a0b485aeae5891dc0e9e6a7027f384702bffe4f99271ff180c46a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2024.

Transparency log

Security for endstone-bstats 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for endstone_bstats-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2024.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page