Skip to content

This is a simple wrapper for the Foaas framework in order to have a simple way to tell people to go fuck themselves

License

Notifications You must be signed in to change notification settings

DDimitris/foaas-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foaas-python

A simple Python library to FOAAS.

build status Coverage Status

Documentation

Important Notes

  1. The default URL used is: https://foaas.com/
  2. Every argument used in every method that makes a request to the REST API, must be followed by an underscore (ex. name_, from_, company_)

Installation

This package relies on requests and should be installed with pip:

pip install foaas

Basic Usage

Fuck off:

>>> from foaas.foaas_client import Fuck
>>> fuck = Fuck()
>>> print fuck.off(name_='Tom', from_='Chris').text
Fuck off, Tom. - Chris

Print in JSON format:

>>> fuck.that(from_='Chris').json
{u'message': u'Fuck that.', u'subtitle': u'- Chris'}

Print the URL:

>>> print fuck.everything(from_='Chris').url
https://foaas.com/everything/Chris

Print random responses:

>>> print fuck.random(from_='Chris').text
Fuck you very much. - Chris
>>> print fuck.random(from_='Chris').text
Fuck my life. - Chris
>>> print fuck.random(name_='Tom', from_='Chris').text
Fuck me gently with a chainsaw, Tom. Do I look like Mother Teresa? - Chris
>>> print fuck.random(name_='Tom', from_='Chris').text
Fuck off, Tom. - Chris

Set a custom URL:

>>> from foaas.foaas_client import Fuck
>>> fuck = Fuck(url="https://foaas.herokuapp.com/")
>>> fuck.that(from_="Dimitris").url
u'https://foaas.herokuapp.com/that/Dimitris'

Internationalization and localization support:

>>> from foaas.foaas_client import Fuck
>>> fuck = Fuck()
>>> print(fuck.that(from_="Dimitris", i18n_="es").text)
Joder que !!,., !! - Dimitris undefined

Shoutcloud support:

>>> from foaas.foaas_client import Fuck
>>> fuck = Fuck()
>>> print(fuck.that(from_="Dimitris", shoutcloud_=True).text)
FUCK THAT. - DIMITRIS

Supported Actions

All the supported actions are described in the https://foaas.com/ website. This package is able to be automatically up-to-date with every addition or removal of any action.

Testing

$ python tests.py
...............
----------------------------------------------------------------------
Ran 15 tests in 17.537s

OK

... or use tox:

$ tox

About

This is a simple wrapper for the Foaas framework in order to have a simple way to tell people to go fuck themselves

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%