beymax


Namebeymax JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://gitlab.graubert.com/agraubert/beymax
SummaryA high-level, functional programming wrapper to discord.py
upload_time2023-04-13 17:05:52
maintainer
docs_urlNone
authorAaron Graubert
requires_python
licenseMIT
keywords discord async asyncio sql sqlalchemy utilities
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Beymax API

A high-level, functional-focused wrapper to [discord.py](https://discordpy.readthedocs.io/en/stable/)

## About

This package started off as a personal discord bot, but as it grew in scope, I found the need to add my own utilities
on top of the wonderful [discord.py](https://discordpy.readthedocs.io/en/stable/) by GitHub user Rapptz.
Beymax aims to reduce the amount of boilerplate needed to create a functioning Discord bot, while also exposing
an API which is familiar to those used to writing event-driven code.

## Differences from discord.py

* Essentially _everything_ runs as an event listener. This includes tasks, commands, and context menus
	* Events now have 3 phases: For an event called `event`, subscribers to `before:event` are run first, then `event`, and finally `after:event`.
	* Events can be cancelled: Any listener to an event can call `event.cancel()` which will prevent any listeners in subsequent phases from being invoked.
	It does abort any listeners which have already ben called, such as other listeners to the current phase
* Client differences:
	* Events can be scheduled in the future with `Client.dispatch_future()`. This adds an entry to the database, so the scheduled event will persist through restarts.
	`.dispatch_future()` guarantees precision within at least 30s of the scheduled time.
	* Key-value storage: Reduces boilerplate for storing/retreiving arbitrary small data points. `Client.set_value()` and `Client.get_value()` can be used to
	store & retreive small strings from the database
	* Database migrations: `Client.migration()` allows schema migrations to be added in code. Migrations are called only the first time the bot starts up after
	a new migration is added.
	* Special message handlers: A small convenience layer over `Client.wait_for()`, `Client.add_special()` allows a coroutine to be invoked any time a message
	is received which meets user-defined criteria
	* Native database integration: Beymax natively supports [SQLAlchemy](https://www.sqlalchemy.org/) for interacting with databases in your bot.
* Cogs -> Suites: discord.py's concept of a `cog` is essentially the same as a Beymax `suite`. Suites group together a set of commands, context menus, event listeners, database tables, etc which logically relate to each other. Suites can define their own interdependencies, ensuring that if a suite is loaded by your bot, all of its dependencies are also loaded.
* UI Differences: discord.py's ui library follows an imperative style, where UI elements are defined in advance via subclassing. Beymax overrides this interface to provide a functionally-oriented style where UI elements are defined dynamically at runtime using function decorators.
* Argument parsing and command definition: Beymax mostly follows discord.py's style of defining command/context arguments via function annotations. Beymax extends this
by allowing all argument metadata to be set in the annotations, including parameter descriptions.


            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.graubert.com/agraubert/beymax",
    "name": "beymax",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "discord async asyncio sql sqlalchemy utilities",
    "author": "Aaron Graubert",
    "author_email": "aaron@graubert.com",
    "download_url": "https://files.pythonhosted.org/packages/65/df/9e715c0e9cb05c55088774a1b03c905b51fa6a69debee323ac9fe3c3d802/beymax-1.2.0.tar.gz",
    "platform": null,
    "description": "# Beymax API\n\nA high-level, functional-focused wrapper to [discord.py](https://discordpy.readthedocs.io/en/stable/)\n\n## About\n\nThis package started off as a personal discord bot, but as it grew in scope, I found the need to add my own utilities\non top of the wonderful [discord.py](https://discordpy.readthedocs.io/en/stable/) by GitHub user Rapptz.\nBeymax aims to reduce the amount of boilerplate needed to create a functioning Discord bot, while also exposing\nan API which is familiar to those used to writing event-driven code.\n\n## Differences from discord.py\n\n* Essentially _everything_ runs as an event listener. This includes tasks, commands, and context menus\n\t* Events now have 3 phases: For an event called `event`, subscribers to `before:event` are run first, then `event`, and finally `after:event`.\n\t* Events can be cancelled: Any listener to an event can call `event.cancel()` which will prevent any listeners in subsequent phases from being invoked.\n\tIt does abort any listeners which have already ben called, such as other listeners to the current phase\n* Client differences:\n\t* Events can be scheduled in the future with `Client.dispatch_future()`. This adds an entry to the database, so the scheduled event will persist through restarts.\n\t`.dispatch_future()` guarantees precision within at least 30s of the scheduled time.\n\t* Key-value storage: Reduces boilerplate for storing/retreiving arbitrary small data points. `Client.set_value()` and `Client.get_value()` can be used to\n\tstore & retreive small strings from the database\n\t* Database migrations: `Client.migration()` allows schema migrations to be added in code. Migrations are called only the first time the bot starts up after\n\ta new migration is added.\n\t* Special message handlers: A small convenience layer over `Client.wait_for()`, `Client.add_special()` allows a coroutine to be invoked any time a message\n\tis received which meets user-defined criteria\n\t* Native database integration: Beymax natively supports [SQLAlchemy](https://www.sqlalchemy.org/) for interacting with databases in your bot.\n* Cogs -> Suites: discord.py's concept of a `cog` is essentially the same as a Beymax `suite`. Suites group together a set of commands, context menus, event listeners, database tables, etc which logically relate to each other. Suites can define their own interdependencies, ensuring that if a suite is loaded by your bot, all of its dependencies are also loaded.\n* UI Differences: discord.py's ui library follows an imperative style, where UI elements are defined in advance via subclassing. Beymax overrides this interface to provide a functionally-oriented style where UI elements are defined dynamically at runtime using function decorators.\n* Argument parsing and command definition: Beymax mostly follows discord.py's style of defining command/context arguments via function annotations. Beymax extends this\nby allowing all argument metadata to be set in the annotations, including parameter descriptions.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A high-level, functional programming wrapper to discord.py",
    "version": "1.2.0",
    "split_keywords": [
        "discord",
        "async",
        "asyncio",
        "sql",
        "sqlalchemy",
        "utilities"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f798a7e6d51b210de225275175a09367e37d99121121f8b8d04447f397e10ae",
                "md5": "1f231028f3e36562ee66385ea9707699",
                "sha256": "f9181d05b8b0385fdff73a804fcefd2d71b9e78bf4b3a6267f7c8f72eadaa3cc"
            },
            "downloads": -1,
            "filename": "beymax-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1f231028f3e36562ee66385ea9707699",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 41011,
            "upload_time": "2023-04-13T17:05:50",
            "upload_time_iso_8601": "2023-04-13T17:05:50.639175Z",
            "url": "https://files.pythonhosted.org/packages/7f/79/8a7e6d51b210de225275175a09367e37d99121121f8b8d04447f397e10ae/beymax-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65df9e715c0e9cb05c55088774a1b03c905b51fa6a69debee323ac9fe3c3d802",
                "md5": "26242d414e6c56dd98799db9ac7d64ff",
                "sha256": "7e2a4b86947747027fd427bfdeb84bd70d6bbfc35e98e9de26dd6caefbb91ecc"
            },
            "downloads": -1,
            "filename": "beymax-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "26242d414e6c56dd98799db9ac7d64ff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38120,
            "upload_time": "2023-04-13T17:05:52",
            "upload_time_iso_8601": "2023-04-13T17:05:52.067461Z",
            "url": "https://files.pythonhosted.org/packages/65/df/9e715c0e9cb05c55088774a1b03c905b51fa6a69debee323ac9fe3c3d802/beymax-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-13 17:05:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "beymax"
}
        
Elapsed time: 0.05506s