StrawPy is a python wrapper for Strawpoll.
Table of Contents
You can get Pyhorizon using pip install:
pip install strawpy
Going here , downloading the zip file and running the setup file:
python setup.py install
You can get a response from an existing poll or create a new one using Strawpy.
Send a get request to the Strawpoll API based on a poll ID. Returns a StrawPoll class object.
poll = strawpy.get_poll('11682852')
Send a post request to the Strawpoll API based poll data parameters. Returns a StrawPoll class object.
new_poll = strawpy.create_poll('Is Python the best?', ['Yes', 'No'])
A strawpy.StrawPoll class is returned from a successful get_poll or create_poll function.
poll = strawpy.get_poll('11682852') print poll print poll.id print poll.title print poll.votes print poll.options print poll.captcha print poll.dupcheck print poll.results print poll.results_with_percent print poll.url print poll.results_url poll.refresh() poll.open(results=False)
- Added url attribute to StrawPoll class objects.
- Added results_url to StrawPoll class objects.
- Added refresh method to StrawPoll class objects.
- Initial release.
StrawPy isn't endorsed by Strawpoll and doesn't reflect the views or opinions of Strawpoll or anyone officially involved in producing or managing Strawpoll or the Strawpoll API.
The MIT License (MIT)