Skip to content

Commit

Permalink
Updating to v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kile committed May 4, 2021
1 parent 8657cd5 commit 1d95d5c
Show file tree
Hide file tree
Showing 7 changed files with 328 additions and 51 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Just use `pip3 install pypxl` to install it

# How to use it
```py
from pypxl import Pxlapi
from pypxl import PxlClient
#Define yout details here
pxl = Pxlapi(token="Your pxlapi token", stop_on_error=False)
pxl = PxlClient(token="Your pxlapi token", stop_on_error=False)
```

Now you can use a all pxlapi features with just one line of code!
Expand All @@ -17,9 +17,9 @@ glitch = await pxl.glitch(images=["https://cdn.discordapp.com/avatars/6061626611
```

# Docs
I have not written any documentation. Generally every enpoint has a function with the same name and the same parameters as the enpoint along with the same default values. For an example in a discord bot, please click [here](https://github.com/Kile/pypxl/blob/main/examples/glitch_discord.markdown)
There is no website offering documentation, however if you hover over a function in your IDE it will give you some info about what it does, you can also just read the source code. For an example in a discord bot, please click [here](https://github.com/Kile/pypxl/blob/main/examples/glitch_discord.markdown)

I have implemented all functions this library offers in commands in my bot. You can find all those commands [here](https://github.com/Kile/Killua/blob/main/killua/cogs/pxlapi.py)
I have implemented most functions this library offers in commands in my bot. You can find those commands [here](https://github.com/Kile/Killua/blob/main/killua/cogs/pxlapi.py)

For questions and suggestions, join my discord server or dm me (`Kile#0606`)

Expand Down
14 changes: 8 additions & 6 deletions examples/glitch_discord.markdown
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
This would be an example for a small bot command

```py
from pypxl import Pxlapi
from pypxl import PxlClient
import discord
from discord.ext import commands
import io

bot = commands.Bot(command_prefix= commands.when_mentioned_or('pxl.'), description="Testing pxlapi wrapper", case_insensitive=True)

pxl = Pxlapi(token="pxlapi-token", stop_on_error=False)
pxl = PxlClient(token="pxlapi-token", stop_on_error=False)

@bot.command()
async def glitch(ctx, url:str):
data = await pxl.glitch(images=[url])
if isinstance(data, str):
return await ctx.send(':x: '+data)
f = discord.File(io.BytesIO(data), filename="test.gif")
await ctx.send(file=f)

if data.success:
f = discord.File(io.BytesIO(data), filename=f"glitch.{r.file_type}")
await ctx.send(file=f)
else:
await ctx.send(":x: " + data.error)


bot.run("bot-token")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[tool.poetry]
name = "pypxl"
version = "0.1.8"
version = "0.2.0"
description = "An Asynchronos API wrapper for https://pxlapi.dev"
license = "MIT"
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions pypxl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
__author__ = "Kile"
__license__ = "MIT"
__copyright__ = "Copyright 2021 Kile"
__version__ = "0.1.8"
__version__ = "0.2.0"

from .client import Pxlapi
from .client import PxlClient
Loading

0 comments on commit 1d95d5c

Please sign in to comment.