Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jcarbaugh/python-tortilla

A Python library for dipping into Salsa (Labs)
https://github.com/jcarbaugh/python-tortilla

Last synced: 22 days ago
JSON representation

A Python library for dipping into Salsa (Labs)

Awesome Lists containing this project

README

        

# Tortilla

A Python library for dipping into [Salsa](http://www.salsalabs.com).

** PROTOTYPE **

This is still very much a work in progress. I'm not sure what the final structure of this library will be; I've got a number of ideas floating around in the repo here. [I'm open to suggestions!](https://github.com/sunlightlabs/python-tortilla/issues)

## The Basic Client

Authentication

from tortilla.core import salsa
salsa.authenticate('salsa20XX', '[email protected]', 'asecurepassword')

Save a new supporter

salsa.save('supporter', {'Email': '[email protected]'})

Updating a supporter

salsa.save('supporter', {'First_Name': 'Tomatillo'}, key=123456)

## Salsa Objects

There are Salsa objects that are meant to sit atop the underlying client methods.

a_person = salsa.supporter('123456')
a_person.Email = '[email protected]'
salsa.save(a_person)

The exact API is still undetermined.

## Object definitions and fields

Salsa provides endpoints for inspecting the structure of object tables.

field_defs = salsa.describe(Supporter.object)

Field objects can be created from the definitions

from tortilla import fields
supporter_fields = fields.get_fields(field_defs)

The field objects have methods for validating input and marshalling data.