A simple Python library to FOAAS.
- Author: Dimitris Dedousis
- Version: 1.0.0
- License: MIT
- The default URL used is: https://foaas.com/
- Every argument used in every method that makes a request to the REST API, must be followed by an underscore (ex. name_, from_, company_)
This package relies on requests and should be installed with pip:
pip install foaas
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
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.
$ python tests.py
...............
----------------------------------------------------------------------
Ran 15 tests in 17.537s
OK
... or use tox:
$ tox