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
Built Distribution
File details
Details for the file FortniteAPIAsync-0.1.7.tar.gz
.
File metadata
- Download URL: FortniteAPIAsync-0.1.7.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5170219be8c74e73785f5b5bc6f0e36396bf639462be42648e7e1c448b3f91d |
|
MD5 | b091aa07883dc001a077a21bb51fe229 |
|
BLAKE2b-256 | bee4f8c443681414cab8c659d5ab412161535a405e70744518b7251ef3a76283 |
File details
Details for the file FortniteAPIAsync-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: FortniteAPIAsync-0.1.7-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84e867e18b32c74f4063260a83339787111b45dc3e5edcda59cdbdbbbcd960ee |
|
MD5 | ee83ce377f67b85baf7bf0f84603611c |
|
BLAKE2b-256 | 628136e8423d7d156d209e8b83708fbc0734a8b25b36ee48bcf597a8835c829d |