{ "info": { "author": "Assanali Mukhanov, top.gg", "author_email": "shivaco.osu@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "DBL Python Library\n==================\n.. image:: https://img.shields.io/pypi/v/dblpy.svg\n :target: https://pypi.python.org/pypi/dblpy\n :alt: View on PyPi\n.. image:: https://img.shields.io/pypi/pyversions/dblpy.svg\n :target: https://pypi.python.org/pypi/dblpy\n :alt: v0.3.3\n.. image:: https://readthedocs.org/projects/dblpy/badge/?version=latest\n :target: https://dblpy.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\nA simple API wrapper for `top.gg`_ written in Python\n\nInstallation\n------------\n\nInstall via pip (recommended)\n\n.. code:: bash\n\n pip install dblpy\n\nInstall from source\n\n.. code:: bash\n\n pip install git+https://github.com/DiscordBotList/DBL-Python-Library\n\nDocumentation\n-------------\n\nDocumentation can be found `here`_\n\nFeatures\n--------\n\n* POST server count\n* GET bot info, server count, upvote info\n* GET all bots\n* GET user info\n* GET widgets (large and small) including custom ones. See `top.gg/api/docs`_ for more info.\n* GET weekend status\n* Built-in webhook to help you handle DBL upvotes\n* Automated server count posting\n* Searching for bots via the API\n\nAdditional information\n----------------------\n\n* Before using the webhook provided by this library, make sure that you have specified port open.\n* ``webhook_port`` must be greater between 1024 and 49151.\n\nExamples\n--------\n\nWithout webhook:\n\n.. code:: py\n\n import dbl\n import discord\n from discord.ext import commands, tasks\n\n import asyncio\n import logging\n\n\n class TopGG(commands.Cog):\n \"\"\"Handles interactions with the top.gg API\"\"\"\n\n def __init__(self, bot):\n self.bot = bot\n self.token = 'dbl_token' # set this to your DBL token\n self.dblpy = dbl.DBLClient(self.bot, self.token)\n\n # The decorator below will work only on discord.py 1.1.0+\n # In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats())\n\n @tasks.loop(minutes=30.0)\n async def update_stats(self):\n \"\"\"This function runs every 30 minutes to automatically update your server count\"\"\"\n logger.info('Attempting to post server count')\n try:\n await self.dblpy.post_guild_count()\n logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))\n except Exception as e:\n logger.exception('Failed to post server count\\n{}: {}'.format(type(e).__name__, e))\n\n # if you are not using the tasks extension, put the line below\n\n await asyncio.sleep(1800)\n\n def setup(bot):\n global logger\n logger = logging.getLogger('bot')\n bot.add_cog(TopGG(bot))\n\nWith webhook:\n\n.. code:: py\n\n import dbl\n import discord\n from discord.ext import commands, tasks\n\n import asyncio\n import logging\n\n\n class TopGG(commands.Cog):\n \"\"\"Handles interactions with the top.gg API\"\"\"\n\n def __init__(self, bot):\n self.bot = bot\n self.token = 'dbl_token' # set this to your DBL token\n self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)\n\n # The decorator below will work only on discord.py 1.1.0+\n # In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats())\n\n @tasks.loop(minutes=30.0)\n async def update_stats(self):\n \"\"\"This function runs every 30 minutes to automatically update your server count\"\"\"\n logger.info('Attempting to post server count')\n try:\n await self.dblpy.post_guild_count()\n logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))\n except Exception as e:\n logger.exception('Failed to post server count\\n{}: {}'.format(type(e).__name__, e))\n\n # if you are not using the tasks extension, put the line below\n\n await asyncio.sleep(1800)\n\n @commands.Cog.listener()\n async def on_dbl_vote(self, data):\n logger.info('Received an upvote')\n print(data)\n\n def setup(bot):\n global logger\n logger = logging.getLogger('bot')\n bot.add_cog(TopGG(bot))\n\nWith autopost:\n\n.. code:: py\n\n import dbl\n import discord\n from discord.ext import commands\n\n\n class TopGG(commands.Cog):\n \"\"\"Handles interactions with the top.gg API\"\"\"\n\n def __init__(self, bot):\n self.bot = bot\n self.token = 'dbl_token' # set this to your DBL token\n self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) # Autopost will post your guild count every 30 minutes\n\n async def on_guild_post():\n print(\"Server count posted successfully\")\n\n def setup(bot):\n bot.add_cog(TopGG(bot))\n\n.. _top.gg: https://top.gg/\n.. _top.gg/api/docs: https://top.gg/api/docs\n.. _here: https://dblpy.rtfd.io", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DiscordBotList/DBL-Python-Library", "keywords": "discord bot list discordbots botlist", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "dblpy", "package_url": "https://pypi.org/project/dblpy/", "platform": "", "project_url": "https://pypi.org/project/dblpy/", "project_urls": { "Homepage": "https://github.com/DiscordBotList/DBL-Python-Library" }, "release_url": "https://pypi.org/project/dblpy/0.3.3/", "requires_dist": null, "requires_python": ">= 3.5.3", "summary": "A simple API wrapper for top.gg written in Python", "version": "0.3.3" }, "last_serial": 5925360, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "abf213699cc7b54cfd4cce5b8e0ffaf6", "sha256": "b90d0c6089fe68fd4927f80f346748a89d07075db335fd99bb59445827d6e3ba" }, "downloads": -1, "filename": "dblpy-0.1.2.tar.gz", "has_sig": true, "md5_digest": "abf213699cc7b54cfd4cce5b8e0ffaf6", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 7520, "upload_time": "2018-02-06T20:11:32", "url": "https://files.pythonhosted.org/packages/66/ba/4d41b11b4862c3d85eb820abe69a3eed8e614b905c88412d531fcc6b2a48/dblpy-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "83e29e2503a06d141633ccceee31099d", "sha256": "79e8db542cd301dd99575d00fd84da58f4f38838ef321536f6a097694ea13173" }, "downloads": -1, "filename": "dblpy-0.1.3.tar.gz", "has_sig": true, "md5_digest": "83e29e2503a06d141633ccceee31099d", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 7756, "upload_time": "2018-02-10T09:07:16", "url": "https://files.pythonhosted.org/packages/f9/a6/75b1a35d9a0b570383cfbdc4801cd1d076f71b78e250e5c8635932337adb/dblpy-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "a6f1faa74b699b2b04e5fd418616077b", "sha256": "c13ba9aa5a479f77241adffa5eb91a3422ff5f884f6507fed101e2f2c52a6a84" }, "downloads": -1, "filename": "dblpy-0.1.4.tar.gz", "has_sig": true, "md5_digest": "a6f1faa74b699b2b04e5fd418616077b", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 9336, "upload_time": "2018-02-19T22:32:38", "url": "https://files.pythonhosted.org/packages/58/a0/60b59b31a2fac1990bc6e20fc3b1924abe3b3f173d20ddf4abae4bd5fd98/dblpy-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c5457fd8e1fc1f438224091514fecfa3", "sha256": "6fe0c3ca6fab9d9b19f23b6fc2bd10afda6852e64ac4734c111b9cebe658c1fc" }, "downloads": -1, "filename": "dblpy-0.1.5.tar.gz", "has_sig": true, "md5_digest": "c5457fd8e1fc1f438224091514fecfa3", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 9431, "upload_time": "2018-02-22T14:23:55", "url": "https://files.pythonhosted.org/packages/c7/e5/d09da93b5b3fd136be529b35a9feab95403075be43604f45f00965cfd47d/dblpy-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "d80ab0eaa1670b645f74e14118c6ade4", "sha256": "86594866ff9200b3a842f509ab38e42aaf954ddc893dd5c55c5b1f614fdff20f" }, "downloads": -1, "filename": "dblpy-0.1.6.tar.gz", "has_sig": true, "md5_digest": "d80ab0eaa1670b645f74e14118c6ade4", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 10250, "upload_time": "2018-03-13T18:44:19", "url": "https://files.pythonhosted.org/packages/aa/2e/d136bd593a1fe545d6e82c9317169beef2729ecb2878352c58cd8f7b374f/dblpy-0.1.6.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f0b1c3b295b96bc8825920a1cbbfb258", "sha256": "0b44dd264e3feca21d81002a9e9a5ea0655237478e8d654361d659b8581e5bdc" }, "downloads": -1, "filename": "dblpy-0.2.tar.gz", "has_sig": false, "md5_digest": "f0b1c3b295b96bc8825920a1cbbfb258", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 9018, "upload_time": "2019-04-23T18:34:51", "url": "https://files.pythonhosted.org/packages/b4/0d/ed36f7e3c14b33ce2d4ed50d957e45d00c5e96fb3456d1cf59a53d6fc8c2/dblpy-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0a566b02dcd08806330ff938a31c3562", "sha256": "030e69fef5eae6293a8f8ef5a9d9542ab65081743d53a8ebfa95a6ab5b7507cb" }, "downloads": -1, "filename": "dblpython-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0a566b02dcd08806330ff938a31c3562", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 9198, "upload_time": "2019-04-30T22:12:16", "url": "https://files.pythonhosted.org/packages/3a/1e/a0d4a174d687bbd6750f6f81bf45312f4867c27e9ac46f26cb7ecd8f26e0/dblpython-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "b9d579719c7a3612cf254cdd24ef8232", "sha256": "75f792b25017a625b32d4b94f21a7849389ef7d1e74c24fb08e0abe7dee2e7ff" }, "downloads": -1, "filename": "dblpy-0.3.0.tar.gz", "has_sig": false, "md5_digest": "b9d579719c7a3612cf254cdd24ef8232", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5.3", "size": 9341, "upload_time": "2019-05-18T18:52:45", "url": "https://files.pythonhosted.org/packages/34/b4/d4fcd3f8111dff2ba5cb24379d58452451bd08583c5480295f3a92411282/dblpy-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "c12f14196193111973bf9c63061ef92b", "sha256": "5fda69c016092a63c156e82bb2e211270a8a37d3857bf1d0ff6124ec634abae5" }, "downloads": -1, "filename": "dblpy-0.3.1.tar.gz", "has_sig": false, "md5_digest": "c12f14196193111973bf9c63061ef92b", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5.3", "size": 9525, "upload_time": "2019-05-28T20:16:43", "url": "https://files.pythonhosted.org/packages/1b/ea/3239841a8c12a6bd6b3da4e5458c0993ec089b0711ddc6759a987577a3f9/dblpy-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "13c99abbe77e2a20d2eee5aae9c93901", "sha256": "761445a87a20c09a22c4adf3a0e3a31076fd0fef857d8fe12d63dd526912a98a" }, "downloads": -1, "filename": "dblpy-0.3.2.tar.gz", "has_sig": false, "md5_digest": "13c99abbe77e2a20d2eee5aae9c93901", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5.3", "size": 9947, "upload_time": "2019-08-19T15:44:03", "url": "https://files.pythonhosted.org/packages/88/19/2b59bbeab33efd14245ee0d1f759ed9d2f68327bbdc3ab97a7543f0eb6dc/dblpy-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "bec238c9ad75393255dd5c5c71e10e54", "sha256": "ce6a0c61620b996a65b8a8680ba1ee126a7a9ab054924b0056feafeda72e190d" }, "downloads": -1, "filename": "dblpy-0.3.3.tar.gz", "has_sig": false, "md5_digest": "bec238c9ad75393255dd5c5c71e10e54", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5.3", "size": 9910, "upload_time": "2019-10-03T20:36:03", "url": "https://files.pythonhosted.org/packages/3e/f0/ece3ded830f501086901cfcae37a5c686f6a4210567f3a91135dd4692d59/dblpy-0.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bec238c9ad75393255dd5c5c71e10e54", "sha256": "ce6a0c61620b996a65b8a8680ba1ee126a7a9ab054924b0056feafeda72e190d" }, "downloads": -1, "filename": "dblpy-0.3.3.tar.gz", "has_sig": false, "md5_digest": "bec238c9ad75393255dd5c5c71e10e54", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5.3", "size": 9910, "upload_time": "2019-10-03T20:36:03", "url": "https://files.pythonhosted.org/packages/3e/f0/ece3ded830f501086901cfcae37a5c686f6a4210567f3a91135dd4692d59/dblpy-0.3.3.tar.gz" } ] }