disstat


Namedisstat JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/TheUntraceable/disstat
SummaryA Python wrapper for the DisStat API.
upload_time2023-12-23 11:06:32
maintainer
docs_urlNone
authorYour Name
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Disstat

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

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install disstat.

```bash
pip install disstat
```

## Usage

```python
from disstat import DisstatClient
from discord.ext import commands

disstat = DisstatClient(bot, "DISSTAT API KEY HERE")

class Bot(commands.Bot):
    def __init__(self):
        super().__init__(command_prefix="!")
        self.disstat = disstat

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

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

    async def on_app_command_completion(self, interaction):  # For using slash commands
        await self.disstat.post_command(interaction.command.name, interaction.user.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")

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TheUntraceable/disstat",
    "name": "disstat",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Your Name",
    "author_email": "TheUntraceable@The-Untraceable.xz",
    "download_url": "https://files.pythonhosted.org/packages/4a/03/27f584f5b235c78917f1e855a35c7839c4d9affab7c91088c59f8665ace3/disstat-1.0.1.tar.gz",
    "platform": null,
    "description": "# Disstat\r\n\r\nDisstat is a Python package for computing dissimilarity statistics for wrapping the Disstat API.\r\n\r\n## Installation\r\n\r\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install disstat.\r\n\r\n```bash\r\npip install disstat\r\n```\r\n\r\n## Usage\r\n\r\n```python\r\nfrom disstat import DisstatClient\r\nfrom discord.ext import commands\r\n\r\ndisstat = DisstatClient(bot, \"DISSTAT API KEY HERE\")\r\n\r\nclass Bot(commands.Bot):\r\n    def __init__(self):\r\n        super().__init__(command_prefix=\"!\")\r\n        self.disstat = disstat\r\n\r\n    async def on_ready(self):\r\n        await self.disstat.start_auto_post()\r\n\r\n    async def on_command_completion(self, ctx):  # For using prefix commands\r\n        await self.disstat.post_command(ctx.command.name, ctx.user.id, (ctx.guild.id if ctx.guild else None))\r\n\r\n    async def on_app_command_completion(self, interaction):  # For using slash commands\r\n        await self.disstat.post_command(interaction.command.name, interaction.user.id, (interaction.guild.id if interaction.guild else None))\r\n\r\n    async def on_disstat_post(self, payload):\r\n        print(\"Posted stats to Disstat.\")\r\n\r\n    async def on_disstat_post_command(self, payload):\r\n        print(f\"Posted command {payload['command']} to Disstat.\")\r\n\r\nbot = Bot()\r\n\r\nbot.run(\"TOKEN\")\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A Python wrapper for the DisStat API.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/TheUntraceable/disstat"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4a0327f584f5b235c78917f1e855a35c7839c4d9affab7c91088c59f8665ace3",
                "md5": "7bde683eee45304d33175367068d8dca",
                "sha256": "ef32bad3ec5174352408f5935c35fbfabdfa23bf0626409491083a7f9468d0b2"
            },
            "downloads": -1,
            "filename": "disstat-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7bde683eee45304d33175367068d8dca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3481,
            "upload_time": "2023-12-23T11:06:32",
            "upload_time_iso_8601": "2023-12-23T11:06:32.394360Z",
            "url": "https://files.pythonhosted.org/packages/4a/03/27f584f5b235c78917f1e855a35c7839c4d9affab7c91088c59f8665ace3/disstat-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-23 11:06:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TheUntraceable",
    "github_project": "disstat",
    "github_not_found": true,
    "lcname": "disstat"
}
        
Elapsed time: 0.19442s