# PaperTools
![](https://avatars.githubusercontent.com/u/159441854?s=200&v=4)
[![GPL](https://img.shields.io/github/license/paper-devs/papertools?color=2f2f2f)](https://github.com/paper-devs/papertools/blob/main/LICENSE) ![](https://img.shields.io/pypi/pyversions/papertools?color=2f2f2f) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
PaperTools is a module which offers tons of usefull features for [discord.py](https://github.com/Rapptz/discord.py) bots.
## Quick Links
- [PyPI Homepage](https://pypi.org/project/papertools/)
# Install
To install the library, you need the latest version of pip and minimum Python 3.9
> Stable version
```
pip install papertools
```
> Unstable version (this one gets more frequent changes)
```
pip install git+https://github.com/paper-devs/papertools
```
# Examples
In-depth examples are located in the [examples folder](https://github.com/paper-devs/papertools/tree/main/examples)
Here's a quick example:
```py
import papertools
import discord
converter = papertools.Converter()
timetools = papertools.TimeTools()
pg = papertools.paginator
class MyBot(commands.Bot):
def __init__(self) -> None:
super().__init__(command_prefix='!', intents=discord.Intents.all())
async def on_ready(self) -> None:
print("I'm online!")
class ExampleCog(commands.Cog):
def __init__(self, bot) -> None:
self.bot = bot
@commands.command()
async def test(self, ctx: commands.Context):
embeds = pg.embed_creator("Very long text"*10000, 1995, prefix='```\n', suffix='\n```')
paginator = pg.Paginator(bot, embeds, ctx, invoker=ctx.author.id)
paginator.default_pagination()
await paginator.start()
@commands.command()
async def fromsuffix(self, ctx: commands.Context, string: str) -> None:
fromsuffix_string = converter.fromsuffix(string)
await ctx.send(fromsuffix_string)
@commands.command()
async def tosuffix(self, ctx: commands.Context, number: int) -> None:
tosuffix_string = converter.fromsuffix(number)
await ctx.send(tosuffix_string)
@commands.command()
async def humanize_time(self, ctx: commands.Context, number: int, short: bool) -> None:
humanized_time = timetools.humanize(number, short)
await ctx.send(humanized_time)
bot = MyBot()
bot.run("token here")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/paper-devs/papertools",
"name": "papertools",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "python,discord.py,utilities",
"author": "aiokev",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/8d/ca/fc1a556cfd54e4634bdd52a13bb848404a1078abac4885500b69fb954dd4/papertools-0.2.4.tar.gz",
"platform": null,
"description": "# PaperTools\r\n\r\n![](https://avatars.githubusercontent.com/u/159441854?s=200&v=4)\r\n\r\n[![GPL](https://img.shields.io/github/license/paper-devs/papertools?color=2f2f2f)](https://github.com/paper-devs/papertools/blob/main/LICENSE) ![](https://img.shields.io/pypi/pyversions/papertools?color=2f2f2f) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\r\n\r\nPaperTools is a module which offers tons of usefull features for [discord.py](https://github.com/Rapptz/discord.py) bots.\r\n\r\n## Quick Links\r\n- [PyPI Homepage](https://pypi.org/project/papertools/)\r\n\r\n# Install\r\nTo install the library, you need the latest version of pip and minimum Python 3.9\r\n\r\n> Stable version\r\n```\r\npip install papertools\r\n```\r\n\r\n> Unstable version (this one gets more frequent changes)\r\n```\r\npip install git+https://github.com/paper-devs/papertools\r\n```\r\n\r\n# Examples\r\nIn-depth examples are located in the [examples folder](https://github.com/paper-devs/papertools/tree/main/examples)\r\n\r\nHere's a quick example:\r\n\r\n```py\r\nimport papertools\r\n\r\nimport discord\r\n\r\nconverter = papertools.Converter()\r\ntimetools = papertools.TimeTools()\r\npg = papertools.paginator\r\n\r\nclass MyBot(commands.Bot):\r\n\r\n def __init__(self) -> None:\r\n super().__init__(command_prefix='!', intents=discord.Intents.all())\r\n\r\n async def on_ready(self) -> None:\r\n print(\"I'm online!\")\r\n\r\n\r\nclass ExampleCog(commands.Cog):\r\n\r\n def __init__(self, bot) -> None:\r\n self.bot = bot\r\n\r\n @commands.command()\r\n async def test(self, ctx: commands.Context):\r\n embeds = pg.embed_creator(\"Very long text\"*10000, 1995, prefix='```\\n', suffix='\\n```')\r\n paginator = pg.Paginator(bot, embeds, ctx, invoker=ctx.author.id)\r\n paginator.default_pagination()\r\n await paginator.start()\r\n\r\n @commands.command()\r\n async def fromsuffix(self, ctx: commands.Context, string: str) -> None:\r\n fromsuffix_string = converter.fromsuffix(string)\r\n await ctx.send(fromsuffix_string)\r\n\r\n @commands.command()\r\n async def tosuffix(self, ctx: commands.Context, number: int) -> None:\r\n tosuffix_string = converter.fromsuffix(number)\r\n await ctx.send(tosuffix_string)\r\n\r\n @commands.command()\r\n async def humanize_time(self, ctx: commands.Context, number: int, short: bool) -> None:\r\n humanized_time = timetools.humanize(number, short)\r\n await ctx.send(humanized_time)\r\n\r\nbot = MyBot()\r\nbot.run(\"token here\")\r\n```\r\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "A module which offers tons of usefull features for discord.py bots.",
"version": "0.2.4",
"project_urls": {
"Homepage": "https://github.com/paper-devs/papertools"
},
"split_keywords": [
"python",
"discord.py",
"utilities"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "08d8ddc179a3fe753fda428f893e001ff15707085eef881501d9b541eb43280f",
"md5": "262f151b228f21476bbe592eca83e49c",
"sha256": "e550ba54942f5e82ba2fecd5787c800561e27010825642e14e2797ed663632ff"
},
"downloads": -1,
"filename": "papertools-0.2.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "262f151b228f21476bbe592eca83e49c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 21677,
"upload_time": "2024-02-12T21:15:33",
"upload_time_iso_8601": "2024-02-12T21:15:33.845539Z",
"url": "https://files.pythonhosted.org/packages/08/d8/ddc179a3fe753fda428f893e001ff15707085eef881501d9b541eb43280f/papertools-0.2.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8dcafc1a556cfd54e4634bdd52a13bb848404a1078abac4885500b69fb954dd4",
"md5": "42441885d1466cb344476704537d1c5f",
"sha256": "0a6b4a3a2922f8b236aad54f9b0e1b97bc31b4f3bad19afc2b12077014ccca44"
},
"downloads": -1,
"filename": "papertools-0.2.4.tar.gz",
"has_sig": false,
"md5_digest": "42441885d1466cb344476704537d1c5f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 22060,
"upload_time": "2024-02-12T21:15:35",
"upload_time_iso_8601": "2024-02-12T21:15:35.443644Z",
"url": "https://files.pythonhosted.org/packages/8d/ca/fc1a556cfd54e4634bdd52a13bb848404a1078abac4885500b69fb954dd4/papertools-0.2.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-12 21:15:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "paper-devs",
"github_project": "papertools",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "papertools"
}