Skip to content

v3.0 Wrapper Rewrite

Latest
Compare
Choose a tag to compare
@Luc1412 Luc1412 released this 30 Aug 14:01
· 78 commits to master since this release

This release encompasses the Version 3.0 bump of the Fortnite API Python wrapper. This major transition gives the library a complete facelift, focusing on asynchronous functionality while still supporting the synchronous library you've come to know.

Features and Additions

  • Complete overhaul of every object, method, and property in the library. Now, fetching information from the API is done through methods on a Client and SyncClient class. This is to make the library easier to use and maintain, while still being welcoming for new programmers.
  • Complete overhaul of documentation. This includes a major shift to readthedocs powered by Sphinx for easier documentation.
  • Speed improvements for large endpoints, such as fetching all available game cosmetics at once.
  • Strictly type hinted with high code standards.

Migration & Getting started

Version 3.0 introduces breaking changes, so existing projects will need updates. To assist you, we've created a migration guide, to help make the transition as smooth as possible.

For new users, the new documentation provides everything you need to get started. Visit it at https://fortnite-api.readthedocs.io/.

Here's a quick example of how the new Client works:

import asyncio
import fortnite_api 

async def main() -> None:
    async with fortnite_api.Client() as client:
        all_cosmetics: fortnite_api.CosmeticsAll = await client.fetch_cosmetics_all()

        for br_cosmetic in all_cosmetics.br:
            print(br_cosmetic.name) 

if __name__ == "__main__":
    asyncio.run(main())