topos.py - pythonic ToPoS library
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.rst
requirements.txt
setup.py
topos.py

README.rst

topos.py

pythonic ToPoS library

Usage

Process all available tokens in a pool:

>>> import topos
>>> topos = topos.Server()
>>> pool  = topos['12345']
>>> for token in pool:
>>>     # do work
>>>     del pool[token]

Tokens are provided as a Python dictionary with the following fields:

{
  'id':    '...',
  'value': '...',
  'lock':  '...',
}

Token locking (for exclusive tokens) and lock refreshing are handled automatically by the library if you ask for it:

>>> pool = topos['12345']
>>> pool.set(timeout=3600, autorefresh=True)

The lock will be removed when the token is deleted or after calling pool.unlock(token).

See pydoc topos for the full documentation.

Installation

topos.py requires Python 2.7 or later and the Requests module.

Authors

License

This software is licenced under the Apache License, Version 2.0. See the accompanying LICENSE file for details.