Asynchronous Python wrapper for Fortnite-API.com.
Project description
FortniteAPIAsync
Python wrapper for Fortnite-API.
Installing:
Windows: py -3 -m pip install FortniteAPIAsync
Linux/macOS: python3 -m pip install FortniteAPIAsync
Examples:
import FortniteAPIAsync
import asyncio
async def fnapi_search() -> None:
result = await FortniteAPIAsync.get_cosmetic(
lang="en",
searchLang="en",
matchMethod="full",
name="Ghoul Trooper"
)
print(result.id)
loop = asyncio.get_event_loop()
loop.run_until_complete(fnapi_search())
loop.close()
This would output:
CID_029_Athena_Commando_F_Halloween
fortnitepy example:
import fortnitepy
import FortniteAPIAsync
from fortnitepy.ext import commands
bot = commands.Bot(
command_prefix='!',
auth=fortnitepy.AuthorizationCodeAuth(
code=input('Enter authorization code: ')
)
)
@bot.command()
async def skin(ctx: fortnitepy.ext.commands.Context, *, content: str) -> None:
try:
cosmetic = await FortniteAPIAsync.get_cosmetic(
matchMethod="contains",
name=content,
backendType="AthenaCharacter"
)
await ctx.send(f'Skin set to {cosmetic.id}.')
print(f"Set skin to: {cosmetic.id}.")
await client.party.me.set_outfit(asset=cosmetic.id)
except FortniteAPIAsync.exceptions.NotFound:
await ctx.send(f"Failed to find a skin with the name: {content}.")
print(f"Failed to find a skin with the name: {content}.")
bot.run()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
FortniteAPIAsync-0.1.6.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for FortniteAPIAsync-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 639288e81672d502edf26c9e4851e1e57708322dc611abebe3144a313d718345 |
|
MD5 | 355e3a35af5dda508cc3d2c9bca823d3 |
|
BLAKE2b-256 | 66d3e1124bf7c09998b1a5b97f524d404c44353b75d8ac90935b7ad722285c82 |