Skip to main content

Python wrapper for Auth0's Webtask API.

Project description

https://img.shields.io/pypi/v/pywebtasks.svg https://img.shields.io/pypi/dm/pywebtasks.svg 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!'

Project details


Download files

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

Source Distribution

pywebtasks-0.1.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pywebtasks-0.1.3-py2.py3-none-any.whl (6.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pywebtasks-0.1.3.tar.gz.

File metadata

  • Download URL: pywebtasks-0.1.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pywebtasks-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4797317c7daf045b832253f9eecd8b9ad6ee1ac405d7b7798fdb488aaeb2b16d
MD5 2dd8aa9a36674166a5e5766ec013b4fc
BLAKE2b-256 4ed326d123fdecb5090b540b859cf25841e6bc7a70647b6b1b83319c09de64ab

See more details on using hashes here.

File details

Details for the file pywebtasks-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pywebtasks-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bdc8c2ee2bfdde8402912b6385f4f472434be830342e99acd9ea291be504952a
MD5 a2ff99f3188073e12b0b5fa60f453188
BLAKE2b-256 828fd14100b83fe79517c90504bef8500ad1e014a91f3d2006cc4a0a9f411661

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page