Skip to main content
Help improve PyPI by participating in a 5-minute user interface survey!

Python wrapper for Auth0's Webtask API.

Project Description

http://img.shields.io/travis/ssebastianj/pywebtasks.png

Installation

To install PyWebtasks, simply:

$ pip install pywebtasks

Usage

Create a new webtask token:

>>> from pywebtasks import tokens
>>> wt_token = tokens.create('your_auth_webtask_token')

To view your user’s auth webtask token go to the webtask.io token section.

To revoke a webtask token:

>>> tokens.revoke(wt_token)

Run a webtask from a string:

>>> import pywebtasks
>>> js_code = '''return function (context, cb) {
                   cb(null, "Hello, JS world!");
                 };
              '''
>>> req = pywebtasks.run(js_code,
                         'a_wt_container_name-0',
                         'a_webtask_token')
>>> req.content
'Hello, JS world!'

If you want to run the content of a source code file (for example, javascript.js), you can use the run_file function:

>>> req = pywebtasks.run_file('/path/to/a/file.js',
                              'a_wt_container_name-0',
                              'a_webtask_token')
>>> req.content
'Hello, JS world!'

Release history Release notifications

This version
History Node

0.1.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pywebtasks-0.1.3-py2.py3-none-any.whl (6.7 kB) Copy SHA256 hash SHA256 Wheel py2.py3 May 27, 2015
pywebtasks-0.1.3.tar.gz (5.3 kB) Copy SHA256 hash SHA256 Source None May 27, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page