pfp-lgbt

Python API Wrapper for https://pfp.lgbt/


License
MIT
Install
pip install pfp-lgbt==1.0.0

Documentation

pfp_lgbt.py

Master Codacy Badge

Asynchronous Python API Wrapper for https://pfp.lgbt/ Respects rate limits.

Installing

To install the library you can run the following command

pip3 install pfp_lgbt

Documentation

You can find the documentation on this repo's wiki.

Examples

List the names of all available flags.

import pfp_lgbt

async def example():
  client = pfp_lgbt.Client() 
  flags = await client.flags() 
  for flag in flags:
    print(flag.name)
  await client.close()

Create a static image from URL, and manually save the bytes as file

import pfp_lgbt 

async def example():
  client = pfp_lgbt.Client() 
  flag = pfp_lgbt.Flag(name='nb') # Non-binary flag
  
  # `Result` becomes bytes of result image
  result = await client.imageStatic('https://i.imgur.com/Ypw5pca.png', 'square', 'solid', flag)
  
  with open('result.png', 'wb') as resfile:
    resfile.write(result)
  
  await client.close()

Create animated image from URL, and save it to output file

import pfp_lgbt 

async def example():
  client = pfp_lgbt.Client() 
  flag = pfp_lgbt.Flag(name='nb') # Non-binary flag
  _ = await client.imageAnimated('https://i.imgur.com/Ypw5pca.png', 'square', flag, output_file='output.gif')
  client = await client.close()