Trombi is an asynchronous CouchDB client for Tornado.
trombi is Finnish for a small tornado, occuring in Europe.
Rationale behind fork:
- Simplified, easy doc access
- Support for exceptions/ tornado.gen.
NOTICE
Due to exceptions being raised workflow with passing callbacks won't work
- Removed additional layer (everything works on dicts)
- Document/ViewResult/ BulkResult classes
- Replaced error objects (returning error objects) with exceptions for use with tornado.gen
- ~~Add gen.engine in trombi.client for correct exception propagation~~
- Documentation
- Examples
- Unittests
For running tests:
Documentation created using Sphinx is available in doc/ directory. Compiling documentation requires version 0.6.x of Sphinx.
Online documentation can be seen on Github pages.
Issues are reported in Github and there's also a mailing list available in Google Groups.
import trombi from tornado.ioloop import IOLoop def main(): server = trombi.Server('http://localhost:5984') server.get('my_database', database_created, create=True) def database_created(db): if db.error: print 'Unable to create database!' print db.msg ioloop.stop() else: db.set('my_document', {'testvalue': 'something'}, doc_created) def doc_created(doc): if doc.error: print 'Unable to create document!' print doc.msg else: print 'Doc added!' ioloop.stop() if __name__ == '__main__': ioloop = IOLoop.instance() ioloop.add_callback(main) ioloop.start()
More usage examples can be found in tests.
Possibly incomplete list of authors can be found in AUTHORS file.
Trombi is licensed under MIT License. See LICENSE for more information.