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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file FortniteAPIAsync-0.1.1.tar.gz.
File metadata
- Download URL: FortniteAPIAsync-0.1.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efc0ee156e0515b67ba3d7386157717602cfc618a37ca0cdcad3b9a3a4feba93
|
|
| MD5 |
dda7a70c154dcccf527c43235a7991e7
|
|
| BLAKE2b-256 |
09616d0c676040f72e3e9787402dd8633ed45d06250b174facf9acfd459a037a
|
File details
Details for the file FortniteAPIAsync-0.1.1-py3-none-any.whl.
File metadata
- Download URL: FortniteAPIAsync-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3cc78e809caf0fafc1ddd39a721a87cd813a48ef91d0be79ccb42f63e339068
|
|
| MD5 |
61d19796126dd7c835fce78a0f0b2c33
|
|
| BLAKE2b-256 |
0fd80178dc1b940a126c4156946e1d5340370a53a02a46c6b31c3597a9edf2f6
|