Yet Another SPORE client
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
respire
.gitignore
.travis.yml
MANIFEST.in
Makefile
README.rst
dev-requirements.txt
setup.cfg
setup.py

README.rst

Respire: Yet Another SPORE client

Respire is a python client which consumes a SPORE description file and expose a python API for it.

Here is how to use it, out of the box, with a working SPORE defined website.

(These examples works with the Daybed project, but it woks the same with any other SPORE enabled service.):

from respire import client_from_url

cl = client_from_url('http://localhost:8000/spore')
cl.post_data(model_name='todo', data=dict(item='make it work', status='todo'))
cl.get_data(model_name='todo')

If you need to add headers to all the queries or handle cookies, you can pass a requests.Session instance:

from request import client_from_url
import requests

session = requests.Session()
session.headers['X-Some-App-Key'] = 'myapplicationkey'

cl = client_from_url('http://localhost:8000/spore', session=session)
cl.post_data(model_name='todo', data=dict(item='make it work', status='todo'))
cl.get_data(model_name='todo')

How to install it?

Currently, Respire is not packaged for pypi, so you need to get it from git:

$ git clone http://github.com/spiral-project/respire.git
(respire)$ make install
(respire)$ make tests