Skip to main content

Disstat

Disstat is a Python package for computing dissimilarity statistics for wrapping the Disstat API.

Installation

Use the package manager pip to install disstat.

pip install disstat

Usage

from discord import Intents, Interaction
from discord.ext import commands
from disstat import DisstatClient


class Bot(commands.Bot):
    def __init__(self):
        super().__init__(command_prefix="!", intents=Intents.default())
        self.disstat = DisstatClient(self, "DISSTAT API KEY HERE")

    async def on_ready(self):
        await self.disstat.start_auto_post()

    async def on_command_completion(
        self, ctx: commands.Context
    ):  # For using prefix commands
        await self.disstat.post_command(
            ctx.command.name,
            invoker_id=ctx.user.id,
            guild_id=(ctx.guild.id if ctx.guild else None),
        )

    async def on_app_command_completion(
        self, interaction: Interaction
    ):  # For using slash commands
        await self.disstat.post_command(
            interaction.command.name,
            invoker_id=interaction.user.id,
            guild_id=(interaction.guild.id if interaction.guild else None),
        )

    async def on_disstat_post(self, payload):
        print("Posted stats to Disstat.")

    async def on_disstat_post_command(self, payload):
        print(f"Posted command {payload['command']} to Disstat.")


bot = Bot()

bot.run("TOKEN")

Metadata

Release files for disstat 1.0.3

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

Source distribution (sdist)

Source distribution for disstat 1.0.3
File Size Uploaded Provenance
disstat-1.0.3.tar.gz 4.3 kB Without provenance Details

Release files / disstat-1.0.3.tar.gz

Download URL disstat-1.0.3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a0561ad1b0b3e5c97ee8468e61c295a1c0a155e902abbdd59f9f6a5caaeb3312
BLAKE2b-256 checksum
How to use checksums
871ee36ac9e3e4497e439adaad328e289bdab39a7b17f73147eab0571a8678ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for disstat 1.0.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file No provenance

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