A Python wrapper for the Fantasy Premier League API

https://travis-ci.org/amosbastian/fpl.svg?branch=master https://badge.fury.io/py/fpl.svg https://img.shields.io/badge/Python-3.6%2B-blue.svg https://pepy.tech/badge/fpl

Note

The latest version of fpl is asynchronous, and requires Python 3.6+!

If you’re interested in helping out the development of fpl, or have suggestions and ideas then please don’t hesitate to create an issue on GitHub, join our Discord server or send an email to amosbastian@gmail.com!


A simple example:

import aiohttp
import asyncio
from fpl import FPL
async def main():
    async with aiohttp.ClientSession() as session:
        fpl = FPL(session)
        player = await fpl.get_player(302)
    print(player)
...
# Python 3.7+
asyncio.run(main())
...
# Python 3.6
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Fernandes - Midfielder - Man Utd

With fpl you can easily use the Fantasy Premier League API in all your Python scripts, exactly how you expect it to work.

Note

If you are using fpl in an environment such as a Jupyter notebook, then you might need to use nest_asyncio instead of asyncio.

The User Guide

This part of the documentation is mostly an introduction on how to use fpl and install it - including information for people newer to asyncio.

The Class Documentation / Guide

This part of the documentation is for people who want or need more information bout specific functions and classes found in fpl.

The Contributor Guide

If you want to help fpl out and contribute to the project, be it via development, suggestions, hunting bugs etc. then this part of the documentation is for you!